From 0fd1a2146c88eb9eae1725d913c41895892bac84 Mon Sep 17 00:00:00 2001 From: Joshua Pare Date: Wed, 29 Jun 2022 09:02:19 -0400 Subject: [PATCH 1/2] allow rabbitmq protocol to be default amqp but configurable (for services like AmazonMQ which use amqps) --- engine/settings/helm.py | 3 ++- helm/oncall/templates/_env.tpl | 10 ++++++++++ helm/oncall/values.yaml | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/engine/settings/helm.py b/engine/settings/helm.py index 6fcabd85..99f34d74 100644 --- a/engine/settings/helm.py +++ b/engine/settings/helm.py @@ -26,8 +26,9 @@ RABBITMQ_USERNAME = os.environ.get("RABBITMQ_USERNAME") RABBITMQ_PASSWORD = os.environ.get("RABBITMQ_PASSWORD") RABBITMQ_HOST = os.environ.get("RABBITMQ_HOST") RABBITMQ_PORT = os.environ.get("RABBITMQ_PORT") +RABBITMQ_PROTOCOL = os.environ.get("RABBITMQ_PROTOCOL") -CELERY_BROKER_URL = f"amqp://{RABBITMQ_USERNAME}:{RABBITMQ_PASSWORD}@{RABBITMQ_HOST}:{RABBITMQ_PORT}" +CELERY_BROKER_URL = f"{RABBITMQ_PROTOCOL}://{RABBITMQ_USERNAME}:{RABBITMQ_PASSWORD}@{RABBITMQ_HOST}:{RABBITMQ_PORT}" REDIS_PASSWORD = os.environ.get("REDIS_PASSWORD") REDIS_HOST = os.environ.get("REDIS_HOST") diff --git a/helm/oncall/templates/_env.tpl b/helm/oncall/templates/_env.tpl index d5b881f2..546554fa 100644 --- a/helm/oncall/templates/_env.tpl +++ b/helm/oncall/templates/_env.tpl @@ -104,6 +104,8 @@ value: {{ include "snippet.rabbitmq.host" . }} - name: RABBITMQ_PORT value: {{ include "snippet.rabbitmq.port" . }} +- name: RABBITMQ_PROTOCOL + value: {{ include "snippet.rabbitmq.protocol" . }} {{- end }} {{- define "snippet.rabbitmq.user" -}} @@ -130,6 +132,14 @@ {{- end -}} {{- end -}} +{{- define "snippet.rabbitmq.protocol" -}} +{{- if and (not .Values.rabbitmq.enabled) .Values.externalRabbitmq.protocol -}} +{{ .Values.externalRabbitmq.protocol | quote }} +{{- else -}} +"amqp" +{{- end -}} +{{- end -}} + {{- define "snippet.rabbitmq.password.secret.name" -}} {{- if and (not .Values.rabbitmq.enabled) .Values.externalRabbitmq.password -}} {{ include "oncall.fullname" . }}-rabbitmq-external diff --git a/helm/oncall/values.yaml b/helm/oncall/values.yaml index ce8af06c..cf0b41f9 100644 --- a/helm/oncall/values.yaml +++ b/helm/oncall/values.yaml @@ -116,6 +116,7 @@ externalRabbitmq: port: user: password: + protocol: # Redis is included into this release for the convenience. # It is recommended to host it separately from this release From 32bc4457f8c614e121f2cb9fe3ef1d7d864d813c Mon Sep 17 00:00:00 2001 From: Ildar Iskhakov Date: Sun, 3 Jul 2022 12:18:27 +0400 Subject: [PATCH 2/2] Update Chart.yaml --- helm/oncall/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helm/oncall/Chart.yaml b/helm/oncall/Chart.yaml index 27c1e1f1..2d138cf1 100644 --- a/helm/oncall/Chart.yaml +++ b/helm/oncall/Chart.yaml @@ -8,7 +8,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.0.1 +version: 1.0.2 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to @@ -40,4 +40,4 @@ dependencies: - name: ingress-nginx version: 4.1.4 repository: https://kubernetes.github.io/ingress-nginx - condition: ingress-nginx.enabled \ No newline at end of file + condition: ingress-nginx.enabled