-
Notifications
You must be signed in to change notification settings - Fork 0
/
kind_cluster.tf
61 lines (55 loc) · 1.37 KB
/
kind_cluster.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
module "kind_cluster" {
source = "pepodev/cluster/kind"
version = "~> 0.1"
cluster_name = var.cluster_name
nodes = [
{
role = "control-plane"
kubeadm_config_patches = []
extra_port_mappings = {
container_port = "80"
host_port = "30201"
listen_address = "0.0.0.0"
protocol = "TCP"
}
},
{
role = "worker"
kubeadm_config_patches = []
extra_port_mappings = null
}
]
}
*/
provider "kind" {
}
provider "kubernetes" {
config_path = pathexpand(var.kind_cluster_config_path)
}
resource "kind_cluster" "default" {
name = var.cluster_name
kubeconfig_path = pathexpand(var.kind_cluster_config_path)
wait_for_ready = true
kind_config {
kind = "Cluster"
api_version = "kind.x-k8s.io/v1alpha4"
node {
role = "control-plane"
kubeadm_config_patches = [
"kind: InitConfiguration\nnodeRegistration:\n kubeletExtraArgs:\n node-labels: \"ingress-ready=true\"\n"
]
extra_port_mappings {
container_port = 80
host_port = 80
}
extra_port_mappings {
container_port = 443
host_port = 443
}
}
node {
role = "worker"
}
}
}