Add pod annotations to chart options

This commit is contained in:
stefanprodan
2020-06-12 13:00:54 +03:00
parent a2f9216fe4
commit ebc6493990
3 changed files with 12 additions and 0 deletions

View File

@@ -80,6 +80,7 @@ Parameter | Default | Description
`nodeSelector` | `{}` | Node labels for pod assignment
`tolerations` | `[]` | List of node taints to tolerate
`affinity` | `None` | Node/pod affinities
`podAnnotations` | `{}` | Pod annotations
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
@@ -88,6 +89,13 @@ $ helm install my-release podinfo/podinfo \
--set=serviceMonitor.enabled=true,serviceMonitor.interval=5s
```
To add custom annotations you need to escape the annotation key string:
```console
$ helm upgrade -i my-release podinfo/podinfo \
--set podAnnotations."appmesh\.k8s\.aws\/preview"=enabled
```
Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example,
```console

View File

@@ -25,6 +25,9 @@ spec:
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "{{ .Values.service.httpPort }}"
{{- range $key, $value := .Values.podAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
terminationGracePeriodSeconds: 30
{{- if .Values.serviceAccount.enabled }}

View File

@@ -88,3 +88,4 @@ tolerations: []
affinity: {}
podAnnotations: {}