Skip to content

Commit

Permalink
Template initContainers and extraContainers values
Browse files Browse the repository at this point in the history
Allows for re-using of names, labels, etc. of the chart.

Signed-off-by: nscuro <[email protected]>
  • Loading branch information
nscuro committed Aug 26, 2024
1 parent d50dcc0 commit df0783c
Show file tree
Hide file tree
Showing 14 changed files with 46 additions and 30 deletions.
2 changes: 1 addition & 1 deletion charts/dependency-track/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: dependency-track
version: 0.17.0
version: 0.18.0
type: application
appVersion: 4.11.7
description: |-
Expand Down
8 changes: 4 additions & 4 deletions charts/dependency-track/templates/api-server/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ spec:
imagePullSecrets: {{- toYaml . | nindent 6 }}
{{- end }}
initContainers:
{{- if .Values.apiServer.initContainers }}
{{- toYaml .Values.apiServer.initContainers | nindent 6 }}
{{- with .Values.apiServer.initContainers }}
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}
serviceAccount: {{ include "dependencytrack.serviceAccountName" . }}
{{- with .Values.apiServer.podSecurityContext }}
Expand Down Expand Up @@ -102,8 +102,8 @@ spec:
periodSeconds: {{ .Values.apiServer.probes.readiness.periodSeconds }}
successThreshold: {{ .Values.apiServer.probes.readiness.successThreshold }}
timeoutSeconds: {{ .Values.apiServer.probes.readiness.timeoutSeconds }}
{{- if .Values.apiServer.extraContainers }}
{{- toYaml .Values.apiServer.extraContainers | nindent 6 }}
{{- with .Values.apiServer.extraContainers }}
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}
{{- if .Values.apiServer.tolerations }}
tolerations:
Expand Down
8 changes: 4 additions & 4 deletions charts/dependency-track/templates/api-server/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ spec:
imagePullSecrets: {{- toYaml . | nindent 6 }}
{{- end }}
initContainers:
{{- if .Values.apiServer.initContainers }}
{{- toYaml .Values.apiServer.initContainers | nindent 6 }}
{{- with .Values.apiServer.initContainers }}
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}
serviceAccount: {{ include "dependencytrack.serviceAccountName" . }}
{{- with .Values.apiServer.podSecurityContext }}
Expand Down Expand Up @@ -103,8 +103,8 @@ spec:
periodSeconds: {{ .Values.apiServer.probes.readiness.periodSeconds }}
successThreshold: {{ .Values.apiServer.probes.readiness.successThreshold }}
timeoutSeconds: {{ .Values.apiServer.probes.readiness.timeoutSeconds }}
{{- if .Values.apiServer.extraContainers }}
{{- toYaml .Values.apiServer.extraContainers | nindent 6 }}
{{- with .Values.apiServer.extraContainers }}
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}
{{- if .Values.apiServer.tolerations }}
tolerations:
Expand Down
8 changes: 4 additions & 4 deletions charts/dependency-track/templates/frontend/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ spec:
imagePullSecrets: {{- toYaml . | nindent 6 }}
{{- end }}
initContainers:
{{- if .Values.frontend.initContainers }}
{{- toYaml .Values.frontend.initContainers | nindent 6 }}
{{- with .Values.frontend.initContainers }}
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}
serviceAccount: {{ include "dependencytrack.serviceAccountName" . }}
containers:
Expand Down Expand Up @@ -84,8 +84,8 @@ spec:
periodSeconds: {{ .Values.frontend.probes.readiness.periodSeconds }}
successThreshold: {{ .Values.frontend.probes.readiness.successThreshold }}
timeoutSeconds: {{ .Values.frontend.probes.readiness.timeoutSeconds }}
{{- if .Values.frontend.extraContainers }}
{{- toYaml .Values.frontend.extraContainers | nindent 6 }}
{{- with .Values.frontend.extraContainers }}
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}
{{- if .Values.frontend.tolerations }}
tolerations:
Expand Down
4 changes: 4 additions & 0 deletions charts/dependency-track/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ apiServer:
# - name: ALPINE_DATABASE_MODE
# value: "external"
extraEnvFrom: []
# -- Additional containers to deploy. Supports templating.
extraContainers: []
tolerations: []
probes:
Expand Down Expand Up @@ -89,6 +90,7 @@ apiServer:
namespace: monitoring
scrapeInternal: 15s
scrapeTimeout: 30s
# -- Additional init containers to deploy. Supports templating.
initContainers: []
# Use the following to fix permissions on the /data volume,
# IF USING podSecurityContext IS NOT POSSIBLE (i.e. for OpenShift).
Expand Down Expand Up @@ -136,6 +138,7 @@ frontend:
memory: 128Mi
extraEnv: []
extraEnvFrom: []
# -- Additional containers to deploy. Supports templating.
extraContainers: []
tolerations: []
probes:
Expand Down Expand Up @@ -164,6 +167,7 @@ frontend:
nodePort: ~
annotations: {}
apiBaseUrl: ""
# -- Additional init containers to deploy. Supports templating.
initContainers: []
nodeSelector: {}

