Add annotations support for Event Handler helm chart (#62081)

* Add configmap and deployment annotations for event handler helm chart

* Update documentation for podAnnotations
This commit is contained in:
Kevin
2025-12-12 00:00:55 +00:00
committed by GitHub
parent 658e5c5627
commit 05f13a77cc
7 changed files with 130 additions and 2 deletions
@@ -2,6 +2,10 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "event-handler.fullname" . }}
{{- with .Values.annotations.config }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "event-handler.labels" . | nindent 4 }}
data:
@@ -2,6 +2,10 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "event-handler.fullname" . }}
{{- with .Values.annotations.deployment }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "event-handler.labels" . | nindent 4 }}
spec:
@@ -15,12 +19,12 @@ spec:
{{- include "event-handler.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
{{- with coalesce .Values.annotations.pod .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "event-handler.selectorLabels" . | nindent 8 }}
{{- include "event-handler.labels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
@@ -20,7 +20,10 @@ should match the snapshot:
metadata:
labels:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: teleport-plugin-event-handler
app.kubernetes.io/version: 19.0.0-dev
helm.sh/chart: teleport-plugin-event-handler-19.0.0-dev
spec:
containers:
- command:
@@ -16,3 +16,21 @@ tests:
keyPath: myclient.key
asserts:
- matchSnapshot: {}
- it: should not contain annotations when not defined
asserts:
- isNull:
path: metadata.annotations
- it: should contain annotations when defined
set:
annotations:
config:
keyA: valA
keyB: valB
asserts:
- equal:
path: metadata.annotations
value:
keyA: valA
keyB: valB
@@ -18,6 +18,7 @@ tests:
- equal:
path: spec.strategy.type
value: Recreate
- it: should mount tls.existingCASecretName and set environment when set in values
template: deployment.yaml
values:
@@ -42,3 +43,61 @@ tests:
value: /etc/teleport-tls-ca/ca.pem
- matchSnapshot:
path: spec.template.spec
- it: should not contain deployment or pod annotations when not defined
asserts:
- isNull:
path: metadata.annotations
- isNull:
path: spec.template.metadata.annotations
- it: should contain deployment annotations when defined
set:
annotations:
deployment:
keyA: valA
keyB: valB
asserts:
- equal:
path: metadata.annotations
value:
keyA: valA
keyB: valB
- isNull:
path: spec.template.metadata.annotations
- it: should contain pod annotations when defined
set:
annotations:
pod:
keyA: valA
keyB: valB
asserts:
- equal:
path: spec.template.metadata.annotations
value:
keyA: valA
keyB: valB
- isNull:
path: metadata.annotations
- it: should contain both annotations when defined
set:
annotations:
deployment:
keyA: valA
keyB: valB
pod:
keyA: valA'
keyC: valC
asserts:
- equal:
path: metadata.annotations
value:
keyA: valA
keyB: valB
- equal:
path: spec.template.metadata.annotations
value:
keyA: valA'
keyC: valC
@@ -11,6 +11,7 @@
"podSecurityContext",
"securityContext",
"nodeSelector",
"annotations",
"tolerations",
"affinity",
"teleport",
@@ -225,6 +226,32 @@
"default": {},
"additionalProperties": true
},
"annotations": {
"$id": "#/properties/annotations",
"type": "object",
"required": [
"config",
"deployment",
"pod"
],
"properties": {
"config": {
"$id": "#/properties/annotations/properties/config",
"type": "object",
"default": {}
},
"deployment": {
"$id": "#/properties/annotations/properties/deployment",
"type": "object",
"default": {}
},
"pod": {
"$id": "#/properties/annotations/properties/pod",
"type": "object",
"default": {}
}
}
},
"tls": {
"$id": "#/properties/tls",
"type": "object",
+13
View File
@@ -128,6 +128,18 @@ persistentVolumeClaim:
existingClaim: ""
volumeName: "storage"
# annotations -- contains annotations to apply to the different Kubernetes
# objects created by the chart. See [the Kubernetes annotation
# documentation](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/)
# for more details.
annotations:
# annotations.config(object) -- are annotations to set on the ConfigMap.
config: {}
# annotations.deployment(object) -- are annotations to set on the Deployment.
deployment: {}
# annotations.pod(object) -- are annotations to set on the Pods.
pod: {}
#
# Deployment
#
@@ -141,6 +153,7 @@ imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
# Deprecated way to set pod annotations. `annotations.pod` should be preferred.
podAnnotations: {}
podSecurityContext: {}