Skip to content

Commit

Permalink
Apply custom annotations to controller in addition to pod
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianeicher committed May 7, 2022
1 parent 115b0e6 commit a058b08
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/generic-service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ app:
| `livenessProbe` | | Probe that causes the service to be restarted when failing |
| `readinessProbe` | | Probe that prevents the service from receiving traffic when failing |
| `labels` | `{}` | Additional labels to set on all generated resources |
| `annotations` | `{}` | Additional annotations to set on the `Pod`s |
| `annotations` | `{}` | Additional annotations to set on the `Pod` controller and `Pod`s |
| `resources.requests.memory` | `64Mi` | The amount of memory requested for the service (recommendation: slightly higher than average usage) |
| `resources.requests.cpu` | `10m` | The number of CPU cores requested for the service |
| `resources.limits.memory` | `96Mi` | The maximum amount of memory the service may use (recommendation: slightly higher than worst-case usage) |
Expand Down
12 changes: 12 additions & 0 deletions charts/generic-service/ci/annotation-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Annotation test

image:
repository: jwilder/whoami
tag: latest

rollout:
controller: Deployment

annotations:
key1: value1
key2: value2
5 changes: 4 additions & 1 deletion charts/generic-service/templates/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ kind: {{ .Values.rollout.controller }}
metadata:
name: {{ include "generic-service.fullname" . }}
labels: {{ include "generic-service.default-labels" . | nindent 4 }}
{{- if .Values.tracing.enabled }}
annotations:
{{- if .Values.tracing.enabled }}
sidecar.jaegertracing.io/inject: 'true'
{{- end }}
{{- if .Values.annotations }}
{{- .Values.annotations | toYaml | nindent 4 }}
{{- end }}

spec:
{{- if ne .Values.rollout.controller "DaemonSet" }}
Expand Down
2 changes: 1 addition & 1 deletion charts/generic-service/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
"annotations": {
"type": "object",
"additionalProperties": {"type": "string"},
"description": "Additional annotations to set on the Pods"
"description": "Additional annotations to set on the Pod controller and Pods"
},
"resources": {
"type": "object",
Expand Down

0 comments on commit a058b08

Please sign in to comment.