Add 'extraContainers' parameter (#697)
### Description of the change Adds an 'extraContainers' parameter. ### Benefits Users will be able to run sidecar containers as required by their environment. ### Possible drawbacks N/A ### Applicable issues - Fixes #696 ### Checklist - [X] Parameters are documented in the `values.yaml` and added to the `README.md` using [readme-generator-for-helm](https://github.com/bitnami-labs/readme-generator-for-helm) Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/697 Reviewed-by: justusbunsi <justusbunsi@noreply.gitea.com> Co-authored-by: rossigee <rossigee@noreply.gitea.com> Co-committed-by: rossigee <rossigee@noreply.gitea.com>
This commit is contained in:
parent
a08e39f8ff
commit
aa9808bc27
@ -980,6 +980,7 @@ To comply with the Gitea helm chart definition of the digest parameter, a "custo
|
|||||||
| `persistence.storageClass` | Name of the storage class to use | `nil` |
|
| `persistence.storageClass` | Name of the storage class to use | `nil` |
|
||||||
| `persistence.subPath` | Subdirectory of the volume to mount at | `nil` |
|
| `persistence.subPath` | Subdirectory of the volume to mount at | `nil` |
|
||||||
| `persistence.volumeName` | Name of persistent volume in PVC | `""` |
|
| `persistence.volumeName` | Name of persistent volume in PVC | `""` |
|
||||||
|
| `extraContainers` | Additional sidecar containers to run in the pod | `[]` |
|
||||||
| `extraVolumes` | Additional volumes to mount to the Gitea deployment | `[]` |
|
| `extraVolumes` | Additional volumes to mount to the Gitea deployment | `[]` |
|
||||||
| `extraContainerVolumeMounts` | Mounts that are only mapped into the Gitea runtime/main container, to e.g. override custom templates. | `[]` |
|
| `extraContainerVolumeMounts` | Mounts that are only mapped into the Gitea runtime/main container, to e.g. override custom templates. | `[]` |
|
||||||
| `extraInitVolumeMounts` | Mounts that are only mapped into the init-containers. Can be used for additional preconfiguration. | `[]` |
|
| `extraInitVolumeMounts` | Mounts that are only mapped into the init-containers. Can be used for additional preconfiguration. | `[]` |
|
||||||
|
@ -340,6 +340,9 @@ spec:
|
|||||||
subPath: {{ .Values.persistence.subPath }}
|
subPath: {{ .Values.persistence.subPath }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- include "gitea.container-additional-mounts" . | nindent 12 }}
|
{{- include "gitea.container-additional-mounts" . | nindent 12 }}
|
||||||
|
{{- if .Values.extraContainers }}
|
||||||
|
{{- toYaml .Values.extraContainers | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
{{- with .Values.global.hostAliases }}
|
{{- with .Values.global.hostAliases }}
|
||||||
hostAliases:
|
hostAliases:
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
@ -403,4 +406,4 @@ spec:
|
|||||||
{{- else if not .Values.persistence.enabled }}
|
{{- else if not .Values.persistence.enabled }}
|
||||||
- name: data
|
- name: data
|
||||||
emptyDir: {}
|
emptyDir: {}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
21
unittests/deployment/sidecar-container.yaml
Normal file
21
unittests/deployment/sidecar-container.yaml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
suite: sidecar container
|
||||||
|
release:
|
||||||
|
name: gitea-unittests
|
||||||
|
namespace: testing
|
||||||
|
templates:
|
||||||
|
- templates/gitea/deployment.yaml
|
||||||
|
- templates/gitea/config.yaml
|
||||||
|
tests:
|
||||||
|
- it: supports adding a sidecar container
|
||||||
|
template: templates/gitea/deployment.yaml
|
||||||
|
set:
|
||||||
|
extraContainers:
|
||||||
|
- name: sidecar-bob
|
||||||
|
image: busybox
|
||||||
|
asserts:
|
||||||
|
- equal:
|
||||||
|
path: spec.template.spec.containers[1].name
|
||||||
|
value: "sidecar-bob"
|
||||||
|
- equal:
|
||||||
|
path: spec.template.spec.containers[1].image
|
||||||
|
value: "busybox"
|
@ -283,6 +283,12 @@ persistence:
|
|||||||
annotations:
|
annotations:
|
||||||
helm.sh/resource-policy: keep
|
helm.sh/resource-policy: keep
|
||||||
|
|
||||||
|
## @param extraContainers Additional sidecar containers to run in the pod
|
||||||
|
extraContainers: []
|
||||||
|
# - name: sidecar-bob
|
||||||
|
# image: busybox
|
||||||
|
# command: [/bin/sh, -c, 'echo "Hello world"; sleep 86400']
|
||||||
|
|
||||||
## @param extraVolumes Additional volumes to mount to the Gitea deployment
|
## @param extraVolumes Additional volumes to mount to the Gitea deployment
|
||||||
extraVolumes: []
|
extraVolumes: []
|
||||||
# - name: postgres-ssl-vol
|
# - name: postgres-ssl-vol
|
||||||
|
Loading…
x
Reference in New Issue
Block a user