Skip to content

Commit 21aec50

Browse files
committed
Align code-server helm chart
1 parent 49cc344 commit 21aec50

File tree

5 files changed

+73
-26
lines changed

5 files changed

+73
-26
lines changed

charts/code-server/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 3.4.1
18+
version: 3.30.2
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
2222
# follow Semantic Versioning. They should reflect the version the application is using.
23-
appVersion: 4.9.1
23+
appVersion: 4.103.2

charts/code-server/templates/deployment.yaml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ metadata:
88
app.kubernetes.io/instance: {{ .Release.Name }}
99
app.kubernetes.io/managed-by: {{ .Release.Service }}
1010
spec:
11-
replicas: 1
11+
replicas: {{ .Values.replicaCount | default 1 }}
1212
strategy:
1313
type: Recreate
1414
selector:
@@ -20,6 +20,9 @@ spec:
2020
labels:
2121
app.kubernetes.io/name: {{ include "code-server.name" . }}
2222
app.kubernetes.io/instance: {{ .Release.Name }}
23+
{{- if .Values.podAnnotations }}
24+
annotations: {{- toYaml .Values.podAnnotations | nindent 8 }}
25+
{{- end }}
2326
spec:
2427
imagePullSecrets: {{- toYaml .Values.imagePullSecrets | nindent 8 }}
2528
{{- if .Values.hostnameOverride }}
@@ -32,8 +35,9 @@ spec:
3235
securityContext:
3336
fsGroup: {{ .Values.securityContext.fsGroup }}
3437
{{- end }}
35-
{{- if and .Values.volumePermissions.enabled .Values.persistence.enabled }}
38+
{{- if or (and .Values.volumePermissions.enabled .Values.persistence.enabled) .Values.extraInitContainers }}
3639
initContainers:
40+
{{- if and .Values.volumePermissions.enabled .Values.persistence.enabled }}
3741
- name: init-chmod-data
3842
image: busybox:latest
3943
imagePullPolicy: IfNotPresent
@@ -47,6 +51,7 @@ spec:
4751
volumeMounts:
4852
- name: data
4953
mountPath: /home/coder
54+
{{- end }}
5055
{{- if .Values.extraInitContainers }}
5156
{{ tpl .Values.extraInitContainers . | indent 6}}
5257
{{- end }}
@@ -102,6 +107,7 @@ spec:
102107
{{- range .Values.extraSecretMounts }}
103108
- name: {{ .name }}
104109
mountPath: {{ .mountPath }}
110+
subPath: {{ .subPath | default "" }}
105111
readOnly: {{ .readOnly }}
106112
{{- end }}
107113
{{- range .Values.extraVolumeMounts }}
@@ -114,6 +120,11 @@ spec:
114120
- name: http
115121
containerPort: 8080
116122
protocol: TCP
123+
{{- range .Values.extraPorts }}
124+
- name: {{ .name }}
125+
containerPort: {{ .port }}
126+
protocol: {{ .protocol }}
127+
{{- end }}
117128
livenessProbe:
118129
httpGet:
119130
path: /
@@ -168,9 +179,12 @@ spec:
168179
{{- if .existingClaim }}
169180
persistentVolumeClaim:
170181
claimName: {{ .existingClaim }}
171-
{{- else }}
182+
{{- else if .hostPath }}
172183
hostPath:
173184
path: {{ .hostPath }}
174185
type: Directory
186+
{{- else }}
187+
emptyDir:
188+
{{- toYaml .emptyDir | nindent 10 }}
175189
{{- end }}
176190
{{- end }}

charts/code-server/templates/secrets.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if not .Values.existingSecret }}
12
apiVersion: v1
23
kind: Secret
34
metadata:
@@ -11,8 +12,9 @@ metadata:
1112
app.kubernetes.io/managed-by: {{ .Release.Service }}
1213
type: Opaque
1314
data:
14-
{{ if .Values.password }}
15+
{{- if .Values.password }}
1516
password: "{{ .Values.password | b64enc }}"
16-
{{ else }}
17+
{{- else }}
1718
password: "{{ randAlphaNum 24 | b64enc }}"
18-
{{ end }}
19+
{{- end }}
20+
{{- end }}

