Skip to content

Commit

Permalink
Make test pod metadata and spec configurable (#727)
Browse files Browse the repository at this point in the history
* Make test pod metadata and spec configurable

* Add docs

---------

Co-authored-by: Yevhen Ivantsov <yivantsov@atlassian.com>
  • Loading branch information
bianchi2 and Yevhen Ivantsov authored Dec 7, 2023
1 parent 090ddad commit 098337d
Show file tree
Hide file tree
Showing 36 changed files with 1,472 additions and 709 deletions.
89 changes: 45 additions & 44 deletions src/main/charts/bamboo-agent/README.md

Large diffs are not rendered by default.

322 changes: 163 additions & 159 deletions src/main/charts/bamboo/README.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,21 @@ metadata:
annotations:
"helm.sh/hook": test
"helm.sh/hook-delete-policy": "before-hook-creation,hook-succeeded"
{{- if not .Values.testPods.annotations }}
{{- include "bamboo.podAnnotations" . | nindent 4 }}
{{- else }}
{{- range $key, $value := .Values.testPods.annotations }}
{{ $key | quote }}: {{ tpl $value $ | quote }}
{{- end }}
{{- end }}
labels:
{{- if not .Values.testPods.labels }}
{{- include "common.labels.commonLabels" . | nindent 4 }}
{{- else }}
{{- range $key, $value := .Values.testPods.labels }}
{{ $key | quote }}: {{ tpl $value $ | quote }}
{{- end }}
{{- end }}
spec:
containers:
- name: test
Expand Down Expand Up @@ -36,4 +48,19 @@ spec:
sleep 10
count=$(( $count + 1 ))
done
restartPolicy: Never
restartPolicy: Never
{{- with .Values.testPods.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.testPods.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.testPods.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.testPods.schedulerName }}
schedulerName: {{ .Values.testPods.schedulerName | quote }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,21 @@ metadata:
annotations:
"helm.sh/hook": test
"helm.sh/hook-delete-policy": "before-hook-creation,hook-succeeded"
{{- if not .Values.testPods.annotations }}
{{- include "bamboo.podAnnotations" . | nindent 4 }}
{{- else }}
{{- range $key, $value := .Values.testPods.annotations }}
{{ $key | quote }}: {{ tpl $value $ | quote }}
{{- end }}
{{- end }}
labels:
{{- if not .Values.testPods.labels }}
{{- include "common.labels.commonLabels" . | nindent 4 }}
{{- else }}
{{- range $key, $value := .Values.testPods.labels }}
{{ $key | quote }}: {{ tpl $value $ | quote }}
{{- end }}
{{- end }}
spec:
serviceAccountName: {{ include "bamboo.serviceAccountName" . }}
containers:
Expand Down Expand Up @@ -49,4 +61,19 @@ spec:
cat output.txt
grep -q "Connection established OK" output.txt
restartPolicy: Never
{{ end }}
{{- with .Values.testPods.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.testPods.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.testPods.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.testPods.schedulerName }}
schedulerName: {{ .Values.testPods.schedulerName | quote }}
{{- end }}
{{ end }}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,21 @@ metadata:
annotations:
"helm.sh/hook": test
"helm.sh/hook-delete-policy": "before-hook-creation,hook-succeeded"
{{- if not .Values.testPods.annotations }}
{{- include "bamboo.podAnnotations" . | nindent 4 }}
{{- else }}
{{- range $key, $value := .Values.testPods.annotations }}
{{ $key | quote }}: {{ tpl $value $ | quote }}
{{- end }}
{{- end }}
labels:
{{- if not .Values.testPods.labels }}
{{- include "common.labels.commonLabels" . | nindent 4 }}
{{- else }}
{{- range $key, $value := .Values.testPods.labels }}
{{ $key | quote }}: {{ tpl $value $ | quote }}
{{- end }}
{{- end }}
spec:
containers:
- name: test
Expand Down Expand Up @@ -41,4 +53,19 @@ spec:
rm /shared-home/permissions-test
volumes:
{{ include "bamboo.volumes.sharedHome" . | nindent 4 }}
restartPolicy: Never
restartPolicy: Never
{{- with .Values.testPods.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.testPods.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.testPods.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.testPods.schedulerName }}
schedulerName: {{ .Values.testPods.schedulerName | quote }}
{{- end }}
15 changes: 14 additions & 1 deletion src/main/charts/bamboo/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,7 @@ additionalConfigMaps: []
atlassianAnalyticsAndSupport:

analytics:

# -- Mount ConfigMap with selected Helm chart values as a JSON
# which DC products will read and send analytics events to Atlassian data pipelines
#
Expand All @@ -1158,3 +1158,16 @@ atlassianAnalyticsAndSupport:
# which can be optionally including to support.zip
#
enabled: true

# -- Metadata and pod spec for pods started in Helm tests
#
testPods:
labels: {}
annotations: {}
nodeSelector: {}
tolerations: []
affinity: {}
schedulerName:
image:
permissionsTestContainer: debian:stable-slim
statusTestContainer: alpine:latest
Loading

0 comments on commit 098337d

Please sign in to comment.