Skip to content

DeimosCloud/terraform-kubernetes-namespace-setup

Repository files navigation

Terraform Kubernetes Cert Manager Module

A terraform module to setup a namespace. It creates a namespace and configures secrets, pull secrets and configs.

Usage

module "apps_namespace_setup" {
  source = "."
  labels = local.common_labels

  namespace = local.apps_namespace
  namespace_labels = {
    "argocd.argoproj.io/instance" = "argocd-applications" # Allow Argocd admit it without destruction
  }
  namespace_annotations = {
    "linkerd.io/inject"                     = "enabled"
    "config.linkerd.io/skip-outbound-ports" = "4222,3306,6379" #nats, mysql and redis
  }

  secret_data = {
    "postgres-user"     = local.db_user_name
    "postgres-password" = module.postgres.generated_user_password
    "dns_solver.json"   = module.dns_solver_sa.key
  }

  configmap_data = {
    "postgres-host"     = module.postgres.private_ip_address
    "postgres-database" = local.db_name
    "ratings-database"  = local.ratings_db_name
    "redis-host"        = module.redis.host
  }

  pull_secret_name     = "${var.project_name}-pull-secret"
  pull_secret_registry = local.registry_server
  pull_secret          = module.gcr_reader_service_account.key
  depends_on           = [module.gke_cluster]
}

Contributing

Report issues/questions/feature requests on in the issues section.

Full contributing guidelines are covered here.

Requirements

Name Version
terraform >= 0.12
kubernetes >= 1.13

Providers

Name Version
kubernetes >= 1.13

Inputs

Name Description Type Default Required
create_namespace Whether to create namespace or not bool true no
labels Extra labels to be added to all created resources map {} no
namespace the name of the namespace to be created any n/a yes
namespace_annotations Annotations to be applied to the created namespace map {} no
namespace_labels Labels to be applied to the created namespace map {} no
pull_secret_name The name of the pull secret any null no
pull_secret_password The base64 encoded password to be used as pull secret creds any null no
pull_secret_registry Registry server URL any null no
pull_secret_username The username for the pull secret e.g _json_key for GCP SA any null no
secret_data data to be populated into config secret created in namespace map {} no
secret_generate_name Prefix, used by the server, to generate a unique name.This value will also be combined with a unique suffix. If provided, it'll override the name argument any null no
secret_name The name of the secret to create and store variables as string "config" no
secret_type The type of the secret to create. (default Opaque) string "Opaque" no
configmap_data data to be populated into configmap created in namespace map {} no
configmap_generate_name Prefix, used by the server, to generate a unique name. This value will also be combined with a unique suffix. If provided, it'll override the name argument any null no
configmap_name The name of the configmap to create and store variables as string "configmap" no

Outputs

No output.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages