Skip to content

Commit e0a787f

Browse files
feat(helm): add label and annotation values (#863)
* feat(helm): add label and annotation vaules Signed-off-by: Oliver Bähler <[email protected]> * feat(helm): add label and annotation vaules Signed-off-by: Oliver Bähler <[email protected]> --------- Signed-off-by: Oliver Bähler <[email protected]>
1 parent d23bb5c commit e0a787f

File tree

4 files changed

+40
-3
lines changed

4 files changed

+40
-3
lines changed

charts/capsule-proxy/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,15 @@ If you only need to make minor customizations, you can specify them on the comma
106106
| global.jobs.certs.topologySpreadConstraints | list | `[]` | Set Topology Spread Constraints |
107107
| global.jobs.certs.ttlSecondsAfterFinished | int | `60` | Sets the ttl in seconds after a finished certgen job is deleted. Set to -1 to never delete. |
108108
| global.jobs.kubectl.affinity | object | `{}` | Set affinity rules |
109-
| global.jobs.kubectl.annotations | object | `{}` | Annotations |
109+
| global.jobs.kubectl.annotations | object | `{}` | Annotations to add to the job. |
110110
| global.jobs.kubectl.image.pullPolicy | string | `"IfNotPresent"` | Set the image pull policy of the helm chart job |
111111
| global.jobs.kubectl.image.registry | string | `"docker.io"` | Set the image repository of the helm chart job |
112112
| global.jobs.kubectl.image.repository | string | `"clastix/kubectl"` | Set the image repository of the helm chart job |
113113
| global.jobs.kubectl.image.tag | string | `""` | Set the image tag of the helm chart job |
114+
| global.jobs.kubectl.labels | object | `{}` | Labels to add to the job. |
114115
| global.jobs.kubectl.nodeSelector | object | `{}` | Set the node selector |
116+
| global.jobs.kubectl.podAnnotations | object | `{}` | Annotations to add to the job pod |
117+
| global.jobs.kubectl.podLabels | object | `{}` | Labels to add to the job pod |
115118
| global.jobs.kubectl.podSecurityContext | object | `{"enabled":false,"seccompProfile":{"type":"RuntimeDefault"}}` | Security context for the job pods. |
116119
| global.jobs.kubectl.priorityClassName | string | `""` | Set a pod priorityClassName |
117120
| global.jobs.kubectl.resources | object | `{}` | Job resources |

charts/capsule-proxy/templates/crd-lifecycle/job.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,30 @@ metadata:
77
annotations:
88
"helm.sh/hook-weight": "-1"
99
{{- include "capsule-proxy.crds.annotations" . | nindent 4 }}
10+
{{- with .Values.global.jobs.kubectl.annotations }}
11+
{{- toYaml . | nindent 4 }}
12+
{{- end }}
1013
labels:
1114
app.kubernetes.io/component: {{ include "capsule-proxy.crds.component" . | quote }}
1215
{{- include "capsule-proxy.labels" . | nindent 4 }}
16+
{{- with .Values.global.jobs.kubectl.labels }}
17+
{{- toYaml . | nindent 4 }}
18+
{{- end }}
1319
spec:
1420
ttlSecondsAfterFinished: {{ .Values.global.jobs.kubectl.ttlSecondsAfterFinished }}
1521
template:
1622
metadata:
1723
name: "{{ include "capsule-proxy.crds.name" . }}"
24+
{{- with .Values.global.jobs.kubectl.podAnnotations }}
25+
annotations:
26+
{{- toYaml . | nindent 8 }}
27+
{{- end }}
1828
labels:
1929
app.kubernetes.io/component: {{ include "capsule-proxy.crds.component" . | quote }}
2030
{{- include "capsule-proxy.selectorLabels" . | nindent 8 }}
31+
{{- with .Values.global.jobs.kubectl.podLabels }}
32+
{{- toYaml . | nindent 8 }}
33+
{{- end }}
2134
spec:
2235
restartPolicy: {{ $.Values.global.jobs.kubectl.restartPolicy }}
2336
{{- if $.Values.global.jobs.kubectl.podSecurityContext.enabled }}

charts/capsule-proxy/values.schema.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@
282282
"type": "object"
283283
},
284284
"annotations": {
285-
"description": "Annotations",
285+
"description": "Annotations to add to the job.",
286286
"type": "object"
287287
},
288288
"image": {
@@ -306,10 +306,22 @@
306306
}
307307
}
308308
},
309+
"labels": {
310+
"description": "Labels to add to the job.",
311+
"type": "object"
312+
},
309313
"nodeSelector": {
310314
"description": "Set the node selector",
311315
"type": "object"
312316
},
317+
"podAnnotations": {
318+
"description": "Annotations to add to the job pod",
319+
"type": "object"
320+
},
321+
"podLabels": {
322+
"description": "Labels to add to the job pod",
323+
"type": "object"
324+
},
313325
"podSecurityContext": {
314326
"description": "Security context for the job pods.",
315327
"type": "object",

charts/capsule-proxy/values.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,13 @@ global:
1717
pullPolicy: IfNotPresent
1818
# -- Set the image tag of the helm chart job
1919
tag: ""
20-
# -- Annotations
20+
# -- Labels to add to the job pod
21+
podLabels: {}
22+
# -- Annotations to add to the job pod
23+
podAnnotations: {}
24+
# -- Labels to add to the job.
25+
labels: {}
26+
# -- Annotations to add to the job.
2127
annotations: {}
2228
# -- Set the restartPolicy
2329
restartPolicy: Never
@@ -207,11 +213,13 @@ livenessProbe:
207213
# priorityClassName: system-node-critical
208214
# -- Specifies PriorityClass of the capsule-proxy pod.
209215
priorityClassName: ""
216+
210217
# -- Security context for the capsule-proxy pod.
211218
podSecurityContext:
212219
enabled: true
213220
seccompProfile:
214221
type: "RuntimeDefault"
222+
215223
# -- Security context for the capsule-proxy container.
216224
securityContext:
217225
enabled: true
@@ -234,6 +242,7 @@ resources:
234242
cpu: 200m
235243
# -- Set the memory limits assigned to the controller.
236244
memory: 128Mi
245+
237246
# -- Additional environment variables
238247
env: []
239248
# -- Additional volumes

0 commit comments

Comments
 (0)