Skip to content

Commit 40e2802

Browse files
authored
Merge pull request #1707 from quintonm/main
chart: add support for deploymentLabels
2 parents d99d37b + 03d4acc commit 40e2802

File tree

4 files changed

+29
-0
lines changed

4 files changed

+29
-0
lines changed

charts/flagger/README.md

+11
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,15 @@ $ helm upgrade -i flagger flagger/flagger \
114114
--set meshProvider=traefik
115115
```
116116

117+
If you need to add labels to the flagger deployment or pods, you can pass the labels as parameters as shown below.
118+
119+
```console
120+
helm upgrade -i flagger flagger/flagger \
121+
<other parameters> \
122+
--set podLabels.<labelName>=<labelValue> \
123+
--set deploymentLabels.<labelName>=<labelValue>
124+
```
125+
117126
The [configuration](#configuration) section lists the parameters that can be configured during installation.
118127

119128
## Uninstalling the Chart
@@ -186,6 +195,8 @@ The following tables lists the configurable parameters of the Flagger chart and
186195
| `podDisruptionBudget.minAvailable` | The minimal number of available replicas that will be set in the PodDisruptionBudget | `1` |
187196
| `noCrossNamespaceRefs` | If `true`, cross namespace references to custom resources will be disabled | `false` |
188197
| `namespace` | When specified, Flagger will restrict itself to watching Canary objects from that namespace | `""` |
198+
| `deploymentLabels` | Labels to add to Flagger deployment | `{}` |
199+
| `podLabels` | Labels to add to pods of Flagger deployment | `{}` |
189200

190201
Specify each parameter using the `--set key=value[,key=value]` argument to `helm upgrade`. For example,
191202

charts/flagger/templates/deployment.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ metadata:
99
app.kubernetes.io/managed-by: {{ .Release.Service }}
1010
app.kubernetes.io/instance: {{ .Release.Name }}
1111
app.kubernetes.io/version: {{ .Chart.AppVersion }}
12+
{{- if .Values.deploymentLabels }}
13+
{{- range $key, $value := .Values.deploymentLabels }}
14+
{{ $key }}: {{ $value | quote }}
15+
{{- end }}
16+
{{- end }}
1217
{{- with .Values.annotations }}
1318
annotations:
1419
{{- toYaml . | nindent 4 }}

charts/flagger/values.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,12 @@ podDisruptionBudget:
195195
enabled: false
196196
minAvailable: 1
197197

198+
# Additional labels to be added to pods
198199
podLabels: {}
199200

201+
# Additional labels to be added to deployments
202+
deploymentLabels: { }
203+
200204
noCrossNamespaceRefs: false
201205

202206
#Placeholder to supply additional volumes to the flagger pod

docs/gitbook/install/flagger-install-on-kubernetes.md

+9
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,15 @@ $ helm upgrade -i flagger flagger/flagger \
8181
--set metricsServer=http://osm-prometheus.osm-system.svc:7070
8282
```
8383

84+
If you need to add labels to the flagger deployment or pods, you can pass the labels as parameters as shown below.
85+
86+
```console
87+
helm upgrade -i flagger flagger/flagger \
88+
<other parameters> \
89+
--set podLabels.<labelName>=<labelValue> \
90+
--set deploymentLabels.<labelName>=<labelValue>
91+
```
92+
8493
You can install Flagger in any namespace as long as it can talk to the Prometheus service on port 9090.
8594

8695
For ingress controllers, the install instructions are:

0 commit comments

Comments
 (0)