Terraform module to create following K8S resources:
- StatefulSet
- Service
- Secret
- ConfigMap
- Ingress (optionally)
Module does not require any input variables. See full list of supported variables
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
}
}
Full list of module's outputs and descriptions can be found in outputs.tf
The module is being distributed under MIT Licence. Please make sure you have read, understood and agreed to its terms and conditions
Vladimir Tiukhtin [email protected]
London