Skip to content

Commit

Permalink
feat: added env var config for init jobs (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
kimxogus authored Jul 22, 2020
1 parent 8d2f319 commit 5cec614
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 15 deletions.
2 changes: 1 addition & 1 deletion sentry/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: sentry
description: A Helm chart for Kubernetes
type: application
version: 4.3.0
version: 4.4.0
appVersion: 20.7.1
dependencies:
- name: redis
Expand Down
5 changes: 4 additions & 1 deletion sentry/templates/hooks/sentry-db-init.job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,17 @@ spec:
- name: db-init-job
image: "{{ .Values.images.sentry.repository }}:{{ .Values.images.sentry.tag }}"
command: ["sentry","upgrade","--noinput"]
{{- if .Values.postgresql.enabled }}
env:
{{- if .Values.postgresql.enabled }}
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "sentry.postgresql.fullname" . }}
key: postgresql-password
{{- end }}
{{- if .Values.hooks.dbInit.env }}
{{ toYaml .Values.hooks.dbInit.env | indent 8 }}
{{- end }}
volumeMounts:
- mountPath: /etc/sentry
name: config
Expand Down
5 changes: 4 additions & 1 deletion sentry/templates/hooks/user-create.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,17 @@ spec:
else \
exit 1; \
fi
{{- if .Values.postgresql.enabled }}
env:
{{- if .Values.postgresql.enabled }}
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "sentry.postgresql.fullname" . }}
key: postgresql-password
{{- end }}
{{- if .Values.hooks.dbInit.env }}
{{ toYaml .Values.hooks.dbInit.env | indent 8 }}
{{- end }}
volumeMounts:
- mountPath: /etc/sentry
name: config
Expand Down
25 changes: 13 additions & 12 deletions sentry/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ images:
sentry:
web:
replicas: 1
env: {}
env: []
probeInitialDelaySeconds: 10
resources: {}
affinity: {}
Expand All @@ -37,7 +37,7 @@ sentry:
worker:
replicas: 3
# concurrency: 4
env: {}
env: []
resources: {}
affinity: {}
nodeSelector: {}
Expand All @@ -53,15 +53,15 @@ sentry:
targetCPUUtilizationPercentage: 50

cron:
env: {}
env: []
resources: {}
affinity: {}
nodeSelector: {}
# tolerations: []
# podLabels: []
postProcessForward:
replicas: 1
env: {}
env: []
resources: {}
affinity: {}
nodeSelector: {}
Expand All @@ -71,7 +71,7 @@ sentry:
snuba:
api:
replicas: 1
env: {}
env: []
probeInitialDelaySeconds: 10
resources: {}
affinity: {}
Expand All @@ -87,7 +87,7 @@ snuba:

consumer:
replicas: 1
env: {}
env: []
resources: {}
affinity: {}
nodeSelector: {}
Expand All @@ -96,7 +96,7 @@ snuba:

outcomesConsumer:
replicas: 1
env: {}
env: []
resources: {}
affinity: {}
nodeSelector: {}
Expand All @@ -105,31 +105,32 @@ snuba:

sessionsConsumer:
replicas: 1
env: {}
env: []
resources: {}
affinity: {}
nodeSelector: {}
# tolerations: []
# podLabels: []

replacer:
env: {}
env: []
resources: {}
affinity: {}
nodeSelector: {}
# tolerations: []
# podLabels: []

dbInitJob:
env: {}
env: []

migrateJob:
env: {}
env: []


hooks:
enabled: true
dbInit:
env: []
resources:
limits:
memory: 2048Mi
Expand Down Expand Up @@ -444,4 +445,4 @@ metrics:
# namespaceSelector:
# any: true
scrapeInterval: 30s
# honorLabels: true
# honorLabels: true

0 comments on commit 5cec614

Please sign in to comment.