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"
|
port: "5672"
|
||||||
username: demo-app
|
username: demo-app
|
||||||
password: ""
|
password: ""
|
||||||
# Existing cluster identification for Messaging Topology CRDs
|
|
||||||
namespace: rabbitmq
|
namespace: rabbitmq
|
||||||
clusterName: rabbitmq
|
clusterName: rabbitmq-cluster
|
||||||
vhost: "/"
|
vhost: "/"
|
||||||
|
|
||||||
mariadb:
|
mariadb:
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
terraform {
|
terraform {
|
||||||
required_providers {
|
required_providers {
|
||||||
|
kubectl = {
|
||||||
|
source = "gavinbunney/kubectl"
|
||||||
|
version = "1.19.0"
|
||||||
|
}
|
||||||
helm = {
|
helm = {
|
||||||
source = "hashicorp/helm"
|
source = "hashicorp/helm"
|
||||||
version = "3.0.2" # Doporučuji použít novější verzi providera
|
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:
|
subjects:
|
||||||
- name: rabbit-gui
|
- name: rabbit-gui
|
||||||
spec:
|
spec:
|
||||||
target: http://rabbitmq.rabbitmq.svc.cluster.local:15672
|
target: http://rabbitmq-cluster.rabbitmq.svc.cluster.local:15672
|
||||||
fqdn: rabbitmq.${base_domain}
|
fqdn: rabbitmq.${base_domain}
|
||||||
noTlsVerify: true
|
noTlsVerify: true
|
||||||
tunnelRef:
|
tunnelRef:
|
||||||
|
|||||||
@@ -4,8 +4,14 @@ variable "base_domain" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
variable "rabbitmq-password" {
|
variable "rabbitmq-password" {
|
||||||
type = string
|
type = string
|
||||||
nullable = false
|
nullable = false
|
||||||
sensitive = true
|
sensitive = true
|
||||||
description = "Admin password for RabbitMQ user"
|
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