Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion bin/apply.bash
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ if [ -z "${CK8S_KUBESPRAY_NO_VENV+x}" ]; then
fi

log_info "Running kubespray"
ansible-playbook -i "${config[inventory_file]}" cluster.yml -b "${@}"
ansible-playbook \
-i "${config[inventory_file]}" \
-i "${here}/../config/cilium-values-inventory.yaml" \
cluster.yml -b "${@}"

log_info "Kubespray done"

Expand Down
48 changes: 48 additions & 0 deletions config/cilium-values-inventory.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
all:
vars:
cilium_extra_values: "{{ cilium_extra_values_template | from_yaml }}"
cilium_extra_values_template: |
{% if ck8s_cilium | default(false) %}
policyEnforcementMode: {{ ck8s_cilium.policyEnforcementMode }}

policyAuditMode: {{ ck8s_cilium.policyAuditMode }}

operator:
unmanagedPodWatcher:
restart: {{ ck8s_cilium.operator.unmanagedPodWatcher.restart }}
prometheus:
enabled: {{ ck8s_cilium.operator.monitoring.enabled }}
serviceMonitor:
enabled: {{ ck8s_cilium.operator.monitoring.installServiceMonitor }}

encryption:
enabled: {{ ck8s_cilium.wireguard.enabled }}
type: wireguard
strictMode:
enabled: {{ ck8s_cilium.wireguard.strictMode }}

hubble:
enabled: {{ ck8s_cilium.hubble.enabled }}
metrics:
enabled: {{ ck8s_cilium.hubble.metrics }}
serviceMonitor:
enabled: {{ ck8s_cilium.hubble.monitoring.installServiceMonitor }}

prometheus:
enabled: {{ ck8s_cilium.prometheus.enabled }}
serviceMonitor:
enabled: {{ ck8s_cilium.prometheus.installServiceMonitor }}
trustCRDsExist: true

envoy:
enabled: {{ ck8s_cilium.envoy.enabled }}

{% if ck8s_cilium.enableNodeSelectability | default(false) %}
policyCIDRMatchMode: nodes
{% endif %}

annotateK8sNode: true

{% else %}
{}
{% endif %}
51 changes: 51 additions & 0 deletions config/common/group_vars/k8s_cluster/ck8s-cilium.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
ck8s_cilium:
# policyEnforcementMode: Determine whether an endpoint accepts traffic from a source or not
#
# Has three options:
# - default: endpoints have unrestricted network access until selected by policy
# - always: policy enforcement is enabled on all endpoints even if no rules select specific endpoints.
# - never: All traffic is allowed from any source (on ingress) or destination (on egress)
policyEnforcementMode: default

# policyAuditMode: when true, no network policy is enforced.
#
# This feature helps to validate the impact of host policies before enforcing them.
policyAuditMode: false

# enableNodeSelectability: when true, allows Kubernetes nodes to be selected
# by cidr block selectors in classic NetworkPolicies.
#
# Without this, access to the Kubernets API Server pods might be restricted.
#
# See: https://github.com/cilium/cilium/issues/20550
enableNodeSelectability: true

operator:
unmanagedPodWatcher:
restart: true
monitoring:
enabled: true
installServiceMonitor: false

wireguard:
enabled: true
strictMode: false

hubble:
enabled: true
monitoring:
installServiceMonitor: false
metrics:
- dns
- drop
- tcp
- flow
- icmp
- http

prometheus:
enabled: true
installServiceMonitor: false

envoy:
enabled: false
2 changes: 1 addition & 1 deletion kubespray
Submodule kubespray updated 35 files
+1 −1 docs/CNI/cilium.md
+4 −0 inventory/sample/group_vars/k8s_cluster/k8s-net-cilium.yml
+4 −0 roles/kubernetes/kubeadm/tasks/main.yml
+60 −0 roles/kubespray-defaults/defaults/main/checksums.yml
+3 −2 roles/kubespray-defaults/defaults/main/download.yml
+58 −44 roles/network_plugin/cilium/defaults/main.yml
+14 −23 roles/network_plugin/cilium/tasks/apply.yml
+1 −1 roles/network_plugin/cilium/tasks/check.yml
+13 −49 roles/network_plugin/cilium/tasks/install.yml
+5 −0 roles/network_plugin/cilium/tasks/main.yml
+45 −0 roles/network_plugin/cilium/tasks/remove_old_resources.yml
+0 −193 roles/network_plugin/cilium/templates/cilium-operator/cr.yml.j2
+0 −13 roles/network_plugin/cilium/templates/cilium-operator/crb.yml.j2
+0 −170 roles/network_plugin/cilium/templates/cilium-operator/deploy.yml.j2
+0 −6 roles/network_plugin/cilium/templates/cilium-operator/sa.yml.j2
+0 −295 roles/network_plugin/cilium/templates/cilium/config.yml.j2
+0 −168 roles/network_plugin/cilium/templates/cilium/cr.yml.j2
+0 −13 roles/network_plugin/cilium/templates/cilium/crb.yml.j2
+0 −446 roles/network_plugin/cilium/templates/cilium/ds.yml.j2
+0 −6 roles/network_plugin/cilium/templates/cilium/sa.yml.j2
+0 −9 roles/network_plugin/cilium/templates/cilium/secret.yml.j2
+0 −71 roles/network_plugin/cilium/templates/hubble/config.yml.j2
+0 −108 roles/network_plugin/cilium/templates/hubble/cr.yml.j2
+0 −46 roles/network_plugin/cilium/templates/hubble/crb.yml.j2
+0 −38 roles/network_plugin/cilium/templates/hubble/cronjob.yml.j2
+0 −199 roles/network_plugin/cilium/templates/hubble/deploy.yml.j2
+0 −34 roles/network_plugin/cilium/templates/hubble/job.yml.j2
+0 −25 roles/network_plugin/cilium/templates/hubble/sa.yml.j2
+0 −106 roles/network_plugin/cilium/templates/hubble/service.yml.j2
+164 −0 roles/network_plugin/cilium/templates/values.yaml.j2
+3 −1 tests/files/packet_debian12-cilium-svc-proxy.yml
+6 −0 tests/files/packet_debian12-cilium.yml
+2 −0 tests/files/packet_opensuse-docker-cilium.yml
+3 −1 tests/files/packet_rockylinux9-cilium.yml
+2 −0 tests/files/packet_ubuntu20-cilium-sep.yml