Skip to content

Commit

Permalink
Add pod-annotations to agent job
Browse files Browse the repository at this point in the history
Signed-off-by: Calvin Audier <[email protected]>
  • Loading branch information
Calvinaud committed Oct 16, 2024
1 parent f990824 commit 061f093
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions charts/litmus-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ $ helm install litmus-agent litmuschaos/litmus-agent \
| image.pullPolicy | string | `"Always"` | |
| image.repository | string | `"litmuschaos.docker.scarf.sh/litmuschaos/litmus-helm-agent"` | |
| image.tag | string | `"latest"` | |
| podAnnotations | object | `{}` | |
| resources.limits.cpu | string | `"100m"` | |
| resources.limits.memory | string | `"128Mi"` | |
| resources.requests.cpu | string | `"100m"` | |
Expand Down
13 changes: 13 additions & 0 deletions charts/litmus-agent/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,19 @@ app.kubernetes.io/name: {{ include "litmus-agent.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Common pod annotations
*/}}
{{- define "litmus-agent.podAnnotations" -}}
{{- if .Values.global.podAnnotations }}
{{ toYaml .Values.global.podAnnotations }}
{{- end }}
{{- if .Values.podAnnotations }}
{{ toYaml .Values.podAnnotations }}
{{- end }}
{{- end -}}


{{/*
Create the name of the service account to use
*/}}
Expand Down
4 changes: 4 additions & 0 deletions charts/litmus-agent/templates/hook-pre-install-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ spec:
template:
metadata:
name: "{{ .Release.Name }}"
{{- with include "litmus-agent.podAnnotations" . }}
annotations:
{{- . | indent 8 }}
{{- end }}
labels:
{{- include "litmus-agent.labels" . | nindent 8 }}
spec:
Expand Down
2 changes: 2 additions & 0 deletions charts/litmus-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ image:
crds:
create: true

podAnnotations: {}

resources:
limits:
cpu: 100m
Expand Down

0 comments on commit 061f093

Please sign in to comment.