Skip to content

Commit

Permalink
Support injection of extra init containers and containers
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-jones committed Nov 1, 2023
1 parent 73c148f commit 702d26f
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/flagsmith/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: flagsmith
description: Flagsmith
type: application
version: 0.22.1
version: 0.22.2
appVersion: 2.57.0
dependencies:
- name: postgresql
Expand Down
6 changes: 6 additions & 0 deletions charts/flagsmith/templates/deployment-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ spec:
volumeMounts:
- name: influxdb-setup
mountPath: /influxdb_setup/
{{- end }}
{{- with .Values.api.extraInitContainers }}
{{- toYaml . | nindent 6 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}-api
Expand Down Expand Up @@ -134,6 +137,9 @@ spec:
timeoutSeconds: {{ .Values.api.readinessProbe.timeoutSeconds }}
resources:
{{ toYaml .Values.api.resources | indent 10 }}
{{- with .Values.api.extraContainers }}
{{- toYaml . | nindent 6 }}
{{- end }}
{{- if .Values.api.influxdbSetup.enabled }}
volumes:
- name: influxdb-setup
Expand Down
7 changes: 7 additions & 0 deletions charts/flagsmith/templates/deployment-frontend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ spec:
{{- $securityContext = $securityContext | merge (omit .Values.frontend.defaultPodSecurityContext "enabled") }}
{{- end }}
{{- toYaml $securityContext | nindent 8 }}
{{- with .Values.frontend.extraInitContainers }}
initContainers:
{{- toYaml . | nindent 6 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}-frontend
image: {{ .Values.frontend.image.repository }}:{{ .Values.frontend.image.tag | default (printf "%s" .Chart.AppVersion) }}
Expand Down Expand Up @@ -82,4 +86,7 @@ spec:
timeoutSeconds: {{ .Values.frontend.readinessProbe.timeoutSeconds }}
resources:
{{ toYaml .Values.frontend.resources | indent 10 }}
{{- with .Values.frontend.extraContainers }}
{{- toYaml . | nindent 6 }}
{{- end }}
{{- end }}
7 changes: 7 additions & 0 deletions charts/flagsmith/templates/deployment-pgbouncer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ spec:
{{- $securityContext = $securityContext | merge (omit .Values.pgbouncer.defaultPodSecurityContext "enabled") }}
{{- end }}
{{- toYaml $securityContext | nindent 8 }}
{{- with .Values.pgbouncer.extraInitContainers }}
initContainers:
{{- toYaml . | nindent 6 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}-pgbouncer
image: {{ .Values.pgbouncer.image.repository }}:{{ .Values.pgbouncer.image.tag }}
Expand Down Expand Up @@ -122,4 +126,7 @@ spec:
{{- toYaml $securityContext | nindent 10 }}
resources:
{{ toYaml .Values.pgbouncer.resources | indent 10 }}
{{- with .Values.pgbouncer.extraContainers }}
{{- toYaml . | nindent 6 }}
{{- end }}
{{- end }}
7 changes: 7 additions & 0 deletions charts/flagsmith/templates/deployment-task-processor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ spec:
{{- $securityContext = $securityContext | merge (omit .Values.taskProcessor.defaultPodSecurityContext "enabled") }}
{{- end }}
{{- toYaml $securityContext | nindent 8 }}
{{- with .Values.taskProcessor.extraInitContainers }}
initContainers:
{{- toYaml . | nindent 6 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}-task-processor
image: {{ .Values.taskProcessor.image.repository | default .Values.api.image.repository }}:{{ .Values.taskProcessor.image.tag | default .Values.api.image.tag | default .Chart.AppVersion }}
Expand Down Expand Up @@ -107,4 +111,7 @@ spec:
timeoutSeconds: {{ .Values.taskProcessor.readinessProbe.timeoutSeconds }}
resources:
{{ toYaml .Values.taskProcessor.resources | indent 10 }}
{{- with .Values.taskProcessor.extraContainers }}
{{- toYaml . | nindent 6 }}
{{- end }}
{{- end }}
8 changes: 8 additions & 0 deletions charts/flagsmith/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ api:
prefix: flagsmith.api
influxdbSetup:
enabled: false
extraInitContainers: []
extraContainers: []

frontend:
# Set this to `false` to switch off the frontend (deployment,
Expand Down Expand Up @@ -120,6 +122,8 @@ frontend:
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 10
extraInitContainers: []
extraContainers: []

# See https://docs.flagsmith.com/deployment/task-processor
taskProcessor:
Expand Down Expand Up @@ -170,6 +174,8 @@ taskProcessor:
# runAsNonRoot: true # TODO: enable this, conditional on tag semver
# runAsUser: 1000
# runAsGroup: 1000
extraInitContainers: []
extraContainers: []

postgresql:
enabled: true
Expand Down Expand Up @@ -234,6 +240,8 @@ pgbouncer:
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 2
extraInitContainers: []
extraContainers: []

influxdb2:
enabled: true
Expand Down

0 comments on commit 702d26f

Please sign in to comment.