Expand Down
2 changes: 1 addition & 1 deletion charts/hyades/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: hyades
version: 0.6.0
version: 0.7.0
type: application
appVersion: 0.6.0-SNAPSHOT
description: |-
Expand Down
4 changes: 2 additions & 2 deletions charts/hyades/templates/api-server/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
{{- end }}
initContainers:
{{- with .Values.apiServer.initContainers }}
{{- toYaml . | nindent 6 }}
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}
serviceAccountName: {{ include "hyades.serviceAccountName" . }}
terminationGracePeriodSeconds: {{ .Values.apiServer.terminationGracePeriodSeconds }}
Expand Down Expand Up @@ -123,7 +123,7 @@ spec:
successThreshold: {{ .Values.apiServer.probes.readiness.successThreshold }}
timeoutSeconds: {{ .Values.apiServer.probes.readiness.timeoutSeconds }}
{{- with .Values.apiServer.extraContainers }}
{{- toYaml . | nindent 6 }}
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}
{{- with .Values.apiServer.tolerations }}
tolerations: {{- toYaml . | nindent 8 }}
Expand Down
6 changes: 3 additions & 3 deletions charts/hyades/templates/frontend/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ spec:
imagePullSecrets: {{- toYaml . | nindent 6 }}
{{- end }}
initContainers:
{{- if .Values.frontend.initContainers }}
{{- toYaml .Values.frontend.initContainers | nindent 6 }}
{{- with .Values.frontend.initContainers }}
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}
serviceAccountName: {{ include "hyades.serviceAccountName" . }}
containers:
Expand Down Expand Up @@ -85,7 +85,7 @@ spec:
successThreshold: {{ .Values.frontend.probes.readiness.successThreshold }}
timeoutSeconds: {{ .Values.frontend.probes.readiness.timeoutSeconds }}
{{- with .Values.frontend.extraContainers }}
{{- toYaml . | nindent 6 }}
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}
{{- with .Values.frontend.tolerations }}
tolerations:
Expand Down
6 changes: 3 additions & 3 deletions charts/hyades/templates/mirror-service/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ spec:
imagePullSecrets: {{- toYaml . | nindent 6 }}
{{- end }}
initContainers:
{{- if .Values.mirrorService.initContainers }}
{{- toYaml .Values.mirrorService.initContainers | nindent 6 }}
{{- with .Values.mirrorService.initContainers }}
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}
serviceAccountName: {{ include "hyades.serviceAccountName" . }}
containers:
Expand Down Expand Up @@ -114,7 +114,7 @@ spec:
successThreshold: {{ .Values.mirrorService.probes.readiness.successThreshold }}
timeoutSeconds: {{ .Values.mirrorService.probes.readiness.timeoutSeconds }}
{{- with .Values.mirrorService.extraContainers }}
{{- toYaml . | nindent 6 }}
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}
{{- with .Values.mirrorService.tolerations }}
tolerations:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
{{- end }}
initContainers:
{{- with .Values.notificationPublisher.initContainers }}
{{- toYaml . | nindent 6 }}
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}
serviceAccountName: {{ include "hyades.serviceAccountName" . }}
containers:
Expand Down Expand Up @@ -114,7 +114,7 @@ spec:
successThreshold: {{ .Values.notificationPublisher.probes.readiness.successThreshold }}
timeoutSeconds: {{ .Values.notificationPublisher.probes.readiness.timeoutSeconds }}
{{- with .Values.notificationPublisher.extraContainers }}
{{- toYaml . | nindent 6 }}
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}
{{- with .Values.notificationPublisher.tolerations }}
tolerations: {{- toYaml . | nindent 8 }}
Expand Down
4 changes: 2 additions & 2 deletions charts/hyades/templates/repo-meta-analyzer/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
{{- end }}
initContainers:
{{- with .Values.repoMetaAnalyzer.initContainers }}
{{- toYaml . | nindent 6 }}
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}
serviceAccountName: {{ include "hyades.serviceAccountName" . }}
containers:
Expand Down Expand Up @@ -115,7 +115,7 @@ spec:
successThreshold: {{ .Values.repoMetaAnalyzer.probes.readiness.successThreshold }}
timeoutSeconds: {{ .Values.repoMetaAnalyzer.probes.readiness.timeoutSeconds }}
{{- with .Values.repoMetaAnalyzer.extraContainers }}
{{- toYaml . | nindent 6 }}
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}
{{- with .Values.repoMetaAnalyzer.tolerations }}
tolerations: {{- toYaml . | nindent 8 }}
Expand Down
4 changes: 2 additions & 2 deletions charts/hyades/templates/vuln-analyzer/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
{{- end }}
initContainers:
{{- with .Values.notificationPublisher.initContainers }}
{{- toYaml . | nindent 6 }}
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}
serviceAccountName: {{ include "hyades.serviceAccountName" . }}
containers:
Expand Down Expand Up @@ -104,7 +104,7 @@ spec:
successThreshold: {{ .Values.vulnAnalyzer.probes.readiness.successThreshold }}
timeoutSeconds: {{ .Values.vulnAnalyzer.probes.readiness.timeoutSeconds }}
{{- with .Values.vulnAnalyzer.extraContainers }}
{{- toYaml . | nindent 6 }}
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}
{{- with .Values.vulnAnalyzer.tolerations }}
tolerations: {{- toYaml . | nindent 8 }}
Expand Down
4 changes: 2 additions & 2 deletions charts/hyades/templates/vuln-analyzer/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spec:
{{- end }}
initContainers:
{{- with .Values.notificationPublisher.initContainers }}
{{- toYaml . | nindent 6 }}
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}
serviceAccountName: {{ include "hyades.serviceAccountName" . }}
containers:
Expand Down Expand Up @@ -113,7 +113,7 @@ spec:
successThreshold: {{ .Values.vulnAnalyzer.probes.readiness.successThreshold }}
timeoutSeconds: {{ .Values.vulnAnalyzer.probes.readiness.timeoutSeconds }}
{{- with .Values.vulnAnalyzer.extraContainers }}
{{- toYaml . | nindent 6 }}
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}
{{- with .Values.vulnAnalyzer.tolerations }}
tolerations: {{- toYaml . | nindent 8 }}
Expand Down
12 changes: 12 additions & 0 deletions charts/hyades/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ apiServer:
# Should always be equal to or greater than the sum of `_DRAIN_TIMEOUT` configurations to ensure graceful shutdown.
# Refer to https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/ for details.
terminationGracePeriodSeconds: 60
# -- Additional init containers to deploy. Supports templating.
initContainers: []
# Use the following to fix permissions on the /data volume.
# initContainers:
Expand All @@ -96,6 +97,7 @@ apiServer:
# runAsUser: 0
# seccompProfile:
# type: RuntimeDefault
# -- Additional containers to deploy. Supports templating.
extraContainers: []
additionalVolumes: []
additionalVolumeMounts: []
Expand Down Expand Up @@ -144,7 +146,9 @@ frontend:
nodePort: ~
annotations: {}
apiBaseUrl: ""
# -- Additional init containers to deploy. Supports templating.
initContainers: []
# -- Additional containers to deploy. Supports templating.
extraContainers: []
additionalVolumes: []
additionalVolumeMounts: []
Expand Down Expand Up @@ -189,7 +193,9 @@ mirrorService:
periodSeconds: 15
successThreshold: 1
timeoutSeconds: 5
# -- Additional init containers to deploy. Supports templating.
initContainers: []
# -- Additional containers to deploy. Supports templating.
extraContainers: []
additionalVolumes: []
additionalVolumeMounts: []
Expand Down Expand Up @@ -233,7 +239,9 @@ notificationPublisher:
periodSeconds: 15
successThreshold: 1
timeoutSeconds: 5
# -- Additional init containers to deploy. Supports templating.
initContainers: []
# -- Additional containers to deploy. Supports templating.
extraContainers: []
additionalVolumes: []
additionalVolumeMounts: []
Expand Down Expand Up @@ -277,7 +285,9 @@ repoMetaAnalyzer:
periodSeconds: 15
successThreshold: 1
timeoutSeconds: 5
# -- Additional init containers to deploy. Supports templating.
initContainers: []
# -- Additional containers to deploy. Supports templating.
extraContainers: []
additionalVolumes: []
additionalVolumeMounts: []
Expand Down Expand Up @@ -338,7 +348,9 @@ vulnAnalyzer:
timeoutSeconds: 5
service:
annotations: {}
# -- Additional init containers to deploy. Supports templating.
initContainers: []
# -- Additional containers to deploy. Supports templating.
extraContainers: []
additionalVolumes: []
additionalVolumeMounts: []
Expand Down

0 comments on commit df0783c

Please sign in to comment.