From 9b862756c65733422ff4aa8bbc7da4bc81211a1d Mon Sep 17 00:00:00 2001 From: Eric GERMANEAU Date: Fri, 9 Feb 2024 12:00:18 +0100 Subject: [PATCH] added storage/onpremise/rabbitmq terraform fmt -recursive --- storage/onpremise/rabbitmq/main.tf | 54 +++++++++++++++++++++++++ storage/onpremise/rabbitmq/variables.tf | 33 +++++++++++++++ storage/onpremise/rabbitmq/versions.tf | 9 +++++ 3 files changed, 96 insertions(+) create mode 100644 storage/onpremise/rabbitmq/main.tf create mode 100644 storage/onpremise/rabbitmq/variables.tf create mode 100644 storage/onpremise/rabbitmq/versions.tf diff --git a/storage/onpremise/rabbitmq/main.tf b/storage/onpremise/rabbitmq/main.tf new file mode 100644 index 000000000..811e0a083 --- /dev/null +++ b/storage/onpremise/rabbitmq/main.tf @@ -0,0 +1,54 @@ + +resource "kubernetes_namespace" "rabbitmq" { + metadata { + name = var.namespace + } +} + +resource "helm_release" "rabbitmq" { + name = "rabbitmq" + namespace = kubernetes_namespace.rabbitmq.metadata[0].name + chart = "rabbitmq" + repository = var.helm_chart_repository + version = var.helm_chart_version + + set { + name = "image.rabbitmq.repository" + value = var.docker_image.rabbitmq.image + } + + set { + name = "image.rabbitmq.tag" + value = var.docker_image.rabbitmq.tag + } + + set { + name = "rabbitmq.service.type" + value = var.service_type + } + + set { + name = "defaultUsername" + value = "admin" + } + + set { + name = "defaultPassword" + value = "admin" + } + + # Parameter Description Default + # image.rabbitmq.repository The image of RabbitMQ container rabbitmq + # image.rabbitmq.tag The tag of the RabbitMQ image 3.8.1-alpine + # image.rabbitmq.pullPolicy The pull policy of the RabbitMQ image IfNotPresent + # extraPlugins Extra plugins enabled [] + # extraConfigurations Extra configurations to append to rabbitmq.conf `` + # advancedConfigurations advanced.config `` + # defaultUsername The username of default user to interact with RabbitMQ admin + # defaultPassword The password of default user to interact with RabbitMQ password + # service.type The service type, can be ClusterIP, or NodePort ClusterIP + +} + + + diff --git a/storage/onpremise/rabbitmq/variables.tf b/storage/onpremise/rabbitmq/variables.tf new file mode 100644 index 000000000..86270791b --- /dev/null +++ b/storage/onpremise/rabbitmq/variables.tf @@ -0,0 +1,33 @@ +# Namespace +variable "namespace" { + description = "Namespace for Chaos Mesh" + type = string +} + +variable "service_type" { + description = "service type : ClusterIP,LoadBalancer,NodePort" + type = string +} + +# Docker image +variable "docker_image" { + description = "Docker image for RabbitMQ" + type = object({ + rabbitmq = object({ + image = string + tag = string + }) + }) +} + +# Repository of Chaos Mesh helm chart +variable "helm_chart_repository" { + description = "Path to helm chart repository for Chaos Mesh" + type = string +} + +# Version of helm chart +variable "helm_chart_version" { + description = "Version of chart helm for Chaos Mesh" + type = string +} diff --git a/storage/onpremise/rabbitmq/versions.tf b/storage/onpremise/rabbitmq/versions.tf new file mode 100644 index 000000000..1edb1db8d --- /dev/null +++ b/storage/onpremise/rabbitmq/versions.tf @@ -0,0 +1,9 @@ +terraform { + required_version = ">= 1.0" + required_providers { + helm = { + source = "hashicorp/helm" + version = ">= 2.10.1" + } + } +}