-
Notifications
You must be signed in to change notification settings - Fork 0
/
daemonset.tf
72 lines (60 loc) · 1.44 KB
/
daemonset.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
67
68
69
70
# Ensure that all nodes run a copy of the firewall
resource "kubernetes_daemonset" "lke_firewall_autoattach" {
metadata {
name = "lke-firewall-autoattach"
namespace = "kube-system"
}
spec {
selector {
match_labels = {
name = "lke-firewall-autoattach"
}
}
template {
metadata {
labels = {
name = "lke-firewall-autoattach"
}
}
spec {
host_pid = true
host_ipc = true
host_network = true
container {
name = "lke-firewall-autoattach"
image = "teocns/lke-firewall-autoattach:latest"
env {
name = "INSTANCE_LABEL"
value_from {
field_ref {
field_path = "spec.nodeName"
}
}
}
env {
name = "FIREWALL_ID"
value = var.FIREWALL_ID
}
env {
name = "LINODE_ACCESS_TOKEN"
value = var.LINODE_TOKEN
}
env {
name = "POST_OPERATION_NODE_LABELS"
value = "schedulable:true"
}
volume_mount {
name = "kubeconfig"
mount_path = "/root/.kube"
}
}
volume {
name = "kubeconfig"
config_map {
name = kubernetes_config_map.kubeletconfig.metadata.0.name
}
}
}
}
}
}