Skip to content

Commit 3715b64

Browse files
authored
Add Cilium support in Kubespray 2.27 (#445)
1 parent 022a392 commit 3715b64

File tree

4 files changed

+104
-2
lines changed

4 files changed

+104
-2
lines changed

bin/apply.bash

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ if [ -z "${CK8S_KUBESPRAY_NO_VENV+x}" ]; then
3232
fi
3333

3434
log_info "Running kubespray"
35-
ansible-playbook -i "${config[inventory_file]}" cluster.yml -b "${@}"
35+
ansible-playbook \
36+
-i "${config[inventory_file]}" \
37+
-i "${here}/../config/cilium-values-inventory.yaml" \
38+
cluster.yml -b "${@}"
3639

3740
log_info "Kubespray done"
3841

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
all:
2+
vars:
3+
cilium_extra_values: "{{ cilium_extra_values_template | from_yaml }}"
4+
cilium_extra_values_template: |
5+
{% if ck8s_cilium | default(false) %}
6+
policyEnforcementMode: {{ ck8s_cilium.policyEnforcementMode }}
7+
8+
policyAuditMode: {{ ck8s_cilium.policyAuditMode }}
9+
10+
operator:
11+
unmanagedPodWatcher:
12+
restart: {{ ck8s_cilium.operator.unmanagedPodWatcher.restart }}
13+
prometheus:
14+
enabled: {{ ck8s_cilium.operator.monitoring.enabled }}
15+
serviceMonitor:
16+
enabled: {{ ck8s_cilium.operator.monitoring.installServiceMonitor }}
17+
18+
encryption:
19+
enabled: {{ ck8s_cilium.wireguard.enabled }}
20+
type: wireguard
21+
strictMode:
22+
enabled: {{ ck8s_cilium.wireguard.strictMode }}
23+
24+
hubble:
25+
enabled: {{ ck8s_cilium.hubble.enabled }}
26+
metrics:
27+
enabled: {{ ck8s_cilium.hubble.metrics }}
28+
serviceMonitor:
29+
enabled: {{ ck8s_cilium.hubble.monitoring.installServiceMonitor }}
30+
31+
prometheus:
32+
enabled: {{ ck8s_cilium.prometheus.enabled }}
33+
serviceMonitor:
34+
enabled: {{ ck8s_cilium.prometheus.installServiceMonitor }}
35+
trustCRDsExist: true
36+
37+
envoy:
38+
enabled: {{ ck8s_cilium.envoy.enabled }}
39+
40+
{% if ck8s_cilium.enableNodeSelectability | default(false) %}
41+
policyCIDRMatchMode: nodes
42+
{% endif %}
43+
44+
annotateK8sNode: true
45+
46+
{% else %}
47+
{}
48+
{% endif %}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
ck8s_cilium:
2+
# policyEnforcementMode: Determine whether an endpoint accepts traffic from a source or not
3+
#
4+
# Has three options:
5+
# - default: endpoints have unrestricted network access until selected by policy
6+
# - always: policy enforcement is enabled on all endpoints even if no rules select specific endpoints.
7+
# - never: All traffic is allowed from any source (on ingress) or destination (on egress)
8+
policyEnforcementMode: default
9+
10+
# policyAuditMode: when true, no network policy is enforced.
11+
#
12+
# This feature helps to validate the impact of host policies before enforcing them.
13+
policyAuditMode: false
14+
15+
# enableNodeSelectability: when true, allows Kubernetes nodes to be selected
16+
# by cidr block selectors in classic NetworkPolicies.
17+
#
18+
# Without this, access to the Kubernets API Server pods might be restricted.
19+
#
20+
# See: https://github.com/cilium/cilium/issues/20550
21+
enableNodeSelectability: true
22+
23+
operator:
24+
unmanagedPodWatcher:
25+
restart: true
26+
monitoring:
27+
enabled: true
28+
installServiceMonitor: false
29+
30+
wireguard:
31+
enabled: true
32+
strictMode: false
33+
34+
hubble:
35+
enabled: true
36+
monitoring:
37+
installServiceMonitor: false
38+
metrics:
39+
- dns
40+
- drop
41+
- tcp
42+
- flow
43+
- icmp
44+
- http
45+
46+
prometheus:
47+
enabled: true
48+
installServiceMonitor: false
49+
50+
envoy:
51+
enabled: false

kubespray

Submodule kubespray updated 35 files

0 commit comments

Comments
 (0)