mirror of
https://github.com/dat515-2025/Group-8.git
synced 2026-03-22 06:57:47 +01:00
feat(infrastructure): update rabbitmq env
This commit is contained in:
@@ -37,9 +37,8 @@ rabbitmq:
|
||||
port: "5672"
|
||||
username: demo-app
|
||||
password: ""
|
||||
# Existing cluster identification for Messaging Topology CRDs
|
||||
namespace: rabbitmq
|
||||
clusterName: rabbitmq
|
||||
clusterName: rabbitmq-cluster
|
||||
vhost: "/"
|
||||
|
||||
mariadb:
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
kubectl = {
|
||||
source = "gavinbunney/kubectl"
|
||||
version = "1.19.0"
|
||||
}
|
||||
helm = {
|
||||
source = "hashicorp/helm"
|
||||
version = "3.0.2" # Doporučuji použít novější verzi providera
|
||||
@@ -56,3 +60,26 @@ resource "helm_release" "rabbitmq_operator" {
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
|
||||
resource "kubectl_manifest" "rabbitmq_cluster" {
|
||||
yaml_body = templatefile("${path.module}/rabbit-cluster.yaml", {
|
||||
replicas = var.rabbitmq_replicas
|
||||
password = var.rabbitmq-password
|
||||
})
|
||||
|
||||
depends_on = [
|
||||
helm_release.rabbitmq_operator
|
||||
]
|
||||
}
|
||||
|
||||
resource "kubectl_manifest" "rabbit_ui" {
|
||||
yaml_body = templatefile("${path.module}/rabbit-ui.yaml", {
|
||||
base_domain = var.base_domain
|
||||
})
|
||||
|
||||
depends_on = [
|
||||
kubectl_manifest.rabbitmq_cluster
|
||||
]
|
||||
}
|
||||
|
||||
5
7project/tofu/modules/rabbitmq/rabbit-cluster.yaml
Normal file
5
7project/tofu/modules/rabbitmq/rabbit-cluster.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
apiVersion: rabbitmq.com/v1beta1
|
||||
kind: RabbitmqCluster
|
||||
metadata:
|
||||
name: 'rabbitmq-cluster'
|
||||
namespace: "rabbitmq"
|
||||
@@ -6,7 +6,7 @@ metadata:
|
||||
subjects:
|
||||
- name: rabbit-gui
|
||||
spec:
|
||||
target: http://rabbitmq.rabbitmq.svc.cluster.local:15672
|
||||
target: http://rabbitmq-cluster.rabbitmq.svc.cluster.local:15672
|
||||
fqdn: rabbitmq.${base_domain}
|
||||
noTlsVerify: true
|
||||
tunnelRef:
|
||||
|
||||
@@ -9,3 +9,9 @@ variable "rabbitmq-password" {
|
||||
sensitive = true
|
||||
description = "Admin password for RabbitMQ user"
|
||||
}
|
||||
|
||||
variable "rabbitmq_replicas" {
|
||||
type = number
|
||||
description = "Number of replicas for the RabbitMQ cluster"
|
||||
default = 1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user