charts/code-server/templates/service.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ spec:
1414
targetPort: http
1515
protocol: TCP
1616
name: http
17+
{{- range .Values.extraPorts }}
18+
- port: {{ .port }}
19+
targetPort: {{ .port }}
20+
protocol: {{ .protocol }}
21+
name: {{ .name }}
22+
{{- end }}
1723
selector:
1824
app.kubernetes.io/name: {{ include "code-server.name" . }}
1925
app.kubernetes.io/instance: {{ .Release.Name }}

charts/code-server/values.yaml

Lines changed: 43 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ replicaCount: 1
66

77
image:
88
repository: codercom/code-server
9-
tag: '4.9.1'
9+
tag: '4.103.2'
1010
pullPolicy: Always
1111

1212
# Specifies one or more secrets to be used when pulling images from a
@@ -19,6 +19,9 @@ nameOverride: ""
1919
fullnameOverride: ""
2020
hostnameOverride: ""
2121

22+
# The existing secret to use for code-server authentication in the frontend. the password is stored in the secret under the key `password`
23+
# existingSecret: ""
24+
2225
serviceAccount:
2326
# Specifies whether a service account should be created
2427
create: true
@@ -71,9 +74,10 @@ extraArgs: []
7174
# Optional additional environment variables
7275
extraVars: []
7376
# - name: DISABLE_TELEMETRY
74-
# value: true
77+
# value: "true"
78+
# if dind is desired:
7579
# - name: DOCKER_HOST
76-
# value: "tcp://localhost:2375"
80+
# value: "tcp://localhost:2376"
7781

7882
##
7983
## Init containers parameters:
@@ -136,25 +140,39 @@ lifecycle:
136140
# - -c
137141
# - curl -s -L SOME_SCRIPT | bash
138142

143+
# for dind, the following may be helpful
144+
# postStart:
145+
# exec:
146+
# command:
147+
# - /bin/sh
148+
# - -c
149+
# - |
150+
# sudo apt-get update \
151+
# && sudo apt-get install -y docker.io
152+
139153
## Enable an Specify container in extraContainers.
140154
## This is meant to allow adding code-server dependencies, like docker-dind.
141155
extraContainers: |
142156
# If docker-dind is used, DOCKER_HOST env is mandatory to set in "extraVars"
143-
#- name: docker-dind
144-
# image: docker:19.03-dind
145-
# imagePullPolicy: IfNotPresent
146-
# resources:
147-
# requests:
148-
# cpu: 250m
149-
# memory: 256M
150-
# securityContext:
151-
# privileged: true
152-
# procMount: Default
153-
# env:
154-
# - name: DOCKER_TLS_CERTDIR
155-
# value: ""
156-
# - name: DOCKER_DRIVER
157-
# value: "overlay2"
157+
# - name: docker-dind
158+
# image: docker:28.3.2-dind
159+
# imagePullPolicy: IfNotPresent
160+
# resources:
161+
# requests:
162+
# cpu: 1
163+
# ephemeral-storage: "50Gi"
164+
# memory: 10Gi
165+
# securityContext:
166+
# privileged: true
167+
# procMount: Default
168+
# env:
169+
# - name: DOCKER_TLS_CERTDIR
170+
# value: "" # disable TLS setup
171+
# command:
172+
# - dockerd
173+
# - --host=unix:///var/run/docker.sock
174+
# - --host=tcp://0.0.0.0:2376
175+
158176

159177
extraInitContainers: |
160178
# - name: customization
@@ -179,6 +197,7 @@ extraInitContainers: |
179197
extraSecretMounts: []
180198
# - name: secret-files
181199
# mountPath: /etc/secrets
200+
# subPath: private.key # (optional)
182201
# secretName: code-server-secret-files
183202
# readOnly: true
184203

@@ -189,10 +208,16 @@ extraVolumeMounts: []
189208
# readOnly: true
190209
# existingClaim: volume-claim
191210
# hostPath: ""
211+
# emptyDir: {}
192212

193213
extraConfigmapMounts: []
194214
# - name: certs-configmap
195215
# mountPath: /etc/code-server/ssl/
196216
# subPath: certificates.crt # (optional)
197217
# configMap: certs-configmap
198218
# readOnly: true
219+
220+
extraPorts: []
221+
# - name: minecraft
222+
# port: 25565
223+
# protocol: tcp

0 commit comments

Comments
 (0)