From c7e0fd1ec4c4e130499b5beabcee6c71ab0a29de Mon Sep 17 00:00:00 2001 From: Shawn Hsu Date: Fri, 13 Dec 2024 18:31:41 +0800 Subject: [PATCH] feat: add default action result queue --- .../agh3/templates/base/rabbitmq-secret.yml | 33 +++++++++++++++++++ .../templates/captain/captain-deployment.yml | 2 ++ .../controller/controller-deployment.yml | 10 ++---- charts/agh3/values.yaml | 5 +++ 4 files changed, 42 insertions(+), 8 deletions(-) diff --git a/charts/agh3/templates/base/rabbitmq-secret.yml b/charts/agh3/templates/base/rabbitmq-secret.yml index 8edd49cc..5b947e6a 100644 --- a/charts/agh3/templates/base/rabbitmq-secret.yml +++ b/charts/agh3/templates/base/rabbitmq-secret.yml @@ -17,6 +17,39 @@ stringData: ) }} username: {{ .Values.rabbitmq.connection.user }} password: {{ print $password | quote }} + load_definition.json: | + { + "users": [ + { + "name": "{{ .Values.rabbitmq.connection.user }}", + "password": {{ print $password | quote }}, + "tags": "administrator" + } + ], + "queues":[ + { + "name": "{{ .Values.rabbitmq.queueName }}", + "vhost":"/", + "durable":true, + "auto_delete":false, + "arguments":{} + } + ], + "vhosts": [ + { + "name": "/" + } + ], + "permissions": [ + { + "user": "{{ .Values.rabbitmq.connection.user }}", + "vhost": "/", + "configure": ".*", + "write": ".*", + "read": ".*" + } + ] + } uri: {{ include "rabbitmq-connection-string" ( dict diff --git a/charts/agh3/templates/captain/captain-deployment.yml b/charts/agh3/templates/captain/captain-deployment.yml index ffe59389..07c5677d 100644 --- a/charts/agh3/templates/captain/captain-deployment.yml +++ b/charts/agh3/templates/captain/captain-deployment.yml @@ -141,6 +141,8 @@ spec: secretKeyRef: name: {{ .Values.captain.secret.minio.secretName }} key: capt-minio-password + - name: RABBITMQ_QUEUE + value: {{ .Values.rabbitmq.queueName }} - name: RABBITMQ_Conn valueFrom: secretKeyRef: diff --git a/charts/agh3/templates/controller/controller-deployment.yml b/charts/agh3/templates/controller/controller-deployment.yml index 3de5ef3f..4b842161 100644 --- a/charts/agh3/templates/controller/controller-deployment.yml +++ b/charts/agh3/templates/controller/controller-deployment.yml @@ -65,6 +65,8 @@ spec: secretKeyRef: name: {{ .Values.controller.secret.minio.secretName }} key: executor-minio-password + - name: RABBITMQ_QUEUE + value: {{ .Values.rabbitmq.queueName }} - name: RABBITMQ_Conn valueFrom: secretKeyRef: @@ -78,14 +80,6 @@ spec: {{- if .Values.controller.extraEnv }} {{- include "common.tplvalues.render" (dict "value" .Values.controller.extraEnv "context" $) | nindent 12 }} {{- end }} - livenessProbe: - httpGet: - path: /mq_health_check - port: 9050 - initialDelaySeconds: 15 - periodSeconds: 10 - timeoutSeconds: 10 - failureThreshold: 3 resources: requests: memory: "256Mi" diff --git a/charts/agh3/values.yaml b/charts/agh3/values.yaml index b4ed316d..772d2cf7 100644 --- a/charts/agh3/values.yaml +++ b/charts/agh3/values.yaml @@ -388,6 +388,11 @@ redis: ## @section RabbitMQ parameters ## rabbitmq: + ## @param rabbitmq.queueName Name of the RabbitMQ queue + queueName: action_crd_result + loadDefinition: + enabled: true + existingSecret: agh-rabbitmq-secret connection: ## @param rabbitmq.connection.type Choose to use external RabbitMQ or internal RabbitMQ ## internal` or `external` in string