diff --git a/traefik-hub/templates/deployment.yaml b/traefik-hub/templates/deployment.yaml index c3cbe41..f24f24c 100644 --- a/traefik-hub/templates/deployment.yaml +++ b/traefik-hub/templates/deployment.yaml @@ -172,6 +172,9 @@ spec: - name: plugins mountPath: /plugins-storage {{- end }} + {{- with .Values.extraVolumeMounts }} + {{- toYaml . | nindent 12 }} + {{- end }} securityContext: fsGroup: 65532 volumes: @@ -183,3 +186,6 @@ spec: - name: plugins emptyDir: { } {{- end }} + {{- with .Values.extraVolumes }} + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/traefik-hub/tests/deployment_test.yaml b/traefik-hub/tests/deployment_test.yaml index 691dffa..bad5395 100644 --- a/traefik-hub/tests/deployment_test.yaml +++ b/traefik-hub/tests/deployment_test.yaml @@ -160,3 +160,24 @@ tests: - equal: path: spec.template.spec.imagePullSecrets[0].name value: regcred + - it: should add and mount an extraVolume when set + set: + extraVolumes: + - name: certificates + secret: + secretNames: certificates + extraVolumeMounts: + - name: certificates + mountPath: /etc/traefik-hub/certs + asserts: + - contains: + path: spec.template.spec.volumes + content: + name: certificates + secret: + secretNames: certificates + - contains: + path: spec.template.spec.containers[0].volumeMounts + content: + name: certificates + mountPath: /etc/traefik-hub/certs diff --git a/traefik-hub/values.yaml b/traefik-hub/values.yaml index 7bae510..fd0d5b6 100644 --- a/traefik-hub/values.yaml +++ b/traefik-hub/values.yaml @@ -27,6 +27,9 @@ additionalArguments: [] additionalEnvVars: [] additionalLabels: {} +extraVolumes: [] +extraVolumeMounts: [] + service: # common use: # type: LoadBalancer