Cilium
Required knowledge for the CKS certification.
Cilium is an advanced networking, security, and observability platform for Kubernetes that leverages eBPF (Extended Berkeley Packet Filter) to provide high-performance networking, transparent encryption, network policies, and deep visibility into traffic flows.
It replaces traditional kube-proxy, CNI plugins, and service meshes with a modern, programmable data plane that integrates tightly with Kubernetes.
Usage
1. Install Cilium
Use the Cilium CLI to install it into your cluster:
cilium install
Check Cilium status:
cilium status
2. Define Network Policies with Cilium
Example: Allow only frontend pods to access the backend.
apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy
metadata:
name: allow-frontend
spec:
endpointSelector:
matchLabels:
app: backend
ingress:
- fromEndpoints:
- matchLabels:
app: frontend
Apply the policy:
kubectl apply -f allow-frontend.yaml
3. Enable Transparent Encryption
Enable encryption between nodes using WireGuard or IPsec:
cilium config set enable-ipsec true
Or using Helm:
helm upgrade cilium cilium/cilium --set encryption.enabled=true