code-server

by Code Server Boilerplates

Helm chartv1.0.3App 3.10.2

A Helm chart for cdr/code-server

About this chart

code-server

code-server code-server is VS Code running on a remote server, accessible through the browser.

This chart is community maintained by @Matthew-Beckett and @alexgorbatchev

TL;DR;

$ git clone https://github.com/cdr/code-server
$ cd code-server
$ helm upgrade --install code-server ci/helm-chart

Introduction

This chart bootstraps a code-server deployment on a Kubernetes cluster using the Helm package manager.

Prerequisites

  • Kubernetes 1.6+

Installing the Chart

To install the chart with the release name code-server:

$ git clone https://github.com/cdr/code-server
$ cd code-server
$ helm upgrade --install code-server ci/helm-chart

The command deploys code-server on the Kubernetes cluster in the default configuration. The configuration section lists the parameters that can be configured during installation.

Tip: List all releases using helm list

Uninstalling the Chart

To uninstall/delete the code-server deployment:

$ helm delete code-server

The command removes all the Kubernetes components associated with the chart and deletes the release.

Configuration

The following table lists the configurable parameters of the code-server chart and their default values.

Values

KeyTypeDefaultDescription
affinityobject{}
extraArgslist[]
extraConfigmapMountslist[]
extraContainersstring""
extraInitContainersstring""
extraSecretMountslist[]
extraVarslist[]
extraVolumeMountslist[]
fullnameOverridestring""
hostnameOverridestring""
image.pullPolicystring"Always"
image.repositorystring"codercom/code-server"
image.tagstring"3.10.2"
imagePullSecretslist[]
ingress.enabledboolfalse
nameOverridestring""
nodeSelectorobject{}
persistence.accessModestring"ReadWriteOnce"
persistence.annotationsobject{}
persistence.enabledbooltrue
persistence.sizestring"1Gi"
podAnnotationsobject{}
podSecurityContextobject{}
replicaCountint1
resourcesobject{}
securityContext.enabledbooltrue
securityContext.fsGroupint1000
securityContext.runAsUserint1000
service.portint8443
service.typestring"ClusterIP"
serviceAccount.createbooltrue
serviceAccount.namestringnil
tolerationslist[]
volumePermissions.enabledbooltrue
volumePermissions.securityContext.runAsUserint0

Specify each parameter using the --set key=value[,key=value] argument to helm install. For example,

$ helm upgrade --install code-server \
    ci/helm-chart \
    --set persistence.enabled=false

The above command sets the the persistence storage to false.

Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example,

$ helm upgrade --install code-server ci/helm-chart -f values.yaml

Tip: You can use the default values.yaml

Extra Containers

There are two parameters which allow to add more containers to pod. Use extraContainers to add regular containers and extraInitContainers to add init containers. You can read more about init containers in k8s documentation.

Both parameters accept strings and use them as a templates

Example of using extraInitContainers:

extraInitContainers: |
  - name: customization
    image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
    imagePullPolicy: IfNotPresent
    env:
      - name: SERVICE_URL
        value: https://open-vsx.org/vscode/gallery
      - name: ITEM_URL
        value: https://open-vsx.org/vscode/item
    command:
      - sh
      - -c
      - |
        code-server --install-extension ms-python.python
        code-server --install-extension golang.Go
    volumeMounts:
      - name: data
        mountPath: /home/coder

With this yaml in file init.yaml, you can execute

$ helm upgrade --install code-server \
    ci/helm-chart \
    --values init.yaml

to deploy code-server with python and golang extensions preinstalled before main container have started.

Deploy code-server with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has code-server on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartcode-server is pinned at v1.0.3 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply