mirror of
https://github.com/dat515-2025/Group-8.git
synced 2026-03-22 15:12:08 +01:00
feat(infrastructure): automatic deploy
This commit is contained in:
@@ -1,81 +1,58 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
kubectl = {
|
||||
source = "gavinbunney/kubectl"
|
||||
version = "1.19.0"
|
||||
}
|
||||
helm = {
|
||||
source = "hashicorp/helm"
|
||||
version = "3.0.2"
|
||||
version = "3.0.2" # Doporučuji použít novější verzi providera
|
||||
}
|
||||
kubernetes = {
|
||||
source = "hashicorp/kubernetes"
|
||||
version = "2.38.0"
|
||||
}
|
||||
kustomization = {
|
||||
source = "kbst/kustomization"
|
||||
version = "0.9.6"
|
||||
}
|
||||
time = {
|
||||
source = "hashicorp/time"
|
||||
version = "0.13.1"
|
||||
version = "2.38.0" # Doporučuji použít novější verzi providera
|
||||
}
|
||||
# Ostatní provideři mohou zůstat
|
||||
}
|
||||
}
|
||||
|
||||
# Define the Helm release for RabbitMQ.
|
||||
# This resource will install the RabbitMQ chart from the Bitnami repository.
|
||||
resource "helm_release" "rabbitmq" {
|
||||
# The name of the release in Kubernetes.
|
||||
name = "rabbitmq"
|
||||
|
||||
# The repository where the chart is located.
|
||||
repository = "https://charts.bitnami.com/bitnami"
|
||||
resource "helm_release" "rabbitmq_operator" {
|
||||
name = "rabbitmq-cluster-operator"
|
||||
repository = "oci://registry-1.docker.io/bitnamicharts"
|
||||
chart = "rabbitmq-cluster-operator"
|
||||
|
||||
# The name of the chart to deploy.
|
||||
chart = "rabbitmq"
|
||||
version = "4.4.34"
|
||||
|
||||
# The version of the chart to deploy. It's best practice to pin the version.
|
||||
version = "14.4.1"
|
||||
|
||||
# The Kubernetes namespace to deploy into.
|
||||
# If the namespace doesn't exist, you can create it with a kubernetes_namespace resource.
|
||||
namespace = "rabbitmq"
|
||||
namespace = "rabbitmq-system"
|
||||
create_namespace = true
|
||||
|
||||
# Override default chart values.
|
||||
# This is where you customize your RabbitMQ deployment.
|
||||
# Zde můžete přepsat výchozí hodnoty chartu, pokud by bylo potřeba
|
||||
# Například sledovat jen určité namespace, nastavit tolerations atd.
|
||||
# Pro základní instalaci není potřeba nic měnit.
|
||||
# values = [
|
||||
# templatefile("${path.module}/values/operator-values.yaml", {})
|
||||
# ]
|
||||
set = [
|
||||
{
|
||||
name = "auth.username"
|
||||
value = "admin"
|
||||
name = "rabbitmqImage.repository"
|
||||
value = "bitnamilegacy/rabbitmq"
|
||||
},
|
||||
{
|
||||
name = "auth.password"
|
||||
value = var.rabbitmq-password
|
||||
name = "clusterOperator.image.repository"
|
||||
value = "bitnamilegacy/rabbitmq-cluster-operator"
|
||||
},
|
||||
{
|
||||
name = "persistence.enabled"
|
||||
name = "msgTopologyOperator.image.repository"
|
||||
value = "bitnamilegacy/rmq-messaging-topology-operator"
|
||||
},
|
||||
{
|
||||
name = "credentialUpdaterImage.repository"
|
||||
value = "bitnamilegacy/rmq-default-credential-updater"
|
||||
},
|
||||
{
|
||||
name = "clusterOperator.metrics.service.enabled"
|
||||
value = "true"
|
||||
},
|
||||
{
|
||||
name = "replicaCount"
|
||||
value = "1"
|
||||
},
|
||||
{
|
||||
name = "podAntiAffinityPreset"
|
||||
value = "soft"
|
||||
},
|
||||
{
|
||||
name = "image.repository"
|
||||
value = "bitnamilegacy/rabbitmq"
|
||||
},
|
||||
name = "clusterOperator.metrics.service.enabled"
|
||||
value = "true"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
resource "kubectl_manifest" "rabbitmq_ui" {
|
||||
yaml_body = templatefile("${path.module}/rabbit-ui.yaml", {
|
||||
base_domain = var.base_domain
|
||||
})
|
||||
depends_on = [helm_release.rabbitmq]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user