-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create nginx resources in terraform (#264)
Signed-off-by: ankitm123 <[email protected]>
- Loading branch information
Showing
9 changed files
with
174 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,15 @@ | ||
provider "aws" { | ||
region = var.region | ||
profile = var.profile | ||
} | ||
|
||
|
||
module "eks-jx" { | ||
source = "../../" | ||
vault_user = var.vault_user | ||
is_jx2 = false | ||
install_kuberhealthy = true | ||
create_nginx = true | ||
cluster_version = "1.20" | ||
nginx_chart_version = "3.12.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
fullnameOverride: ingress-nginx | ||
|
||
controller: | ||
replicaCount: 3 | ||
extraArgs: | ||
publish-service: nginx/ingress-nginx-controller | ||
service: | ||
enabled: true | ||
type: LoadBalancer | ||
annotations: | ||
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: tcp | ||
service.beta.kubernetes.io/aws-load-balancer-cross-zone-load-balancing-enabled: 'true' | ||
service.beta.kubernetes.io/aws-load-balancer-type: nlb | ||
labels: {} | ||
metrics: | ||
enabled: true | ||
port: 10254 | ||
service: | ||
annotations: | ||
prometheus.io/scrape: "true" | ||
prometheus.io/port: "10254" | ||
rbac: | ||
create: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
resource "helm_release" "nginx-ingress" { | ||
count = var.create_nginx && !var.is_jx2 ? 1 : 0 | ||
name = var.nginx_release_name | ||
chart = "ingress-nginx" | ||
namespace = var.nginx_namespace | ||
repository = "https://kubernetes.github.io/ingress-nginx" | ||
version = var.nginx_chart_version | ||
create_namespace = var.create_nginx_namespace | ||
values = [ | ||
fileexists("${path.cwd}/${var.nginx_values_file}") ? "${file("${path.cwd}/${var.nginx_values_file}")}" : "${file("${path.module}/${var.nginx_values_file}")}" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
fullnameOverride: ingress-nginx | ||
|
||
controller: | ||
replicaCount: 3 | ||
extraArgs: | ||
publish-service: nginx/ingress-nginx-controller | ||
service: | ||
enabled: true | ||
type: LoadBalancer | ||
annotations: | ||
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: tcp | ||
service.beta.kubernetes.io/aws-load-balancer-cross-zone-load-balancing-enabled: 'true' | ||
service.beta.kubernetes.io/aws-load-balancer-type: nlb | ||
labels: {} | ||
metrics: | ||
enabled: true | ||
port: 10254 | ||
service: | ||
annotations: | ||
prometheus.io/scrape: "true" | ||
prometheus.io/port: "10254" | ||
rbac: | ||
create: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
variable "is_jx2" { | ||
default = true | ||
type = bool | ||
} | ||
|
||
variable "create_nginx" { | ||
default = false | ||
type = bool | ||
description = "Decides whether we want to create nginx resources using terraform or not" | ||
} | ||
|
||
variable "nginx_release_name" { | ||
default = "nginx-ingress" | ||
type = string | ||
description = "Name of the nginx release name" | ||
} | ||
|
||
variable "nginx_namespace" { | ||
default = "nginx" | ||
type = string | ||
description = "Name of the nginx namespace" | ||
} | ||
|
||
variable "nginx_chart_version" { | ||
type = string | ||
description = "nginx chart version" | ||
} | ||
|
||
variable "create_nginx_namespace" { | ||
default = true | ||
type = bool | ||
description = "Boolean to control nginx namespace creation" | ||
} | ||
|
||
variable "nginx_values_file" { | ||
default = "nginx_values.yaml" | ||
type = string | ||
description = "Name of the values file which holds the helm chart values" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters