Cilium can be installed either via theThis documentation will outline installing Cilium CNI v1.18.0 on Talos in six different ways. Adhering to Talos principles we’ll deploy Cilium with IPAM mode set to Kubernetes, and using theciliumcli or usinghelm.
cgroupv2 and bpffs mount that talos already provides.
As Talos does not allow loading kernel modules by Kubernetes workloads, SYS_MODULE capability needs to be dropped from the Cilium default set of values, this override can be seen in the helm/cilium cli install commands.
Each method can either install Cilium using kube proxy (default) or without: Kubernetes Without kube-proxy.
In this guide we assume that KubePrism is enabled and configured to use the port 7445.
Machine configuration preparation
When generating the machine config for a node set the CNI to none. For example using a config patch:- With kube-proxy
- Without kube-proxy
Installation using Omni
If you are using Omni, you can deploy Cilium using the manifest sync feature in a cluster template. Step 1. Create avalues.yaml file with the Cilium Helm values:
file field:
If deploying without kube-proxy, also disable it in the patches:
Installation using Cilium CLI
Note: It is recommended to template the cilium manifest using helm and use it as part of Talos machine config, but if you want to install Cilium using the Cilium CLI, you can follow the steps below.Install the Cilium CLI following the steps here.
- With kube-proxy
- Without kube-proxy
- Without kube-proxy + Gateway API
Installation using Helm
Refer to Installing with Helm for more information. First we’ll need to add the helm repo for Cilium.- Helm install
- Helm manifests install
- Helm manifests hosted install
- Helm manifests inline install
After applying the machine config and bootstrapping Talos will appear to hang on phase 18/19 with the message: retrying error: node not ready.
This happens because nodes in Kubernetes are only marked as ready once the CNI is up.
As there is no CNI defined, the boot process is pending and will reboot the node to retry after 10 minutes, this is expected behavior.During this window you can install Cilium manually by running the following:Or if you want to deploy Cilium without kube-proxy, also set some extra parameters:And with GatewayAPI support:After Cilium is installed the boot process should continue and complete successfully.
Known issues
- There are some gotchas when using Talos and Cilium on the Google cloud platform when using internal load balancers. For more details: GCP ILB support / support scope local routes to be configured
-
When using Talos
forwardKubeDNSToHost=trueoption (which is enabled by default) in combination with ciliumbpf.masquerade=true. There is a known issue that causesCoreDNSto not work correctly. As a workaround, configuringforwardKubeDNSToHost=falseresolves the issue. For more details see the discussion here
Other things to know
-
After installing Cilium,
cilium connectivity testmight hang and/or fail with errors similar toError creating: pods "client-69748f45d8-9b9jg" is forbidden: violates PodSecurity "baseline:latest": non-default capabilities (container "client" must not include "NET_RAW" in securityContext.capabilities.add)This is expected, you can workaround it by adding thepod-security.kubernetes.io/enforce=privilegedlabel on the namespace level. - Talos has full kernel module support for eBPF, See: