-
Notifications
You must be signed in to change notification settings - Fork 8
/
cilium.tf
132 lines (131 loc) · 3.71 KB
/
cilium.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
locals {
# see https://docs.cilium.io/en/stable/network/lb-ipam/
# see https://docs.cilium.io/en/stable/network/l2-announcements/
# see the CiliumL2AnnouncementPolicy type at https://github.com/cilium/cilium/blob/v1.16.1/pkg/k8s/apis/cilium.io/v2alpha1/l2announcement_types.go#L23-L42
# see the CiliumLoadBalancerIPPool type at https://github.com/cilium/cilium/blob/v1.16.1/pkg/k8s/apis/cilium.io/v2alpha1/lbipam_types.go#L23-L47
cilium_external_lb_manifests = [
{
apiVersion = "cilium.io/v2alpha1"
kind = "CiliumL2AnnouncementPolicy"
metadata = {
name = "external"
}
spec = {
loadBalancerIPs = true
interfaces = [
"eth0",
]
nodeSelector = {
matchExpressions = [
{
key = "node-role.kubernetes.io/control-plane"
operator = "DoesNotExist"
},
]
}
}
},
{
apiVersion = "cilium.io/v2alpha1"
kind = "CiliumLoadBalancerIPPool"
metadata = {
name = "external"
}
spec = {
blocks = [
{
start = cidrhost(var.cluster_node_network, var.cluster_node_network_load_balancer_first_hostnum)
stop = cidrhost(var.cluster_node_network, var.cluster_node_network_load_balancer_last_hostnum)
},
]
}
},
]
cilium_external_lb_manifest = join("---\n", [for d in local.cilium_external_lb_manifests : yamlencode(d)])
}
// see https://www.talos.dev/v1.7/kubernetes-guides/network/deploying-cilium/#method-4-helm-manifests-inline-install
// see https://docs.cilium.io/en/stable/network/servicemesh/ingress/
// see https://docs.cilium.io/en/stable/gettingstarted/hubble_setup/
// see https://docs.cilium.io/en/stable/gettingstarted/hubble/
// see https://docs.cilium.io/en/stable/helm-reference/#helm-reference
// see https://github.com/cilium/cilium/releases
// see https://github.com/cilium/cilium/tree/v1.16.1/install/kubernetes/cilium
// see https://registry.terraform.io/providers/hashicorp/helm/latest/docs/data-sources/template
data "helm_template" "cilium" {
namespace = "kube-system"
name = "cilium"
repository = "https://helm.cilium.io"
chart = "cilium"
# renovate: datasource=helm depName=cilium registryUrl=https://helm.cilium.io
version = "1.16.1"
kube_version = var.kubernetes_version
api_versions = []
set {
name = "ipam.mode"
value = "kubernetes"
}
set {
name = "securityContext.capabilities.ciliumAgent"
value = "{CHOWN,KILL,NET_ADMIN,NET_RAW,IPC_LOCK,SYS_ADMIN,SYS_RESOURCE,DAC_OVERRIDE,FOWNER,SETGID,SETUID}"
}
set {
name = "securityContext.capabilities.cleanCiliumState"
value = "{NET_ADMIN,SYS_ADMIN,SYS_RESOURCE}"
}
set {
name = "cgroup.autoMount.enabled"
value = "false"
}
set {
name = "cgroup.hostRoot"
value = "/sys/fs/cgroup"
}
set {
name = "k8sServiceHost"
value = "localhost"
}
set {
name = "k8sServicePort"
value = local.common_machine_config.machine.features.kubePrism.port
}
set {
name = "kubeProxyReplacement"
value = "true"
}
set {
name = "l2announcements.enabled"
value = "true"
}
set {
name = "devices"
value = "{eth0}"
}
set {
name = "ingressController.enabled"
value = "true"
}
set {
name = "ingressController.default"
value = "true"
}
set {
name = "ingressController.loadbalancerMode"
value = "shared"
}
set {
name = "ingressController.enforceHttps"
value = "false"
}
set {
name = "envoy.enabled"
value = "true"
}
set {
name = "hubble.relay.enabled"
value = "true"
}
set {
name = "hubble.ui.enabled"
value = "true"
}
}