From 0620163eca0f7a1f0794f6df32a152a7cbc660ea Mon Sep 17 00:00:00 2001 From: quintonm Date: Tue, 24 Sep 2024 11:21:20 -0500 Subject: [PATCH 1/3] add support for deploymentLabels Signed-off-by: quintonm --- charts/flagger/templates/deployment.yaml | 5 +++++ charts/flagger/values.yaml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/charts/flagger/templates/deployment.yaml b/charts/flagger/templates/deployment.yaml index 0180ec8bf..ee7d22b50 100644 --- a/charts/flagger/templates/deployment.yaml +++ b/charts/flagger/templates/deployment.yaml @@ -9,6 +9,11 @@ metadata: app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/version: {{ .Chart.AppVersion }} + {{- if .Values.deploymentLabels }} + {{- range $key, $value := .Values.deploymentLabels }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- end }} {{- with .Values.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/charts/flagger/values.yaml b/charts/flagger/values.yaml index 52d335097..7db4c97a4 100644 --- a/charts/flagger/values.yaml +++ b/charts/flagger/values.yaml @@ -195,8 +195,13 @@ podDisruptionBudget: enabled: false minAvailable: 1 +# Additional labels to be added to pods podLabels: {} +# Additional labels to be added to deployments +deploymentLabels: + mylabel: value + noCrossNamespaceRefs: false #Placeholder to supply additional volumes to the flagger pod From 400d933c1c109476c8df5734c06f6085d2f1de51 Mon Sep 17 00:00:00 2001 From: quintonm Date: Thu, 21 Nov 2024 19:24:21 -0600 Subject: [PATCH 2/3] add support for deploymentLabels Signed-off-by: quintonm --- charts/flagger/README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/charts/flagger/README.md b/charts/flagger/README.md index ba74e4837..92b28d211 100644 --- a/charts/flagger/README.md +++ b/charts/flagger/README.md @@ -114,6 +114,15 @@ $ helm upgrade -i flagger flagger/flagger \ --set meshProvider=traefik ``` +If you need to add labels to the flagger deployment or pods, you can pass the labels as parameters as shown below. + +```console +helm upgrade -i flagger flagger/flagger \ + \ +--set podLabels.= \ +--set deploymentLabels.= +``` + The [configuration](#configuration) section lists the parameters that can be configured during installation. ## Uninstalling the Chart From 5f608030820a465c2bba09429fc75bb8839b6a01 Mon Sep 17 00:00:00 2001 From: quintonm Date: Thu, 28 Nov 2024 00:48:26 -0600 Subject: [PATCH 3/3] add support for deploymentLabels Signed-off-by: quintonm --- charts/flagger/README.md | 2 ++ charts/flagger/values.yaml | 3 +-- docs/gitbook/install/flagger-install-on-kubernetes.md | 9 +++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/charts/flagger/README.md b/charts/flagger/README.md index 92b28d211..c10fac924 100644 --- a/charts/flagger/README.md +++ b/charts/flagger/README.md @@ -195,6 +195,8 @@ The following tables lists the configurable parameters of the Flagger chart and | `podDisruptionBudget.minAvailable` | The minimal number of available replicas that will be set in the PodDisruptionBudget | `1` | | `noCrossNamespaceRefs` | If `true`, cross namespace references to custom resources will be disabled | `false` | | `namespace` | When specified, Flagger will restrict itself to watching Canary objects from that namespace | `""` | +| `deploymentLabels` | Labels to add to Flagger deployment | `{}` | +| `podLabels` | Labels to add to pods of Flagger deployment | `{}` | Specify each parameter using the `--set key=value[,key=value]` argument to `helm upgrade`. For example, diff --git a/charts/flagger/values.yaml b/charts/flagger/values.yaml index 7db4c97a4..fb9a7136e 100644 --- a/charts/flagger/values.yaml +++ b/charts/flagger/values.yaml @@ -199,8 +199,7 @@ podDisruptionBudget: podLabels: {} # Additional labels to be added to deployments -deploymentLabels: - mylabel: value +deploymentLabels: { } noCrossNamespaceRefs: false diff --git a/docs/gitbook/install/flagger-install-on-kubernetes.md b/docs/gitbook/install/flagger-install-on-kubernetes.md index ed61910eb..03cafe68b 100644 --- a/docs/gitbook/install/flagger-install-on-kubernetes.md +++ b/docs/gitbook/install/flagger-install-on-kubernetes.md @@ -81,6 +81,15 @@ $ helm upgrade -i flagger flagger/flagger \ --set metricsServer=http://osm-prometheus.osm-system.svc:7070 ``` +If you need to add labels to the flagger deployment or pods, you can pass the labels as parameters as shown below. + +```console +helm upgrade -i flagger flagger/flagger \ + \ +--set podLabels.= \ +--set deploymentLabels.= +``` + You can install Flagger in any namespace as long as it can talk to the Prometheus service on port 9090. For ingress controllers, the install instructions are: