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

Commit 21acce1

Browse files
chrismellardChris Mellard
and
Chris Mellard
authored
feat(helm): add in ability to inject init containers in to deployment from values (#615)
chore: added in jetbrains ignore files x Co-authored-by: Chris Mellard <[email protected]>
1 parent 190e6db commit 21acce1

File tree

4 files changed

+36
-2
lines changed

4 files changed

+36
-2
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,5 @@ typings/
5959

6060
# e2e test stuff
6161
e2e/**/.kubeconfig
62+
63+
.idea/

charts/kubernetes-external-secrets/templates/deployment.yaml

+15-2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ spec:
3232
imagePullSecrets:
3333
{{- toYaml .Values.imagePullSecrets | nindent 8 }}
3434
{{- end }}
35+
{{- if .Values.deploymentInitContainers }}
36+
{{- toYaml .Values.deploymentInitContainers | nindent 6 }}
37+
{{- end }}
3538
containers:
3639
- name: {{ .Chart.Name }}
3740
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
@@ -60,14 +63,19 @@ spec:
6063
name: {{ $value.secretKeyRef | quote }}
6164
key: {{ $value.key | quote }}
6265
{{- end }}
63-
{{- with .Values.filesFromSecret }}
66+
{{- if or .Values.filesFromSecret .Values.extraVolumeMounts }}
6467
volumeMounts:
68+
{{- if .Values.extraVolumeMounts }}
69+
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
70+
{{- end }}
71+
{{- with .Values.filesFromSecret }}
6572
{{- range $key, $value := . }}
6673
- name: {{ $key }}
6774
mountPath: {{ $value.mountPath }}
6875
readOnly: true
6976
{{- end }}
7077
{{- end }}
78+
{{- end }}
7179
{{- with .Values.dnsConfig }}
7280
dnsConfig:
7381
{{- toYaml . | nindent 8 }}
@@ -91,11 +99,16 @@ spec:
9199
tolerations:
92100
{{- toYaml . | nindent 8 }}
93101
{{- end }}
94-
{{- with .Values.filesFromSecret }}
102+
{{- if or .Values.filesFromSecret .Values.extraVolumes }}
95103
volumes:
104+
{{- if .Values.extraVolumes }}
105+
{{- toYaml .Values.extraVolumes | nindent 8 }}
106+
{{- end }}
107+
{{- with .Values.filesFromSecret }}
96108
{{- range $key, $value := . }}
97109
- name: {{ $key }}
98110
secret:
99111
secretName: {{ $value.secret }}
100112
{{- end }}
101113
{{- end }}
114+
{{- end }}

charts/kubernetes-external-secrets/templates/rbac.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ rules:
3434
resources: ["customresourcedefinitions"]
3535
verbs: ["create"]
3636
{{- end }}
37+
{{- if .Values.customClusterRoles }}
38+
{{- toYaml .Values.customClusterRoles | nindent 2 }}
39+
{{- end }}
3740
---
3841
{{ if semverCompare ">=1.17.0" .Capabilities.KubeVersion.GitVersion -}}
3942
apiVersion: rbac.authorization.k8s.io/v1

charts/kubernetes-external-secrets/values.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,19 @@ serviceMonitor:
125125
enabled: false
126126
interval: "30s"
127127
namespace:
128+
129+
deploymentInitContainers: {}
130+
131+
# Add in additional named volumes and volume mounts to the deployment
132+
#
133+
extraVolumes: []
134+
# - name: namedVolume
135+
# emptyDir: {}
136+
#
137+
extraVolumeMounts: []
138+
# - name: namedVolume
139+
# mountPath: /usr/path
140+
# readOnly: false
141+
142+
# Add additional RBAC rules to the ClusterRole granted to the service account
143+
customClusterRoles: {}

0 commit comments

Comments
 (0)