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/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 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