Skip to content

Commit

Permalink
Template initContainers and extraContainers values (#146)
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 authored Aug 26, 2024
1 parent a5166b5 commit c62aa69
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 @@ -94,8 +94,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 @@ -95,8 +95,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 @@ -76,8 +76,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 @@ -68,6 +68,7 @@ apiServer:
# - name: ALPINE_DATABASE_MODE
# value: "external"
extraEnvFrom: []
# -- Additional containers to deploy. Supports templating.
extraContainers: []
tolerations: []
probes:
Expand Down Expand Up @@ -99,6 +100,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 @@ -157,6 +159,7 @@ frontend:
type: RuntimeDefault
extraEnv: []
extraEnvFrom: []
# -- Additional containers to deploy. Supports templating.
extraContainers: []
tolerations: []
probes:
Expand Down Expand Up @@ -185,6 +188,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 @@ -115,7 +115,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 @@ -77,7 +77,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 @@ -106,7 +106,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 @@ -106,7 +106,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 @@ -107,7 +107,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 @@ -96,7 +96,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 @@ -105,7 +105,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 @@ -85,6 +85,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 @@ -106,6 +107,7 @@ apiServer:
# runAsUser: 0
# seccompProfile:
# type: RuntimeDefault
# -- Additional containers to deploy. Supports templating.
extraContainers: []
additionalVolumes: []
additionalVolumeMounts: []
Expand Down Expand Up @@ -165,7 +167,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 @@ -212,7 +216,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 @@ -258,7 +264,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 @@ -304,7 +312,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 @@ -367,7 +377,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 c62aa69

Please sign in to comment.