From f32d4e2884df166228c824c3dad9e1f8e50018e6 Mon Sep 17 00:00:00 2001 From: Colin Wilson Date: Fri, 7 Jan 2022 13:22:54 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=9A=20move=20namespace=20creation=20to?= =?UTF-8?q?=20helm=20provider=20=F0=9F=94=A5=20remove=20k8s=20provider=20r?= =?UTF-8?q?esource=20'namespace'=20=F0=9F=93=84=20update=20readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- chart.tf | 15 ++++++--------- namespace.tf | 6 ------ variables.tf | 4 ++-- versions.tf | 4 ---- 5 files changed, 9 insertions(+), 22 deletions(-) delete mode 100644 namespace.tf diff --git a/README.md b/README.md index da86c12..be67ed8 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Terraform DigitalOcean Traefik Module A Terraform module to provision [Traefik](https://traefik.io/traefik/) (v2.x) on a Kubernetes cluster via the [helm terraform provider](https://registry.terraform.io/providers/hashicorp/helm/latest). -![Traefik Dashboard](https://res.cloudinary.com/qunux/image/upload/v1641521532/traefik_dashboard_nb0x3p.webp) +![Traefik Dashboard](https://res.cloudinary.com/qunux/image/upload/v1641522399/traefik_dashboard_nfkzvv.webp) ## Inputs diff --git a/chart.tf b/chart.tf index a65bdb2..6c93fb0 100644 --- a/chart.tf +++ b/chart.tf @@ -1,10 +1,11 @@ # Install traefik helm_chart resource "helm_release" "traefik" { - namespace = var.namespace - name = "traefik-v${replace(var.traefik_chart_version, ".", "-")}" - repository = "https://helm.traefik.io/traefik" - chart = "traefik" - version = var.traefik_chart_version + namespace = var.namespace + create_namespace = true + name = "traefik-v${replace(var.traefik_chart_version, ".", "-")}" + repository = "https://helm.traefik.io/traefik" + chart = "traefik" + version = var.traefik_chart_version # Helm chart deployment can sometimes take longer than the default 5 minutes timeout = var.timeout_seconds @@ -17,8 +18,4 @@ resource "helm_release" "traefik" { name = "deployment.replicas" value = var.replica_count } - - depends_on = [ - kubernetes_namespace.traefik_namespace - ] } \ No newline at end of file diff --git a/namespace.tf b/namespace.tf deleted file mode 100644 index e753942..0000000 --- a/namespace.tf +++ /dev/null @@ -1,6 +0,0 @@ -# Create traefik namespace -resource "kubernetes_namespace" "traefik_namespace" { - metadata { - name = var.namespace - } -} \ No newline at end of file diff --git a/variables.tf b/variables.tf index 68462a8..81c46cd 100644 --- a/variables.tf +++ b/variables.tf @@ -12,9 +12,9 @@ variable "traefik_chart_version" { # Helm chart deployment can sometimes take longer than the default 5 minutes variable "timeout_seconds" { - type = number + type = number description = "Helm chart deployment can sometimes take longer than the default 5 minutes. Set a custom timeout here." - default = 800 # 10 minutes + default = 800 # 10 minutes } variable "replica_count" { diff --git a/versions.tf b/versions.tf index d07d61e..c99ef37 100644 --- a/versions.tf +++ b/versions.tf @@ -1,9 +1,5 @@ terraform { required_providers { - kubernetes = { - source = "hashicorp/kubernetes" - version = ">= 2.0.0" - } helm = { source = "hashicorp/helm" version = ">= 2.0.1"