|
| 1 | +# code-server |
| 2 | + |
| 3 | +   |
| 4 | + |
| 5 | +[code-server](https://github.com/cdr/code-server) code-server is VS Code running |
| 6 | +on a remote server, accessible through the browser. |
| 7 | + |
| 8 | +This chart is community maintained by [@Matthew-Beckett](https://github.com/Matthew-Beckett) and [@alexgorbatchev](https://github.com/alexgorbatchev) |
| 9 | + |
| 10 | +## TL;DR; |
| 11 | + |
| 12 | +```console |
| 13 | +$ git clone https://github.com/cdr/code-server |
| 14 | +$ cd code-server |
| 15 | +$ helm upgrade --install code-server ci/helm-chart |
| 16 | +``` |
| 17 | + |
| 18 | +## Introduction |
| 19 | + |
| 20 | +This chart bootstraps a code-server deployment on a |
| 21 | +[Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) |
| 22 | +package manager. |
| 23 | + |
| 24 | +## Prerequisites |
| 25 | + |
| 26 | + - Kubernetes 1.6+ |
| 27 | + |
| 28 | +## Installing the Chart |
| 29 | + |
| 30 | +To install the chart with the release name `code-server`: |
| 31 | + |
| 32 | +```console |
| 33 | +$ git clone https://github.com/cdr/code-server |
| 34 | +$ cd code-server |
| 35 | +$ helm upgrade --install code-server ci/helm-chart |
| 36 | +``` |
| 37 | + |
| 38 | +The command deploys code-server on the Kubernetes cluster in the default |
| 39 | +configuration. The [configuration](#configuration) section lists the parameters |
| 40 | +that can be configured during installation. |
| 41 | + |
| 42 | +> **Tip**: List all releases using `helm list` |
| 43 | +
|
| 44 | +## Uninstalling the Chart |
| 45 | + |
| 46 | +To uninstall/delete the `code-server` deployment: |
| 47 | + |
| 48 | +```console |
| 49 | +$ helm delete code-server |
| 50 | +``` |
| 51 | + |
| 52 | +The command removes all the Kubernetes components associated with the chart and |
| 53 | +deletes the release. |
| 54 | + |
| 55 | +## Configuration |
| 56 | + |
| 57 | +The following table lists the configurable parameters of the code-server chart |
| 58 | +and their default values. |
| 59 | + |
| 60 | +## Values |
| 61 | + |
| 62 | +| Key | Type | Default | Description | |
| 63 | +|-----|------|---------|-------------| |
| 64 | +| affinity | object | `{}` | | |
| 65 | +| extraArgs | list | `[]` | | |
| 66 | +| extraConfigmapMounts | list | `[]` | | |
| 67 | +| extraContainers | string | `""` | | |
| 68 | +| extraInitContainers | string | `""` | | |
| 69 | +| extraSecretMounts | list | `[]` | | |
| 70 | +| extraVars | list | `[]` | | |
| 71 | +| extraVolumeMounts | list | `[]` | | |
| 72 | +| fullnameOverride | string | `""` | | |
| 73 | +| hostnameOverride | string | `""` | | |
| 74 | +| image.pullPolicy | string | `"Always"` | | |
| 75 | +| image.repository | string | `"codercom/code-server"` | | |
| 76 | +| image.tag | string | `"3.11.1"` | | |
| 77 | +| imagePullSecrets | list | `[]` | | |
| 78 | +| ingress.enabled | bool | `false` | | |
| 79 | +| nameOverride | string | `""` | | |
| 80 | +| nodeSelector | object | `{}` | | |
| 81 | +| persistence.accessMode | string | `"ReadWriteOnce"` | | |
| 82 | +| persistence.annotations | object | `{}` | | |
| 83 | +| persistence.enabled | bool | `true` | | |
| 84 | +| persistence.size | string | `"1Gi"` | | |
| 85 | +| podAnnotations | object | `{}` | | |
| 86 | +| podSecurityContext | object | `{}` | | |
| 87 | +| replicaCount | int | `1` | | |
| 88 | +| resources | object | `{}` | | |
| 89 | +| securityContext.enabled | bool | `true` | | |
| 90 | +| securityContext.fsGroup | int | `1000` | | |
| 91 | +| securityContext.runAsUser | int | `1000` | | |
| 92 | +| service.port | int | `8443` | | |
| 93 | +| service.type | string | `"ClusterIP"` | | |
| 94 | +| serviceAccount.create | bool | `true` | | |
| 95 | +| serviceAccount.name | string | `nil` | | |
| 96 | +| tolerations | list | `[]` | | |
| 97 | +| volumePermissions.enabled | bool | `true` | | |
| 98 | +| volumePermissions.securityContext.runAsUser | int | `0` | | |
| 99 | + |
| 100 | +Specify each parameter using the `--set key=value[,key=value]` argument to `helm |
| 101 | +install`. For example, |
| 102 | + |
| 103 | +```console |
| 104 | +$ helm upgrade --install code-server \ |
| 105 | + ci/helm-chart \ |
| 106 | + --set persistence.enabled=false |
| 107 | +``` |
| 108 | + |
| 109 | +The above command sets the the persistence storage to false. |
| 110 | + |
| 111 | +Alternatively, a YAML file that specifies the values for the above parameters |
| 112 | +can be provided while installing the chart. For example, |
| 113 | + |
| 114 | +```console |
| 115 | +$ helm upgrade --install code-server ci/helm-chart -f values.yaml |
| 116 | +``` |
| 117 | + |
| 118 | +> **Tip**: You can use the default [values.yaml](values.yaml) |
| 119 | +
|
| 120 | +# Extra Containers |
| 121 | + |
| 122 | +There are two parameters which allow to add more containers to pod. |
| 123 | +Use `extraContainers` to add regular containers |
| 124 | +and `extraInitContainers` to add init containers. You can read more |
| 125 | +about init containers in [k8s documentation](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/). |
| 126 | + |
| 127 | +Both parameters accept strings and use them as a templates |
| 128 | + |
| 129 | +Example of using `extraInitContainers`: |
| 130 | + |
| 131 | +``` yaml |
| 132 | +extraInitContainers: | |
| 133 | + - name: customization |
| 134 | + image: {{ .Values.image.repository }}:{{ .Values.image.tag }} |
| 135 | + imagePullPolicy: IfNotPresent |
| 136 | + env: |
| 137 | + - name: SERVICE_URL |
| 138 | + value: https://open-vsx.org/vscode/gallery |
| 139 | + - name: ITEM_URL |
| 140 | + value: https://open-vsx.org/vscode/item |
| 141 | + command: |
| 142 | + - sh |
| 143 | + - -c |
| 144 | + - | |
| 145 | + code-server --install-extension ms-python.python |
| 146 | + code-server --install-extension golang.Go |
| 147 | + volumeMounts: |
| 148 | + - name: data |
| 149 | + mountPath: /home/coder |
| 150 | +
|
| 151 | +``` |
| 152 | +
|
| 153 | +With this yaml in file `init.yaml`, you can execute |
| 154 | + |
| 155 | +```console |
| 156 | +$ helm upgrade --install code-server \ |
| 157 | + ci/helm-chart \ |
| 158 | + --values init.yaml |
| 159 | +``` |
| 160 | + |
| 161 | +to deploy code-server with python and golang extensions preinstalled |
| 162 | +before main container have started. |
0 commit comments