From: Joshua Kraitberg Date: Mon, 27 Mar 2023 19:39:22 +0000 (-0400) Subject: Add template support for pod labels and annotations X-Git-Tag: 2.0.1^0 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=34244dc4e31185ce2bb20c2a611b75edee39b2c1;hp=57473cc992caf8f236ae19d3f937b234ff748f39;p=pti%2Fo2.git Add template support for pod labels and annotations Pod labels on the deployment are required for integration in StarlingX. TEST PLAN PASS: Chart can be deployed with new values present 1. Create test-values.yaml with podAnnotations/podLabels filled e.g. ```yaml --- podLabels: app.starlingx.io/component: platform ``` 2. cd into charts directory 3. Run: helm install --create-namespace -n oran-o2 \ -f values.yaml -f test-values.yaml oran-o2 . 4. Confirm workload pods contain the annotation/labels in test-values Issue-ID: INF-395 Signed-off-by: Joshua Kraitberg Change-Id: Ib3e44eb7e0f1ab707f50615be30d16e33b0c8af8 --- diff --git a/charts/templates/deployment.yaml b/charts/templates/deployment.yaml index a5deaf6..72e3580 100644 --- a/charts/templates/deployment.yaml +++ b/charts/templates/deployment.yaml @@ -1,4 +1,4 @@ -# Copyright (C) 2021 Wind River Systems, Inc. +# Copyright (C) 2021-2023 Wind River Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -29,6 +29,13 @@ spec: metadata: labels: app: o2api + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + annotations: + {{- with .Values.podAnnotations }} + {{- toYaml . | nindent 8 }} + {{- end }} spec: serviceAccountName: {{ .Values.o2ims.serviceaccountname }} {{- if .Values.imagePullSecrets }} diff --git a/charts/values.yaml b/charts/values.yaml index aa6a487..0ab6f73 100644 --- a/charts/values.yaml +++ b/charts/values.yaml @@ -1,4 +1,4 @@ -# Copyright (C) 2021 Wind River Systems, Inc. +# Copyright (C) 2021-2023 Wind River Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -22,6 +22,9 @@ replicaCount: 1 nameOverride: "" fullnameOverride: "" +podLabels: {} +podAnnotations: {} + # The default value "" doesn't work with binaryData, # So generate the value with: # echo "" | base64