From 5849ea2c82754b269d539eb02ca991a0f03e83a7 Mon Sep 17 00:00:00 2001 From: McRors Calhoun Date: Fri, 1 Mar 2024 17:37:38 +0100 Subject: [PATCH] add pod labels to spire server values (#271) * add pod labels to spire server values The reason for this change is to be able to integrate spire with Azure Workload Idenity. To enable this, a label of `azure.workload.identity/use: "true"` needs to be added to the pods metadata. https://learn.microsoft.com/en-us/azure/aks/learn/tutorial-kubernetes-workload-identity#deploy-the-workload Signed-off-by: Rory Houlihan * trim whitespace from podLabels Signed-off-by: Rory Houlihan --------- Signed-off-by: Rory Houlihan --- charts/spire/charts/spire-server/README.md | 1 + charts/spire/charts/spire-server/templates/statefulset.yaml | 3 +++ charts/spire/charts/spire-server/values.yaml | 3 +++ 3 files changed, 7 insertions(+) diff --git a/charts/spire/charts/spire-server/README.md b/charts/spire/charts/spire-server/README.md index c164fa9..2976e89 100644 --- a/charts/spire/charts/spire-server/README.md +++ b/charts/spire/charts/spire-server/README.md @@ -95,6 +95,7 @@ In order to run Tornjak with simple HTTP Connection only, make sure you don't cr | `serviceAccount.annotations` | Annotations to add to the service account | `{}` | | `serviceAccount.name` | The name of the service account to use. If not set and create is true, a name is generated. | `""` | | `podAnnotations` | Annotations to add to pods | `{}` | +| `podLabels` | Labels to add to pods | `{}` | | `podSecurityContext` | Pod security context | `{}` | | `securityContext` | Security context | `{}` | | `priorityClassName` | Priority class assigned to statefulset pods. Can be auto set with global.recommendations.priorityClassName. | `""` | diff --git a/charts/spire/charts/spire-server/templates/statefulset.yaml b/charts/spire/charts/spire-server/templates/statefulset.yaml index 6a525f0..47f073a 100644 --- a/charts/spire/charts/spire-server/templates/statefulset.yaml +++ b/charts/spire/charts/spire-server/templates/statefulset.yaml @@ -43,6 +43,9 @@ spec: component: server release: {{ .Release.Name }} release-namespace: {{ .Release.Namespace }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: diff --git a/charts/spire/charts/spire-server/values.yaml b/charts/spire/charts/spire-server/values.yaml index 35613fc..c102cc5 100644 --- a/charts/spire/charts/spire-server/values.yaml +++ b/charts/spire/charts/spire-server/values.yaml @@ -47,6 +47,9 @@ serviceAccount: ## @param podAnnotations [object] Annotations to add to pods podAnnotations: {} +## @param podLabels [object] Labels to add to pods +podLabels: {} + ## @param podSecurityContext [object] Pod security context podSecurityContext: {} # fsGroup: 2000