Skip to content

Commit

Permalink
fix: allow Redis only and fix Redis password use in BROKER_URL (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mokto authored Mar 5, 2020
1 parent 04ad7fa commit 20c4ca1
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sentry/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: sentry
description: A Helm chart for Kubernetes
type: application
version: 0.9.2
version: 0.9.3
appVersion: 10.0.0
7 changes: 7 additions & 0 deletions sentry/templates/configmap-sentry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,14 @@ data:
# information on configuring your queue broker and workers. Sentry relies
# on a Python framework called Celery to manage queues.
{{- if .Values.rabbitmq.enabled }}
BROKER_URL = os.environ.get("BROKER_URL", "amqp://{{ .Values.rabbitmq.username }}:{{ .Values.rabbitmq.password }}@{{ .Values.rabbitmq.host }}:5672//")
{{- else if .Values.redis.password }}
BROKER_URL = os.environ.get("BROKER_URL", "redis://:{{ .Values.redis.password }}@{{ .Values.redis.host }}:6379/0")
{{- else }}
BROKER_URL = os.environ.get("BROKER_URL", "redis://{{ .Values.redis.host }}:6379/0")
{{- end }}
#########
# Cache #
#########
Expand Down
6 changes: 6 additions & 0 deletions sentry/templates/deployment-sentry-cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,13 @@ spec:
- name: C_FORCE_ROOT
value: "true"
- name: BROKER_URL
{{- if .Values.rabbitmq.enabled }}
value: amqp://{{ .Values.rabbitmq.username }}:{{ .Values.rabbitmq.password }}@{{ .Values.rabbitmq.host }}:5672
{{- else if .Values.redis.password }}
value: redis://:{{ .Values.redis.password }}@{{ .Values.redis.host }}:6379/0
{{- else }}
value: redis://{{ .Values.redis.host }}:6379/0
{{- end }}
{{ if eq .Values.filestore.backend "gcs" }}
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /var/run/secrets/google/{{ .Values.filestore.gcs.credentialsFile }}
Expand Down
8 changes: 7 additions & 1 deletion sentry/templates/deployment-sentry-worker-redis.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if not .Values.rabbitmq.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -65,7 +66,11 @@ spec:
- name: C_FORCE_ROOT
value: "true"
- name: BROKER_URL
value: redis://redis-master:6379/0
{{ if .Values.redis.password }}
value: redis://:{{ .Values.redis.password }}@{{ .Values.redis.host }}:6379/0
{{ else }}
value: redis://{{ .Values.redis.host }}:6379/0
{{ end }}
{{ if eq .Values.filestore.backend "gcs" }}
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /var/run/secrets/google/{{ .Values.filestore.gcs.credentialsFile }}
Expand Down Expand Up @@ -104,3 +109,4 @@ spec:
{{- if .Values.sentry.workerRedis.priorityClassName }}
priorityClassName: "{{ .Values.sentry.workerRedis.priorityClassName }}"
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions sentry/templates/deployment-sentry-worker.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.rabbitmq.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -104,3 +105,4 @@ spec:
{{- if .Values.sentry.worker.priorityClassName }}
priorityClassName: "{{ .Values.sentry.worker.priorityClassName }}"
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions sentry/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ postgres:
port: 5432

rabbitmq:
# either use RabbitMQ or Redis as broker
enabled: true
username: guest
password: guest
host: rabbitmq-ha
Expand Down

0 comments on commit 20c4ca1

Please sign in to comment.