introduce extraInitContainers to helm chart
New extraInitContainers configuration added. It allows to pass template with a list of containers to execute before main code-server container started. Main container will only start when all init containers are completed (exited with 0 code). Additionally changes the way extraContainers is used - instead of toYaml use tpl, because this allows to reference any values from extraContainers string.
This commit is contained in:
parent
6e9e891684
commit
1ffca5751c
10
CHANGELOG.md
10
CHANGELOG.md
@ -3,6 +3,7 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
- [Changelog](#changelog)
|
- [Changelog](#changelog)
|
||||||
|
- [Next Version](#next-version)
|
||||||
- [3.10.1](#3101)
|
- [3.10.1](#3101)
|
||||||
- [Bug Fixes](#bug-fixes)
|
- [Bug Fixes](#bug-fixes)
|
||||||
- [Documentation](#documentation)
|
- [Documentation](#documentation)
|
||||||
@ -51,6 +52,15 @@ VS Code v0.00.0
|
|||||||
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
## Next Version
|
||||||
|
|
||||||
|
VS Code v1.56.1
|
||||||
|
|
||||||
|
### New Features
|
||||||
|
|
||||||
|
- feat: supported `extraInitContainers` in helm chart values
|
||||||
|
- feat: changed `extraContainers` to support templating in helm chart
|
||||||
|
|
||||||
## 3.10.1
|
## 3.10.1
|
||||||
|
|
||||||
VS Code v1.56.1
|
VS Code v1.56.1
|
||||||
|
@ -65,6 +65,7 @@ and their default values.
|
|||||||
| extraArgs | list | `[]` | |
|
| extraArgs | list | `[]` | |
|
||||||
| extraConfigmapMounts | list | `[]` | |
|
| extraConfigmapMounts | list | `[]` | |
|
||||||
| extraContainers | string | `""` | |
|
| extraContainers | string | `""` | |
|
||||||
|
| extraInitContainers | string | `""` | |
|
||||||
| extraSecretMounts | list | `[]` | |
|
| extraSecretMounts | list | `[]` | |
|
||||||
| extraVars | list | `[]` | |
|
| extraVars | list | `[]` | |
|
||||||
| extraVolumeMounts | list | `[]` | |
|
| extraVolumeMounts | list | `[]` | |
|
||||||
@ -115,3 +116,47 @@ $ helm upgrade --install code-server ci/helm-chart -f values.yaml
|
|||||||
```
|
```
|
||||||
|
|
||||||
> **Tip**: You can use the default [values.yaml](values.yaml)
|
> **Tip**: You can use the default [values.yaml](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](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/).
|
||||||
|
|
||||||
|
Both parameters accept strings and use them as a templates
|
||||||
|
|
||||||
|
Example of using `extraInitContainers`:
|
||||||
|
|
||||||
|
``` yaml
|
||||||
|
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
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ 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.
|
@ -43,10 +43,13 @@ spec:
|
|||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: data
|
- name: data
|
||||||
mountPath: /home/coder
|
mountPath: /home/coder
|
||||||
|
{{- if .Values.extraInitContainers }}
|
||||||
|
{{ tpl .Values.extraInitContainers . | indent 6}}
|
||||||
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
{{- if .Values.extraContainers }}
|
{{- if .Values.extraContainers }}
|
||||||
{{ toYaml .Values.extraContainers | indent 8}}
|
{{ tpl .Values.extraContainers . | indent 8}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
- name: {{ .Chart.Name }}
|
- name: {{ .Chart.Name }}
|
||||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||||
|
Reference in New Issue
Block a user