Skip to content

Commit 5bd2ac4

Browse files
committed
reuse admin parameters for job
1 parent 2292a40 commit 5bd2ac4

File tree

3 files changed

+15
-23
lines changed

3 files changed

+15
-23
lines changed

deploy/helm/kubernetes/templates/kubeadm-job.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,39 +7,39 @@ metadata:
77
name: "{{ $fullName }}-kubeadm-tasks"
88
labels:
99
app: "{{ $fullName }}-kubeadm-tasks"
10-
{{- with .Values.admin.job.labels }}
10+
{{- with .Values.admin.labels }}
1111
{{- toYaml . | nindent 4 }}
1212
{{- end }}
1313
annotations:
1414
helm.sh/hook: post-install,post-upgrade
1515
helm.sh/hook-delete-policy: before-hook-creation
1616
checksum/config: {{ include (print $.Template.BasePath "/kubeadm-config.yaml") . | sha256sum }}
1717
checksum/scripts: {{ include (print $.Template.BasePath "/kubeadm-scripts.yaml") . | sha256sum }}
18-
{{- with .Values.admin.job.annotations }}
18+
{{- with .Values.admin.annotations }}
1919
{{- toYaml . | nindent 4 }}
2020
{{- end }}
2121
spec:
2222
template:
2323
metadata:
2424
labels:
2525
app: "{{ $fullName }}-kubeadm-tasks"
26-
{{- with .Values.admin.job.podLabels }}
26+
{{- with .Values.admin.podLabels }}
2727
{{- toYaml . | nindent 8 }}
2828
{{- end }}
29-
{{- with .Values.admin.job.podAnnotations }}
29+
{{- with .Values.admin.podAnnotations }}
3030
annotations:
3131
{{- toYaml . | nindent 8 }}
3232
{{- end }}
3333
spec:
34-
{{- with .Values.admin.job.nodeSelector }}
34+
{{- with .Values.admin.nodeSelector }}
3535
nodeSelector:
3636
{{- toYaml . | nindent 8 }}
3737
{{- end }}
38-
{{- with .Values.admin.job.tolerations }}
38+
{{- with .Values.admin.tolerations }}
3939
tolerations:
4040
{{- toYaml . | nindent 6 }}
4141
{{- end }}
42-
{{- with .Values.admin.job.affinity }}
42+
{{- with .Values.admin.affinity }}
4343
affinity:
4444
{{- toYaml . | nindent 8 }}
4545
{{- end }}
@@ -59,7 +59,7 @@ spec:
5959
env:
6060
- name: KUBECONFIG
6161
value: "/etc/kubernetes/admin.conf"
62-
{{- with .Values.admin.job.extraEnv }}
62+
{{- with .Values.admin.extraEnv }}
6363
{{- toYaml . | nindent 8 }}
6464
{{- end }}
6565
volumeMounts:

deploy/helm/kubernetes/templates/kubeadm-scripts.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if .Values.admin.job.enabled }}
1+
{{- if or .Values.admin.enabled .Values.admin.job.enabled }}
22
{{- $fullName := include "kubernetes.fullname" . -}}
33
---
44
apiVersion: v1

deploy/helm/kubernetes/values.yaml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,12 @@ admin:
199199
# cpu: 100m
200200
# memory: 128Mi
201201

202+
job:
203+
enabled: true
204+
schedule: "0 0 1 */6 *"
205+
successfulJobsHistoryLimit: 3
206+
failedJobsHistoryLimit: 3
207+
202208
labels: {}
203209
annotations: {}
204210
podLabels: {}
@@ -211,20 +217,6 @@ admin:
211217
extraVolumes: []
212218
extraVolumeMounts: []
213219

214-
job:
215-
enabled: true
216-
schedule: "0 0 1 */6 *"
217-
successfulJobsHistoryLimit: 3
218-
failedJobsHistoryLimit: 3
219-
labels: {}
220-
annotations: {}
221-
podLabels: {}
222-
podAnnotations: {}
223-
nodeSelector: {}
224-
tolerations: []
225-
affinity: {}
226-
extraEnv: []
227-
228220
kubeProxy:
229221
enabled: true
230222

0 commit comments

Comments
 (0)