Skip to content

Commit 163f617

Browse files
authored
feat: configurable job image repositories (#122)
* make all images used in jobs configurable * fix whitespace * update helm docs
1 parent 97cb802 commit 163f617

5 files changed

Lines changed: 22 additions & 12 deletions

File tree

charts/kamaji-etcd/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,12 @@ Here the values you can override:
7676
| image.tag | string | `""` | Install image with specific tag, overwrite the tag in the chart |
7777
| imagePullSecrets | list | `[]` | |
7878
| jobs.affinity | object | `{}` | Kubernetes affinity rules to apply to ancillary jobs |
79-
| jobs.image | object | `{"pullPolicy":"IfNotPresent","repository":"quay.io/coreos/etcd","tag":"v3.5.6"}` | etcd image to use for ancillary jobs |
79+
| jobs.cfssl | object | `{"image":"cfssl/cfssl","tag":""}` | addional images to use for ancillary jobs |
80+
| jobs.etcd.image | string | `"quay.io/coreos/etcd"` | |
81+
| jobs.etcd.pullPolicy | string | `"IfNotPresent"` | |
82+
| jobs.etcd.tag | string | `"v3.5.6"` | |
83+
| jobs.kubectl.image | string | `"clastix/kubectl"` | |
84+
| jobs.kubectl.tag | string | `""` | |
8085
| jobs.nodeSelector | object | `{"kubernetes.io/os":"linux"}` | Kubernetes node selector rules for ancillary jobs |
8186
| jobs.tolerations | list | `[]` | Kubernetes node taints that the ancillary jobs would tolerate |
8287
| livenessProbe | object | `{"failureThreshold":3,"httpGet":{"path":"/livez","port":2381,"scheme":"HTTP"},"initialDelaySeconds":10,"periodSeconds":10,"timeoutSeconds":15}` | The livenessProbe for the etcd container |

charts/kamaji-etcd/templates/etcd_job_postdelete.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ spec:
1919
nodeSelector: {{- toYaml .Values.jobs.nodeSelector | nindent 8 }}
2020
containers:
2121
- name: kubectl
22-
image: {{ printf "clastix/kubectl:%s" (include "etcd.jobsTagKubeVersion" .) }}
22+
image: "{{ printf "%s:%s" .Values.jobs.kubectl.image (default (include "etcd.jobsTagKubeVersion" . | trim) .Values.jobs.kubectl.tag) }}"
2323
command:
2424
- kubectl
2525
- --namespace={{ .Release.Namespace }}

charts/kamaji-etcd/templates/etcd_job_preinstall_1.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ spec:
1818
restartPolicy: Never
1919
initContainers:
2020
- name: cfssl
21-
image: cfssl/cfssl:latest
21+
image: "{{ printf "%s:%s" .Values.jobs.cfssl.image (default "latest" .Values.jobs.cfssl.tag) }}"
2222
command:
2323
- bash
2424
- -c
@@ -35,7 +35,7 @@ spec:
3535
name: csr
3636
containers:
3737
- name: kubectl
38-
image: {{ printf "clastix/kubectl:%s" (include "etcd.jobsTagKubeVersion" .) }}
38+
image: "{{ printf "%s:%s" .Values.jobs.kubectl.image (default (include "etcd.jobsTagKubeVersion" . | trim) .Values.jobs.kubectl.tag) }}"
3939
command: ["/bin/sh", "-c"]
4040
args:
4141
- |

charts/kamaji-etcd/templates/etcd_job_preinstall_2.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ spec:
2323
restartPolicy: Never
2424
initContainers:
2525
- name: kubectl
26-
image: {{ printf "clastix/kubectl:%s" (include "etcd.jobsTagKubeVersion" .) }}
26+
image: "{{ printf "%s:%s" .Values.jobs.kubectl.image (default (include "etcd.jobsTagKubeVersion" . | trim) .Values.jobs.kubectl.tag) }}"
2727
command:
2828
- sh
2929
- -c
@@ -51,8 +51,8 @@ spec:
5151
value: /opt/certs/root-certs/tls.crt
5252
- name: ETCDCTL_KEY
5353
value: /opt/certs/root-certs/tls.key
54-
image: {{ .Values.jobs.image.repository }}:{{ .Values.jobs.image.tag }}
55-
imagePullPolicy: {{ .Values.jobs.image.pullPolicy }}
54+
image: "{{ printf "%s:%s" .Values.jobs.etcd.image (default "latest" .Values.jobs.etcd.tag) }}"
55+
imagePullPolicy: {{ .Values.jobs.etcd.pullPolicy }}
5656
name: etcd-client
5757
volumeMounts:
5858
- name: root-certs

charts/kamaji-etcd/values.yaml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,14 @@ jobs:
207207
tolerations: []
208208
# -- Kubernetes affinity rules to apply to ancillary jobs
209209
affinity: {}
210-
# -- etcd image to use for ancillary jobs
211-
image:
212-
repository: quay.io/coreos/etcd
210+
# -- addional images to use for ancillary jobs
211+
cfssl:
212+
image: cfssl/cfssl
213+
tag: ""
214+
kubectl:
215+
image: clastix/kubectl
216+
tag: ""
217+
etcd:
218+
image: quay.io/coreos/etcd
213219
tag: v3.5.6 # latest container image with shell available!
214-
pullPolicy: IfNotPresent
215-
220+
pullPolicy: IfNotPresent

0 commit comments

Comments
 (0)