Skip to content

Commit

Permalink
Merge pull request #3 from PJ-ISC/add-atomic-parameter
Browse files Browse the repository at this point in the history
Add 'atomic' helm parameter as variable
  • Loading branch information
bohdantverdyi authored Mar 16, 2022
2 parents 0e261a8 + 7107108 commit a33cf76
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ module "nginx-controller" {
| name | Name of created helm release | `string` | `ingress-nginx` | no |
| namespace\_name | Name of namespace where nginx controller should be deployed | `string` | `kube-system` | no |
| chart\_version | HELM Chart Version for controller ( It is not recommended to change )| `string` | `4.0.6` | no |
| atomic | If set, installation process purges chart on fail | `bool` | `false` | no |
| ingress\_class\_name | IngressClass resource name | `string` | `nginx` | no |
| ingress\_class\_is_default | IngressClass resource default for cluster | `bool` | `true` | no |
| ip_address | External Static Address for loadbalancer (Doesn't work with AWS) | `string` | n/a | no |
Expand Down Expand Up @@ -80,4 +81,4 @@ module "nginx-controller" {
| terraform | >= 0.13.0 |
| helm | >= 2.1.0 |

## Kubernetes version: `>=1.19`
## Kubernetes version: `>=1.19`
4 changes: 2 additions & 2 deletions locals.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
locals {
helm_chart = "ingress-nginx"
helm_repository = "https://kubernetes.github.io/ingress-nginx"
helm_chart = "ingress-nginx"
helm_repository = "https://kubernetes.github.io/ingress-nginx"

loadBalancerIP = var.ip_address == null ? [] : [
{
Expand Down
5 changes: 3 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ resource "helm_release" "application" {
namespace = var.namespace
repository = local.helm_repository
version = var.chart_version
atomic = var.atomic

values = [var.disable_heavyweight_metrics ? file("${path.module}/templates/metrics-disable.yaml") : ""]

set {
name = "controller.kind"
value = var.controller_kind
}
set {
set {
name = "controller.ingressClassResource.name"
value = var.ingress_class_name
}
Expand Down Expand Up @@ -69,4 +70,4 @@ resource "helm_release" "application" {
type = lookup(set.value, "type", null)
}
}
}
}
8 changes: 7 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ variable "chart_version" {
default = "4.0.6"
}

variable "atomic" {
type = bool
description = "If set, installation process purges chart on fail"
default = false
}

variable "ingress_class_name" {
type = string
description = "IngressClass resource name"
Expand Down Expand Up @@ -90,4 +96,4 @@ variable "disable_heavyweight_metrics" {
variable "additional_set" {
description = "Add additional set for helm"
default = []
}
}

0 comments on commit a33cf76

Please sign in to comment.