Skip to content

Commit

Permalink
add support for deploymentLabels
Browse files Browse the repository at this point in the history
Signed-off-by: quintonm <[email protected]>
  • Loading branch information
quintonm committed Jan 13, 2025
1 parent 16a6075 commit 87db1a3
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 0 deletions.
11 changes: 11 additions & 0 deletions charts/flagger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
<other parameters> \
--set podLabels.<labelName>=<labelValue> \
--set deploymentLabels.<labelName>=<labelValue>
```

The [configuration](#configuration) section lists the parameters that can be configured during installation.

## Uninstalling the Chart
Expand Down Expand Up @@ -186,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,

Expand Down
5 changes: 5 additions & 0 deletions charts/flagger/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 4 additions & 0 deletions charts/flagger/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,12 @@ podDisruptionBudget:
enabled: false
minAvailable: 1

# Additional labels to be added to pods
podLabels: {}

# Additional labels to be added to deployments
deploymentLabels: { }

noCrossNamespaceRefs: false

#Placeholder to supply additional volumes to the flagger pod
Expand Down
9 changes: 9 additions & 0 deletions docs/gitbook/install/flagger-install-on-kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
<other parameters> \
--set podLabels.<labelName>=<labelValue> \
--set deploymentLabels.<labelName>=<labelValue>
```

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:
Expand Down

0 comments on commit 87db1a3

Please sign in to comment.