Skip to content

Commit

Permalink
Merge pull request #2 from aigisuk/develop
Browse files Browse the repository at this point in the history
🚚 move namespace creation to helm provider
  • Loading branch information
colinwilson authored Jan 7, 2022
2 parents ab00366 + f32d4e2 commit 52276e9
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 22 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
15 changes: 6 additions & 9 deletions chart.tf
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -17,8 +18,4 @@ resource "helm_release" "traefik" {
name = "deployment.replicas"
value = var.replica_count
}

depends_on = [
kubernetes_namespace.traefik_namespace
]
}
6 changes: 0 additions & 6 deletions namespace.tf

This file was deleted.

4 changes: 2 additions & 2 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
4 changes: 0 additions & 4 deletions versions.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
terraform {
required_providers {
kubernetes = {
source = "hashicorp/kubernetes"
version = ">= 2.0.0"
}
helm = {
source = "hashicorp/helm"
version = ">= 2.0.1"
Expand Down

0 comments on commit 52276e9

Please sign in to comment.