-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathk3d.tf
66 lines (57 loc) · 1.1 KB
/
k3d.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
62
63
64
65
66
resource "k3d_cluster" "cluster" {
name = var.cluster_name
servers = var.num_of_servers
agents = var.num_of_agents
image = "rancher/k3s:v${var.kube_version}-k3s1"
port {
host_port = 80
container_port = 80
node_filters = [
"loadbalancer",
]
}
kube_api {
host = "localhost"
host_ip = "0.0.0.0"
host_port = 6443
}
registries {
use = [
"k3d-registry.localhost:12345"
]
config = <<EOF
mirrors:
"k3d-registry.localhost:12345":
endpoint:
- http://k3d-registry.localhost:5000
EOF
}
k3d {
disable_load_balancer = false
disable_image_volume = false
}
k3s {
extra_args {
arg = "--disable=traefik"
node_filters = [
"server:*",
]
}
}
provisioner "local-exec" {
when = create
command = <<EOD
cat <<EOF > ${var.kubeconfig_path}
${k3d_cluster.cluster.credentials[0].raw}
EOF
EOD
}
}
resource "k3d_registry" "mycluster-registry" {
name = "registry.localhost"
port {
host = "registry.localhost"
host_ip = "127.0.0.1"
host_port = "12345"
}
}