Skip to content
This repository was archived by the owner on Aug 18, 2025. It is now read-only.

Commit 16fc53b

Browse files
author
Katie Horne
committed
chore: refactor CVMs docs
1 parent 25fa507 commit 16fc53b

File tree

6 files changed

+237
-204
lines changed

6 files changed

+237
-204
lines changed

admin/workspace-management/cvms.md

Lines changed: 0 additions & 203 deletions
This file was deleted.
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
title: Cluster setup
3+
description: Learn how to set up K8s clusters capable of supporting CVMs.
4+
---
5+
6+
The following sections show how you can set up your Kubernetes clusters hosted
7+
by Google, Azure, and Amazon to support CVMs.
8+
9+
## Google Cloud Platform w/ GKE
10+
11+
To use CVMs with GKE, [create a cluster](../../setup/kubernetes/google.md) using
12+
the following parameters:
13+
14+
- GKE Master version `latest`
15+
- `node-version = "latest"`
16+
- `image-type = "UBUNTU"`
17+
18+
For example:
19+
20+
```console
21+
gcloud beta container clusters create "YOUR_NEW_CLUSTER" \
22+
--node-version "latest" \
23+
--cluster-version "latest" \
24+
--image-type "UBUNTU"
25+
...
26+
```
27+
28+
## Azure Kubernetes Service
29+
30+
If you're using Kubernetes version 1.18, Azure defaults to the correct Ubuntu
31+
node base image. When
32+
[creating your cluster](../../../setup/Kubernetes/azure.md), set
33+
`--kubernetes-version` to `1.18.x` or newer for CVMs.
34+
35+
## Amazon Web Services w/ EKS
36+
37+
You can modify an existing [AWS-hosted container](../../setup/kubernetes/aws.md)
38+
to support CVMs by
39+
[creating a nodegroup](https://eksctl.io/usage/managing-nodegroups/#creating-a-nodegroup-from-a-config-file)
40+
and updating your `eksctl` config spec.
41+
42+
1. Define your config file in the location of your choice (we've named the file
43+
`coder-node.yaml`, but you can call it whatever you'd like):
44+
45+
```yaml
46+
apiVersion: eksctl.io/v1alpha5
47+
kind: ClusterConfig
48+
49+
metadata:
50+
version: "1.17"
51+
name: <YOUR_CLUSTER_NAME>
52+
region: <YOUR_AWS_REGION>
53+
54+
nodeGroups:
55+
- name: coder-node-group
56+
amiFamily: Ubuntu1804
57+
```
58+
59+
1. Create your nodegroup (be sure to provide the correct file name):
60+
61+
```console
62+
eksctl create nodegroup --config-file=coder-node.yaml
63+
```
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
title: Images
3+
description: Learn how to work with images for CVM-enabled workspaces.
4+
---
5+
6+
This article walks you through how to configure images for use with CVMs, as
7+
well as how to access images located in private registries.
8+
9+
## Image configuration
10+
11+
The following sections show how you can configure your image to include systemd
12+
and Docker for use in CVMs.
13+
14+
### systemd
15+
16+
If your image's OS distribution doesn't link the `systemd` init to `/sbin/init`,
17+
you'll need to do this manually in your Dockerfile.
18+
19+
The following snippet shows how you can specify `systemd` as the init in your
20+
image:
21+
22+
```Dockerfile
23+
FROM ubuntu:20.04
24+
RUN apt-get update && apt-get install -y \
25+
build-essential \
26+
systemd
27+
28+
# use systemd as the init
29+
RUN ln -s /lib/systemd/systemd /sbin/init
30+
```
31+
32+
When you start up a workspace, Coder checks for the presence of `/sbin/init` in
33+
your image. If it exists, then Coder uses it as the container entrypoint with a
34+
`PID` of 1.
35+
36+
### Docker
37+
38+
To add Docker, install the `docker` packages into your image. For a seamless
39+
experience, use [systemd](#systemd) and register the `docker` service so
40+
`dockerd` runs automatically during initialization.
41+
42+
The following snippet shows how your image can register the `docker` services in
43+
its Dockerfile.
44+
45+
```Dockerfile
46+
FROM ubuntu:20.04
47+
RUN apt-get update && apt-get install -y \
48+
build-essential \
49+
git \
50+
bash \
51+
docker.io \
52+
curl \
53+
sudo \
54+
systemd
55+
56+
# Enables Docker starting with systemd
57+
RUN systemctl enable docker
58+
59+
# use systemd as the init
60+
RUN ln -s /lib/systemd/systemd /sbin/init
61+
```
62+
63+
## Private registries
64+
65+
To use CVM workspaces with private images, you **must** create a
66+
[registry](../registries/index.md#adding-a-registry) with authentication
67+
credentials. Private images that can be pulled directly by the node will not
68+
work with CVMs.
69+
70+
This restriction is removed if you enable [cached CVMs](#enabling-cached-cvms).

0 commit comments

Comments
 (0)