Skip to content

vladimirtiukhtin/terraform-k8s-rabbitmq

Repository files navigation

Terraform K8s RabbitMQ Module

Terraform module to create following K8S resources:

  • StatefulSet
  • Service
  • Secret
  • ConfigMap
  • Ingress (optionally)

Contents

Required Input Variables

Module does not require any input variables. See full list of supported variables

Usage

To provision 3-nodes cluster in default namespace use:

module "rabbitmq" {
  source = "./modules/k8s_rabbitmq"
}

Multiple deployments are also supported:

module "rabbitmq_dev1" {
  source   = "./modules/k8s_rabbitmq"
  instance = "dev1"
}

module "rabbitmq_dev2" {
  source   = "./modules/k8s_rabbitmq"
  instance = "dev2"
}

To enable rabbitmq_management plugin and expose it via cluster ingress controller use:

module "rabbitmq" {
  source = "./modules/k8s_rabbitmq"
  additional_plugins = [
    "rabbitmq_management"
  ]
  ingress_hosts = [
    {
      host = "rabbitmq.${local.domain_name}"
      path = "/"
    }
  ]
}

To specify necessary ingress annotations and/or any extra labels use:

module "rabbitmq" {
  source = "./modules/k8s_rabbitmq"
  additional_plugins = [
    "rabbitmq_management"
  ]
  ingress_annotations = {
    "kubernetes.io/ingress.class"                        = "traefik"
    "traefik.ingress.kubernetes.io/redirect-entry-point" = "https"
    "traefik.ingress.kubernetes.io/redirect-permanent"   = "true"
  }
  ingress_hosts = [
    {
      host = "rabbitmq.${local.domain_name}"
      path = "/"
    }
  ]
  extra_labels = {
    "app.kubernetes.io/part-of"     = lower(var.project_name)
    "app.kubernetes.io/environment" = local.environment
  }
}

Outputs

Full list of module's outputs and descriptions can be found in outputs.tf

License

The module is being distributed under MIT Licence. Please make sure you have read, understood and agreed to its terms and conditions

Author Information

Vladimir Tiukhtin [email protected]
London

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages