Skip to content

Commit 10d5ac2

Browse files
committed
update kubernetes readme
1 parent e3616e9 commit 10d5ac2

File tree

1 file changed

+20
-8
lines changed
  • examples/templates/devcontainer-kubernetes

1 file changed

+20
-8
lines changed

examples/templates/devcontainer-kubernetes/README.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,15 @@ tags: [container, kubernetes, devcontainer]
99

1010
# Remote Development on Kubernetes Pods (with Devcontainers)
1111

12-
Provision Kubernetes Pods as [Coder workspaces](https://coder.com/docs/v2/latest/workspaces) with this example template.
13-
14-
<!-- TODO: Add screenshot -->
12+
Provision Devcontainers as [Coder workspaces](https://coder.com/docs/v2/latest/workspaces) on Kubernetes with this example template.
1513

1614
## Prerequisites
1715

1816
### Infrastructure
1917

20-
**Cluster**: This template requires an existing Kubernetes cluster
18+
**Cluster**: This template requires an existing Kubernetes cluster.
2119

22-
**Container Image**: This template uses the [codercom/enterprise-base:ubuntu image](https://github.com/coder/enterprise-images/tree/main/images/base) with some dev tools preinstalled. To add additional tools, extend this image or build it yourself.
20+
**Container Image**: This template uses the [envbuilder image](https://github.com/coder/envbuilder) to build a Devcontainer from a `devcontainer.json`.
2321

2422
### Authentication
2523

@@ -31,10 +29,24 @@ Coder supports devcontainers with [envbuilder](https://github.com/coder/envbuild
3129

3230
This template provisions the following resources:
3331

34-
- Kubernetes pod (ephemeral)
35-
- Kubernetes persistent volume claim (persistent on `/home/coder`)
32+
- Kubernetes deployment (ephemeral)
33+
- Kubernetes persistent volume claim (persistent on `/workspaces`)
3634

37-
This means, when the workspace restarts, any tools or files outside of the home directory are not persisted. To pre-bake tools into the workspace (e.g. `python3`), modify the container image. Alternatively, individual developers can [personalize](https://coder.com/docs/v2/latest/dotfiles) their workspaces with dotfiles.
35+
This template will fetch a Git repo containing a `devcontainer.json` specified by the `repo` parameter, and builds it
36+
with [`envbuilder`](https://github.com/coder/envbuilder).
37+
The Git repository is cloned inside the `/workspaces` volume if not present.
38+
Any local changes to the Devcontainer files inside the volume will be applied when you restart the workspace.
39+
As you might suspect, any tools or files outside of `/workspaces` or not added as part of the Devcontainer specification are not persisted.
40+
Edit the `devcontainer.json` instead!
3841

3942
> **Note**
4043
> This template is designed to be a starting point! Edit the Terraform to extend the template to support your use case.
44+
45+
## Caching
46+
47+
To speed up your builds, you can use a container registry as a cache.
48+
When creating the template, set the parameter `cache_repo`.
49+
50+
> [!NOTE] We recommend using a registry cache with authentication enabled.
51+
> To allow Envbuilder to authenticate with the registry cache, specify the variable `cache_repo_dockerconfig_secret`
52+
> with the name of a Kubernetes secret in the same namespace as Coder. The secret must contain the key `.dockerconfigjson`.

0 commit comments

Comments
 (0)