Skip to content

Commit

Permalink
osrdyne: alloz more flexible amqp/keda configuration
Browse files Browse the repository at this point in the history
Signed-off-by: Élyse Viard <[email protected]>
  • Loading branch information
ElysaSrc committed Oct 24, 2024
1 parent feed32a commit 0aaa711
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion templates/editoast/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ spec:
value: "{{ .Values.endpoints.public }}/api"

- name: OSRD_MQ_URL
{{- $amqp := .Values.endpoints.amqp }}
{{- $amqp := .Values.endpoints.amqp.url }}
{{- if eq (typeOf $amqp) "map" }}
valueFrom:
{{- toYaml $amqp.valueFrom | nindent 6 }}
Expand Down
2 changes: 1 addition & 1 deletion templates/editoast/migration_job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ spec:
value: "{{ .Values.endpoints.public }}/api"

- name: OSRD_MQ_URL
{{- $amqp := .Values.endpoints.amqp }}
{{- $amqp := .Values.endpoints.amqp.url }}
{{- if eq (typeOf $amqp) "map" }}
valueFrom:
{{- toYaml $amqp.valueFrom | nindent 6 }}
Expand Down
12 changes: 6 additions & 6 deletions templates/osrdyne/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ spec:

env:
- name: OSRDYNE__AMQP_URI
{{- $amqp := .Values.endpoints.amqp }}
{{- $amqp := .Values.endpoints.amqp.url }}
{{- if eq (typeOf $amqp) "map" }}
valueFrom:
{{- toYaml $amqp.valueFrom | nindent 6 }}
Expand All @@ -73,7 +73,7 @@ spec:
{{- end }}

- name: OSRDYNE__MANAGEMENT_URI
{{- $amqpManagement := .Values.endpoints.amqpManagement }}
{{- $amqpManagement := .Values.endpoints.amqp.management }}
{{- if eq (typeOf $amqpManagement) "map" }}
valueFrom:
{{- toYaml $amqpManagement.valueFrom | nindent 6 }}
Expand All @@ -83,12 +83,12 @@ spec:

{{- if (eq .Values.services.core.autoscaling.type "Keda") }}
- name: OSRDYNE__WORKER_DRIVER__AUTOSCALING__AMQP_HOST
{{- $amqp := .Values.endpoints.amqp }}
{{- if eq (typeOf $amqp) "map" }}
{{- $amqpManagementWithVHost := .Values.endpoints.managementWithVhost }}
{{- if eq (typeOf $amqpManagementWithVHost) "map" }}
valueFrom:
{{- toYaml $amqp.valueFrom | nindent 6 }}
{{- toYaml $amqpManagementWithVHost.valueFrom | nindent 6 }}
{{- else }}
value: "{{ $amqp }}"
value: "{{ $amqpManagementWithVHost }}"
{{- end }}
{{- end }}

Expand Down
2 changes: 1 addition & 1 deletion templates/stateful_editoast/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ spec:
value: "{{ .Values.endpoints.public }}/api"

- name: OSRD_MQ_URL
{{- $amqp := .Values.endpoints.amqp }}
{{- $amqp := .Values.endpoints.amqp.url }}
{{- if eq (typeOf $amqp) "map" }}
valueFrom:
{{- toYaml $amqp.valueFrom | nindent 6 }}
Expand Down
6 changes: 4 additions & 2 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ affinity: {}
# in the env variable that uses it (merged directly).
endpoints:
public: https://my-osrd-instance.org
amqp: "amqp://osrd:password@rabbitmq:5672/%2f"
amqpManagement: "http://osrd:password@rabbitmq:15672"
amqp:
url: "amqp://osrd:password@rabbitmq:5672/%2f"
management: "http://osrd:password@rabbitmq:15672"
managementWithVhost: "http://osrd:password@rabbitmq:15672/%2f"
postgresql: "postgres://osrd:password@postgres:5432/osrd"
redis: redis://username:pwd@redis:6379/0

Expand Down

0 comments on commit 0aaa711

Please sign in to comment.