-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx_ingress.tf
37 lines (30 loc) · 917 Bytes
/
nginx_ingress.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
provider "helm" {
kubernetes {
config_path = pathexpand(var.kind_cluster_config_path)
}
}
resource "helm_release" "ingress_nginx" {
name = "ingress-nginx"
repository = "https://kubernetes.github.io/ingress-nginx"
chart = "ingress-nginx"
version = var.ingress_nginx_helm_version
namespace = var.ingress_nginx_namespace
create_namespace = true
values = [file("nginx_ingress_values.yaml")]
depends_on = [kind_cluster.default]
}
resource "null_resource" "wait_for_ingress_nginx" {
triggers = {
key = uuid()
}
provisioner "local-exec" {
command = <<EOF
printf "\nWaiting for the nginx ingress controller...\n"
kubectl wait --namespace ${var.ingress_nginx_namespace} \
--for=condition=ready pod \
--selector=app.kubernetes.io/component=controller \
--timeout=60s
EOF
}
depends_on = [helm_release.ingress_nginx]
}