Skip to content
This repository was archived by the owner on Aug 18, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
206 changes: 0 additions & 206 deletions admin/workspace-management/cvms.md

This file was deleted.

67 changes: 67 additions & 0 deletions admin/workspace-management/cvms/cluster-setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
title: Cluster setup
description: Learn how to set up K8s clusters capable of supporting CVMs.
---

The following sections show how you can set up your Kubernetes clusters hosted
by Google, Azure, and Amazon to support CVMs.

## Google Cloud Platform w/ GKE

To use CVMs with GKE, [create a cluster](../../../setup/kubernetes/google.md)
with the following parameters set:

- GKE Master version `latest`
- `node-version = "latest"`
- `image-type = "UBUNTU"`

Example:

```console
gcloud beta container clusters create "YOUR_NEW_CLUSTER" \
--node-version "latest" \
--cluster-version "latest" \
--image-type "UBUNTU"
...
```

## Azure Kubernetes Service

If you're using Kubernetes version `1.18`, Azure defaults to the correct Ubuntu
node base image. When
[creating your cluster](../../../setup/kubernetes/azure.md), set
`--kubernetes-version` to `1.18.x` or newer for CVMs.

## Amazon Web Services w/ EKS

You can modify an existing
[AWS-hosted container](../../../setup/kubernetes/aws.md) to support CVMs by
[creating a nodegroup](https://eksctl.io/usage/managing-nodegroups/#creating-a-nodegroup-from-a-config-file)
and updating your `eksctl` config spec.

1. Define your config file in the location of your choice (we've named the file
`coder-node.yaml`, but you can call it whatever you'd like):

```yaml
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig

metadata:
version: "1.21"
name: <YOUR_CLUSTER_NAME>
region: <YOUR_AWS_REGION>

nodeGroups:
- name: coder-node-group
amiFamily: Ubuntu2004
ami: <your Ubuntu 20.04 AMI ID>
```

> [See here for a list of EKS-compatible Ubuntu AMI IDs](https://cloud-images.ubuntu.com/docs/aws/eks/)

1. Create your nodegroup using the config file you just created (be sure to
provide the correct file name):

```console
eksctl create nodegroup --config-file=coder-node.yaml
```
72 changes: 72 additions & 0 deletions admin/workspace-management/cvms/images.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
title: Images
description: Learn how to work with images for CVM-enabled workspaces.
---

This article walks you through how to
[configure images](../../../images/configure.md) for use with CVMs, as well as
how to access images located in private [registries](../../registries/index.md).

## Image configuration

The following sections show how you can configure your image to include systemd
and Docker for use in CVMs.

### systemd

If your image's OS distribution doesn't link the `systemd` init to `/sbin/init`,
you'll need to do this manually in your Dockerfile.

The following snippet shows how you can specify `systemd` as the init in your
image:

```Dockerfile
FROM ubuntu:20.04
RUN apt-get update && apt-get install -y \
build-essential \
systemd

# use systemd as the init
RUN ln -s /lib/systemd/systemd /sbin/init
```

When you start up a workspace, Coder checks for the presence of `/sbin/init` in
your image. If it exists, then Coder uses it as the container entrypoint with a
`PID` of 1.

### Docker

To add Docker, install the `docker` packages into your image. For a seamless
experience, use [systemd](#systemd) and register the `docker` service so
`dockerd` runs automatically during initialization.

The following snippet shows how your image can register the `docker` services in
its Dockerfile.

```Dockerfile
FROM ubuntu:20.04
RUN apt-get update && apt-get install -y \
build-essential \
git \
bash \
docker.io \
curl \
sudo \
systemd

# Enables Docker starting with systemd
RUN systemctl enable docker

# use systemd as the init
RUN ln -s /lib/systemd/systemd /sbin/init
```

## Private registries

To use CVM workspaces with private images, you **must** create a
[registry](../../registries/index.md#adding-a-registry) with authentication
credentials. Private images that can be pulled directly by the node will not
work with CVMs.

This restriction does not apply if you enable
[cached CVMs](../cvms/management.md#enabling-cached-cvms).
Loading