Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

Commit

Permalink
feat(helm): add in ability to inject init containers in to deployment…
Browse files Browse the repository at this point in the history
… from values (#615)

chore: added in jetbrains ignore files


x

Co-authored-by: Chris Mellard <[email protected]>
  • Loading branch information
chrismellard and Chris Mellard authored Feb 9, 2021
1 parent 190e6db commit 21acce1
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,5 @@ typings/

# e2e test stuff
e2e/**/.kubeconfig

.idea/
17 changes: 15 additions & 2 deletions charts/kubernetes-external-secrets/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ spec:
imagePullSecrets:
{{- toYaml .Values.imagePullSecrets | nindent 8 }}
{{- end }}
{{- if .Values.deploymentInitContainers }}
{{- toYaml .Values.deploymentInitContainers | nindent 6 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
Expand Down Expand Up @@ -60,14 +63,19 @@ spec:
name: {{ $value.secretKeyRef | quote }}
key: {{ $value.key | quote }}
{{- end }}
{{- with .Values.filesFromSecret }}
{{- if or .Values.filesFromSecret .Values.extraVolumeMounts }}
volumeMounts:
{{- if .Values.extraVolumeMounts }}
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
{{- end }}
{{- with .Values.filesFromSecret }}
{{- range $key, $value := . }}
- name: {{ $key }}
mountPath: {{ $value.mountPath }}
readOnly: true
{{- end }}
{{- end }}
{{- end }}
{{- with .Values.dnsConfig }}
dnsConfig:
{{- toYaml . | nindent 8 }}
Expand All @@ -91,11 +99,16 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.filesFromSecret }}
{{- if or .Values.filesFromSecret .Values.extraVolumes }}
volumes:
{{- if .Values.extraVolumes }}
{{- toYaml .Values.extraVolumes | nindent 8 }}
{{- end }}
{{- with .Values.filesFromSecret }}
{{- range $key, $value := . }}
- name: {{ $key }}
secret:
secretName: {{ $value.secret }}
{{- end }}
{{- end }}
{{- end }}
3 changes: 3 additions & 0 deletions charts/kubernetes-external-secrets/templates/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ rules:
resources: ["customresourcedefinitions"]
verbs: ["create"]
{{- end }}
{{- if .Values.customClusterRoles }}
{{- toYaml .Values.customClusterRoles | nindent 2 }}
{{- end }}
---
{{ if semverCompare ">=1.17.0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: rbac.authorization.k8s.io/v1
Expand Down
16 changes: 16 additions & 0 deletions charts/kubernetes-external-secrets/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,19 @@ serviceMonitor:
enabled: false
interval: "30s"
namespace:

deploymentInitContainers: {}

# Add in additional named volumes and volume mounts to the deployment
#
extraVolumes: []
# - name: namedVolume
# emptyDir: {}
#
extraVolumeMounts: []
# - name: namedVolume
# mountPath: /usr/path
# readOnly: false

# Add additional RBAC rules to the ClusterRole granted to the service account
customClusterRoles: {}

0 comments on commit 21acce1

Please sign in to comment.