diff --git a/hacks/values/hydra.yaml b/hacks/values/hydra.yaml index 2fdbede7df..234e5ef00e 100644 --- a/hacks/values/hydra.yaml +++ b/hacks/values/hydra.yaml @@ -169,6 +169,13 @@ cronjob: image: "alpine:latest" command: ["/bin/sh"] args: ["-c", "sleep infinity"] + extraVolumeMounts: + - mountPath: /testdir + name: test-volume + extraVolumes: + - name: test-volume + configMap: + name: cm-sample podMetadata: labels: ory.sh/pod_label: hydra diff --git a/helm/charts/hydra/README.md b/helm/charts/hydra/README.md index 67fe395bd6..144646f0ba 100644 --- a/helm/charts/hydra/README.md +++ b/helm/charts/hydra/README.md @@ -38,6 +38,8 @@ A Helm chart for deploying ORY Hydra in Kubernetes | cronjob.janitor.extraContainers | string | `""` | If you want to add extra sidecar containers. | | cronjob.janitor.extraEnv | list | `[]` | Array of extra envs to be passed to the cronjob. This takes precedence over deployment variables. Kubernetes format is expected - name: FOO value: BAR | | cronjob.janitor.extraInitContainers | string | `""` | If you want to add extra init containers. These are processed before the migration init container. | +| cronjob.janitor.extraVolumeMounts | list | `[]` | | +| cronjob.janitor.extraVolumes | list | `[]` | If you want to mount external volume | | cronjob.janitor.labels | object | `{}` | Set custom cron job level labels | | cronjob.janitor.nodeSelector | object | `{}` | Configure node labels for pod assignment | | cronjob.janitor.podMetadata | object | `{"annotations":{},"labels":{}}` | Specify pod metadata, this metadata is added directly to the pod, and not higher objects | diff --git a/helm/charts/hydra/templates/janitor-cron-job.yaml b/helm/charts/hydra/templates/janitor-cron-job.yaml index 242138b443..aa52036fd7 100644 --- a/helm/charts/hydra/templates/janitor-cron-job.yaml +++ b/helm/charts/hydra/templates/janitor-cron-job.yaml @@ -52,6 +52,9 @@ spec: - name: {{ include "hydra.name" . }}-config-volume configMap: name: {{ include "hydra.fullname" . }} + {{- if .Values.cronjob.janitor.extraVolumes }} + {{- toYaml .Values.cronjob.janitor.extraVolumes | nindent 12 }} + {{- end }} containers: - name: janitor image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" @@ -105,6 +108,9 @@ spec: - name: {{ include "hydra.name" . }}-config-volume mountPath: /etc/config readOnly: true + {{- if .Values.cronjob.janitor.extraVolumeMounts }} + {{- toYaml .Values.cronjob.janitor.extraVolumeMounts | nindent 16 }} + {{- end }} {{- if .Values.cronjob.janitor.extraContainers }} {{- tpl .Values.cronjob.janitor.extraContainers . | nindent 12 }} {{- end }} diff --git a/helm/charts/hydra/values.yaml b/helm/charts/hydra/values.yaml index 711b1191bc..34bc71627b 100644 --- a/helm/charts/hydra/values.yaml +++ b/helm/charts/hydra/values.yaml @@ -551,6 +551,16 @@ cronjob: # - name: ... # image: ... + # -- If you want to mount external volume + extraVolumes: [] + # - name: my-volume + # secret: + # secretName: my-secret + extraVolumeMounts: [] + # - name: my-volume + # mountPath: /etc/secrets/my-secret + # readOnly: true + # -- Set custom cron job level labels labels: {}