Without any setting, a packet leaving a Pod for the outside carries the address of the node where the Pod runs, and that address changes as soon as the Pod is rescheduled. The Cilium egress gateway fixes this: a CiliumEgressGatewayPolicy designates Pods and a destination, and the matching traffic leaves through a chosen node, with the address of that node. This lesson enables the feature on Cilium 1.20.5, writes the policy, proves the exit with the log of a server outside the cluster and reads the BPF table that applies it. It also shows the activation trap: an incomplete helm upgrade seems to succeed, then the Cilium agents crash. It is aimed at readers who already administer a Cilium cluster and have to get through a firewall that filters on the source address.
What you will learn
- Say why outgoing traffic sometimes has to leave from a fixed address, and read the address the destination sees without a policy.
- Enable the egress gateway with
egressGateway.enabled=trueandbpf.masquerade=true, and recognize the failure whenbpf.masqueradeis missing, withkubectl logs --previous. - Label an exit node and write a
CiliumEgressGatewayPolicy: selected Pods, destination, node, interface. - Prove with the log of a witness server outside the cluster that the selected Pod leaves through the gateway, and that a non-selected Pod on the same node does not change.
- Read
cilium-dbg bpf egress liston the Pod's node and on the gateway. - Say what happens when no node matches, and what the limits of the feature are.
Prerequisites
- The lesson Install Cilium without kube-proxy and choose your IPAM, which installs the cluster used in this lesson: Cilium 1.20.5 deployed with Helm,
kubeProxyReplacement=true. - The lesson Pod Networking, to know how a Pod gets its address.
- Know what a source address translation (masquerade) is: the guide NAT: SNAT, DNAT and port forwarding (in French) explains it.
sshaccess to the nodes withsudoforhelm, akubectlthat administers the cluster, and a machine outside the cluster that the nodes can reach, to run a witness server on.- The demonstration environment: three Ubuntu 24.04 VMs (
net-cp,net-w1,net-w2, addresses10.10.50.14,10.10.50.15and10.10.50.16), Kubernetes 1.37.2, containerd 2.2.1 and Cilium invxlantunnel mode. The witness server runs on the workstation, at10.10.50.1:8090. - The outputs were captured on 17 November 2026 with Cilium 1.20.4, except the
Cilium:line ofcilium status, captured with 1.20.5 on 18 November 2026. The commands in this lesson install 1.20.5. The lab, validated with 1.20.5, gave the same result: the witness seessortie-controleearrive fromnet-w2.labandautrefromnet-w1.lab.
These addresses belong to the demonstration. On your side, replace them like this:
| In the lesson | What to use on your side |
|---|---|
10.10.50.15 | the address of the node where the selected Pod runs (kubectl get nodes -o wide, INTERNAL-IP column) |
10.10.50.16, node net-w2.lab | the address and name of the node you pick as the exit |
10.10.50.1:8090 | the address and port of your witness server, outside the cluster |
enp1s0 | the network card of the exit node through which the traffic leaves (ip -br link lists them) |
Why send traffic out through a fixed address?
An external service often filters its clients by source address: a corporate firewall, a managed database with an allow list, a partner's API. That list expects a few known addresses. A Pod, however, has no stable address as seen from the outside. When its traffic leaves the cluster (this is called egress, the exit), the node rewrites the packet's source address and puts its own: this is masquerade. The external service therefore sees the node's address, and sees a different one as soon as the Pod moves to another node.
There are two answers. You can allow every node of the cluster, which opens far more than necessary. Or you can send the wanted traffic out through one node with a fixed address, the exit node, or gateway. That is what the egress gateway does. It filters nothing: to limit what a Pod can reach, you write a NetworkPolicy. It only chooses where the traffic leaves the cluster.
How do you prepare the witness server and the two Pods?
To prove which address leaves the cluster, you need a machine that reads it. The witness server fits in a few lines of Python: it answers with the source address it sees and writes it to a log. It runs on a machine outside the cluster (the demonstration workstation), bound to the address the nodes can reach. You start it with python3 temoin.py temoin-journal.txt, and 10.10.50.1 is to be replaced with your address. The script of the demonstration is written in French and kept as is, because the lab checks its output: source vue par la destination means "source seen by the destination", chemin means "path", and journal means "log".
import datetimeimport http.serverimport sys
JOURNAL = sys.argv[1]
class Temoin(http.server.BaseHTTPRequestHandler): def do_GET(self): source = self.client_address[0] ligne = f"{datetime.datetime.now().isoformat(timespec='seconds')} source={source} chemin={self.path}\n" with open(JOURNAL, "a", encoding="utf-8") as f: f.write(ligne) corps = f"source vue par la destination : {source}\n".encode() self.send_response(200) self.send_header("Content-Length", str(len(corps))) self.end_headers() self.wfile.write(corps)
def log_message(self, *args): pass
http.server.ThreadingHTTPServer(("10.10.50.1", 8090), Temoin).serve_forever()The path of each request (/vise, /non-vise, meaning "selected" and "not selected") serves as a label in the log: that way you can tell which command produced which line.
On the cluster side, you need two Pods on the same node, each with a different app label. The nodeName field places them on net-w1.lab. Replace it with one of your workers:
apiVersion: v1kind: Podmetadata: name: sortie-controlee namespace: egress-demo labels: app: sortie-controleespec: nodeName: net-w1.lab containers: - name: c image: busybox:1.37@sha256:a7dbc319b1438115a207e11930dc4bb3e643dcb3ec0bdd694bb36cd8fad289ec command: ["sleep", "3600"]---apiVersion: v1kind: Podmetadata: name: autre namespace: egress-demo labels: app: autrespec: nodeName: net-w1.lab containers: - name: c image: busybox:1.37@sha256:a7dbc319b1438115a207e11930dc4bb3e643dcb3ec0bdd694bb36cd8fad289ec command: ["sleep", "3600"]Create the namespace, apply the two Pods (file pods.yaml), then read their addresses:
kubectl create namespace egress-demokubectl apply -f pods.yamlkubectl -n egress-demo wait --for=condition=Ready pod --all --timeout=120skubectl -n egress-demo get pods -o widenamespace/egress-demo createdpod/sortie-controlee createdpod/autre createdpod/autre condition metpod/sortie-controlee condition metNAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATESautre 1/1 Running 0 1s 10.244.1.29 net-w1.lab <none> <none>sortie-controlee 1/1 Running 0 1s 10.244.1.115 net-w1.lab <none> <none>Here is what the destination sees before any policy. Send a request from sortie-controlee:
kubectl -n egress-demo exec sortie-controlee -- wget -qO- -T 5 http://10.10.50.1:8090/sans-politiquesource vue par la destination : 10.10.50.15The server sees 10.10.50.15, the address of net-w1, not that of the Pod (10.244.1.115). This is the starting state: you want to change it for only one of the two Pods.
Which Cilium settings enable the gateway?
The egress gateway needs three settings. Cilium must replace kube-proxy (kubeProxyReplacement=true), the gateway must be enabled (egressGateway.enabled=true), and masquerade must be done by BPF (bpf.masquerade=true) instead of iptables. BPF is the Linux kernel mechanism through which Cilium processes packets; by default, masquerade still goes through iptables.
A fourth point comes from the Cilium 1.20 documentation: the gateway is not compatible with the kvstore identity mode. Cilium must use Kubernetes as its identity store, that is identityAllocationMode set to crd, which is the default for new installations. The check is a read of the ConfigMap, which must display crd. The demonstration did not capture this value:
kubectl -n kube-system get configmap cilium-config -o jsonpath='{.data.identity-allocation-mode}'; echoThe Cilium documentation also declares the gateway incompatible with CiliumEndpointSlice: do not enable it on this cluster.
The starting state of the cluster is read in cilium status. The Masquerading line tells how masquerade is done:
kubectl -n kube-system exec ds/cilium -c cilium-agent -- cilium status | grep -E 'KubeProxyReplacement|Masquerading|Routing|Cilium:'KubeProxyReplacement: True [enp1s0 10.10.50.15 fe80::5054:8bff:fed2:14 (Direct Routing)]Cilium: Ok 1.20.5 (v1.20.5-15012141)Routing: Network: Tunnel [vxlan] Host: LegacyMasquerading: IPTables [IPv4: Enabled, IPv6: Disabled]KubeProxyReplacement: True is already in place, but Masquerading is IPTables. It has to become BPF, and this is the change people forget.
What happens if bpf.masquerade is missing?
The mistake is natural: you enable egressGateway.enabled=true and leave masquerade as it is, in iptables. Helm accepts the command and answers "Upgrade complete", with no warning at all. The output below comes from a test where bpf.masquerade=false is set explicitly. A first test, without this option, gave the same agents in CrashLoopBackOff.
sudo helm --kubeconfig /etc/kubernetes/admin.conf upgrade cilium cilium/cilium \ -n kube-system --version 1.20.5 --reuse-values \ --set egressGateway.enabled=true --set bpf.masquerade=falseRelease "cilium" has been upgraded. Happy Helming!NAME: ciliumLAST DEPLOYED: Tue Nov 17 18:03:12 2026NAMESPACE: kube-systemSTATUS: deployedREVISION: 5DESCRIPTION: Upgrade completeIt is the deployment that fails, not Helm. The rollout (the replacement of the Pods of the old version by those of the new one) does not complete, and the new agents restart in a loop:
kubectl -n kube-system rollout status ds/cilium --timeout=90skubectl -n kube-system get pods -l k8s-app=cilium -o wideWaiting for daemon set "cilium" rollout to finish: 2 out of 3 new pods have been updated...error: timed out waiting for the conditionNAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATEScilium-5rxzk 0/1 CrashLoopBackOff 3 (36s ago) 90s 10.10.50.14 net-cp.lab <none> <none>cilium-l984p 1/1 Running 0 2m53s 10.10.50.15 net-w1.lab <none> <none>cilium-wlj9k 0/1 CrashLoopBackOff 3 (42s ago) 90s 10.10.50.16 net-w2.lab <none> <none>Kubernetes replaced the agents of net-cp and net-w2, and both new ones crash. It has not touched the one on net-w1, the old agent, still healthy. Only that node keeps a running agent.
To read the cause, you need the log of the crashing Pod, and of the previous container (--previous), since the current container has just restarted:
kubectl -n kube-system logs cilium-wlj9k -c cilium-agent --previous --tail=60 | grep -iE 'level=(error|fatal)'time=2026-11-17T18:03:59.673089683Z level=error msg="Invoke failed" error="egress gateway requires --enable-ipv4-masquerade=\"true\" and --enable-bpf-masquerade=\"true\"" function="cmd.configureAPIServer (cmd/cells.go:399)"time=2026-11-17T18:04:01.674214372Z level=fatal msg="unable to run agent: failed to start: failed to populate object graph: egress gateway requires --enable-ipv4-masquerade=\"true\" and --enable-bpf-masquerade=\"true\"" subsys=daemonThe message names two options, --enable-ipv4-masquerade and --enable-bpf-masquerade. IPv4 masquerade was already active, as Masquerading: IPTables [IPv4: Enabled showed. The one that is missing is BPF masquerade, set by bpf.masquerade.
A trap lies in wait when reading: kubectl logs ds/cilium reads a single Pod, sometimes the old healthy agent, and then shows no error. You have to name the Pod that crashes.
Which command enables the gateway correctly?
Ask for both settings in the same command. It also repairs the broken state: run on the failing cluster, it restored it without deleting anything.
sudo helm --kubeconfig /etc/kubernetes/admin.conf upgrade cilium cilium/cilium \ -n kube-system --version 1.20.5 --reuse-values \ --set egressGateway.enabled=true --set bpf.masquerade=truekubectl -n kube-system rollout status ds/cilium --timeout=300sRelease "cilium" has been upgraded. Happy Helming!NAME: ciliumLAST DEPLOYED: Tue Nov 17 18:04:45 2026NAMESPACE: kube-systemSTATUS: deployedREVISION: 6DESCRIPTION: Upgrade completeWaiting for daemon set "cilium" rollout to finish: 1 of 3 updated pods are available...Waiting for daemon set "cilium" rollout to finish: 2 of 3 updated pods are available...daemon set "cilium" successfully rolled outThe Cilium documentation asks you to restart the operator too (the cilium-operator Deployment, the Cilium component that works at the scale of the cluster rather than node by node) after enabling the feature. Restart it once the rollout of the agents is done:
kubectl -n kube-system rollout restart deploy/cilium-operatorkubectl -n kube-system rollout status deploy/cilium-operator --timeout=180sThen check that masquerade has switched to BPF and that the resource definition of the policy exists:
kubectl -n kube-system exec ds/cilium -c cilium-agent -- cilium status | grep -E 'Masquerading|KubeProxyReplacement'kubectl get crd ciliumegressgatewaypolicies.cilium.ioKubeProxyReplacement: True [enp1s0 10.10.50.14 fe80::5054:8bff:fed2:13 (Direct Routing)]Masquerading: BPF [enp1s0] 10.244.2.0/24 [IPv4: Enabled, IPv6: Disabled]NAME SCOPE VERSIONS CREATED ATciliumegressgatewaypolicies.cilium.io Cluster v2(storage) 2026-11-17T17:58:38ZMasquerading is now BPF, and the ciliumegressgatewaypolicies.cilium.io definition exists, in version v2. It is not attached to a namespace: an egress policy is a cluster resource. Its presence alone does not prove that the gateway is active: Helm leaves it in place if you disable the feature (see the troubleshooting section). The cilium-config ConfigMap also carries the feature: in 1.20.5, its key is enable-egress-gateway (kubectl -n kube-system get configmap cilium-config -o jsonpath='{.data.enable-egress-gateway}' reads it; the value was not captured here).
Enabling the feature changes nothing as long as no policy exists. The Pod that will be selected still leaves with the address of its node:
kubectl -n egress-demo exec sortie-controlee -- wget -qO- -T 5 http://10.10.50.1:8090/bpf-masquerade-sans-politiquesource vue par la destination : 10.10.50.15How do you designate the exit node and write the policy?
You need two things: a node designated by a label, and a CiliumEgressGatewayPolicy that says which Pods leave through this node. The label name is free. Here, egress-gateway=true goes on net-w2.lab, the node whose address the destination will see:
kubectl label node net-w2.lab egress-gateway=true --overwritenode/net-w2.lab labeledThe policy targets the Pods by label, the destination by address, and the node by its label. Here is the one from the demonstration:
apiVersion: cilium.io/v2kind: CiliumEgressGatewayPolicymetadata: name: sortie-par-net-w2spec: selectors: - podSelector: matchLabels: app: sortie-controlee io.kubernetes.pod.namespace: egress-demo destinationCIDRs: - 10.10.50.1/32 egressGateway: nodeSelector: matchLabels: egress-gateway: "true" interface: enp1s0Each field has a role:
selectorslists the Pods concerned.podSelector.matchLabelscombines the Pod label (app: sortie-controlee) and the namespace, designated by the special labelio.kubernetes.pod.namespace. Without the latter, a Pod with the same label in another namespace would be selected too. To select every Pod of a namespace, you keep only this namespace label; the Cilium documentation allows it, but this lesson did not test it.destinationCIDRslimits the policy to the listed destinations, here a single machine (/32). The rest of the Pod's traffic leaves normally.egressGateway.nodeSelectordesignates the exit node by its labels. If several nodes match, the Cilium documentation states that the first one in the alphabetical order of their names is kept: a single node serves as the gateway for the policy. TheegressGatewaysfield, a list, spreads the Pods across several gateways, but each Pod goes through only one: it is not a failover in case of failure. The demonstration did not test it. The text"true"is quoted: a label is always a string.egressGateway.interfacenames the network card of the exit node through which the traffic leaves,enp1s0on the demonstration VMs. On your nodes, it may have another name. This field is optional: withoutinterfaceoregressIP, Cilium takes the interface of the default route and its first IPv4 address. TheegressIPandinterfaceproperties cannot be given together: the documentation says the policy is then ignored.
Apply the policy, then list it:
kubectl apply -f politique.yamlkubectl get ciliumegressgatewaypoliciesciliumegressgatewaypolicy.cilium.io/sortie-par-net-w2 createdNAME AGEsortie-par-net-w2 0sHow do you prove the Pod leaves through the gateway?
The proof is taken on the destination side: you look at the address the witness server receives, not at what the Pod believes it sends. The diagram shows the situation. Follow the two paths that start from net-w1. The thick line is that of the selected Pod: Cilium sends it to the gateway node, which makes it leave with its own address. The dotted line is that of the non-selected Pod, which leaves as before, with the address of its node.
Send a request from each Pod, with a different path to find them in the log:
kubectl -n egress-demo exec sortie-controlee -- wget -qO- -T 5 http://10.10.50.1:8090/visekubectl -n egress-demo exec autre -- wget -qO- -T 5 http://10.10.50.1:8090/non-visesource vue par la destination : 10.10.50.16source vue par la destination : 10.10.50.15The selected Pod arrives with 10.10.50.16, the address of net-w2, the gateway. The autre Pod, on the same node net-w1 but without the selected label, still arrives with 10.10.50.15. The policy therefore applies Pod by Pod, not node by node. The witness log confirms both lines, with their paths:
2026-11-17T19:02:11 source=10.10.50.16 chemin=/vise2026-11-17T19:02:12 source=10.10.50.15 chemin=/non-viseHow do you read the BPF egress table?
Cilium translates the policy into a BPF table: a data structure that each agent loads into the kernel of its node, and that Cilium's network program consults for every packet. The cilium-dbg bpf egress list command displays it. It runs in the cilium-agent container of the Cilium Pod of a specific node, and the table does not have the same content everywhere. First find the Cilium Pod of each node (its names change at every restart: use those of your cluster):
kubectl -n kube-system get pods -l k8s-app=cilium --field-selector spec.nodeName=net-w1.lab -o nameIn the demonstration, the Cilium Pod of net-w1 is called cilium-l984p, and that of the net-w2 gateway is called cilium-kxkp8. The latter had another name, cilium-wlj9k, in the section on the masquerade trap: the tables below were captured at another time. On the selected Pod's node, the table is:
kubectl -n kube-system exec pod/cilium-l984p -c cilium-agent -- cilium-dbg bpf egress listSource IP Destination CIDR Egress IP Gateway IP Egress Ifindex10.244.1.115 10.10.50.1/32 0.0.0.0 10.10.50.16 0On the gateway, the table is:
kubectl -n kube-system exec pod/cilium-kxkp8 -c cilium-agent -- cilium-dbg bpf egress listSource IP Destination CIDR Egress IP Gateway IP Egress Ifindex10.244.1.115 10.10.50.1/32 10.10.50.16 10.10.50.16 2Here are the columns, one by one:
Source IPis the address of the selected Pod (10.244.1.115), not that of the node. TheautrePod does not appear: no rule concerns it.Destination CIDRrepeatsdestinationCIDRsfrom the policy.Gateway IPis the address of the exit node, the same everywhere (10.10.50.16).Egress IPandEgress Ifindexare only filled in on the gateway: the source address to write (10.10.50.16) and the number of the exit interface. On the Pod's node, they are0.0.0.0and0: that node only knows whom to send the traffic to.
Do not take Egress IP at 0.0.0.0 for a failure: the Cilium documentation shows the same value on every agent except the gateway's. To diagnose, look at the Gateway IP column, which must carry the address of the exit node.
What happens when no node matches?
If the label of the exit node disappears, the policy finds no gateway anymore. The selected traffic is not sent back out by the Pod's node: it is dropped. You trigger this by removing the label (the trailing dash deletes it):
kubectl label node net-w2.lab egress-gateway-kubectl -n egress-demo exec sortie-controlee -- wget -qO- -T 5 http://10.10.50.1:8090/passerelle-retireekubectl -n egress-demo exec autre -- wget -qO- -T 5 http://10.10.50.1:8090/non-vise-2node/net-w2.lab unlabeledwget: download timed outcommand terminated with exit code 1source vue par la destination : 10.10.50.15The selected Pod no longer gets an answer (the -T 5 delay expires), while the autre Pod still answers. The witness log holds no line for /passerelle-retiree: the packet never arrived, not even with the address of net-w1. The Cilium documentation says the same thing: without a matching node, the traffic is dropped. This behavior prevents a Pod from leaving through an unauthorized address, at the price of an outage.
You put the label back, and the exit resumes without touching the policy:
kubectl label node net-w2.lab egress-gateway=true --overwritekubectl -n egress-demo exec sortie-controlee -- wget -qO- -T 5 http://10.10.50.1:8090/passerelle-revenuenode/net-w2.lab labeledsource vue par la destination : 10.10.50.16The Cilium documentation also states that changing the exit node cuts the connections in progress: avoid moving the gateway during a transfer.
What are the limits of the egress gateway?
It does not combine with everything. These limits come from the Cilium 1.20 documentation; the demonstration did not test them.
- The feature is incompatible with ClusterMesh, the interconnection of several Cilium clusters. The exit node must be in the same cluster as the Pod.
- CiliumEndpointSlice and the kvstore identity mode, already mentioned in the settings, are also incompatible.
- The gateway of a policy is a single point of passage: one node serves, and changing that node cuts the connections in progress. The documentation describes no automatic failover if that node goes down; the test in this lesson only shows that the selected traffic is dropped when no node matches.
- With Istio in ambient mode, the gateway requires
bpf.masquerade=true, and the Istio 1.32 documentation says that ambient mode does not support it (the Pods' health probes break). This is why the training runs Istio on a separate cluster: see the lesson Gateway API over HTTPS with cert-manager and the one on Cilium. - The Cilium documentation gives no maturity level for the feature, neither stable nor beta: do not assume one.
Troubleshooting
Start with kubectl -n kube-system get pods -l k8s-app=cilium: if an agent is in CrashLoopBackOff, read its previous log before anything else.
| Symptom | Likely cause | Solution |
|---|---|---|
helm upgrade answers "Upgrade complete", but rollout status ds/cilium times out and cilium-… Pods are in CrashLoopBackOff | egressGateway.enabled=true enabled without bpf.masquerade=true | Read kubectl -n kube-system logs <pod> -c cilium-agent --previous: the message cites --enable-bpf-masquerade. Rerun the helm upgrade with --set egressGateway.enabled=true --set bpf.masquerade=true |
kubectl logs ds/cilium shows no error while agents crash | The command reads a single Pod, sometimes the old agent that is still healthy | Name the Pod that crashes (STATUS column of get pods) and add --previous |
| The selected Pod still leaves with the address of its node | The policy does not select it: Pod label, namespace (io.kubernetes.pod.namespace) or destination outside destinationCIDRs. Case not tested in the lab | kubectl get pod --show-labels, compare with selectors, then read cilium-dbg bpf egress list: the Pod's address must appear in it |
| The selected Pod gets no answer at all (timeout) and nothing appears in the witness log | No node carries the label of nodeSelector: the traffic is dropped | kubectl get nodes --show-labels, then kubectl label node <node> egress-gateway=true |
kubectl get crd ciliumegressgatewaypolicies.cilium.io answers NotFound | The feature is not enabled, or the rollout is not finished | Check Masquerading: BPF in cilium status, wait for the rollout, then restart the operator. The converse is false: the definition being present does not prove the gateway is active, because disabling egressGateway.enabled through Helm does not remove it (the operator creates it on activation and does not remove it, a finding from the lab) |
| The destination sees an address that is neither that of the Pod's node nor that of the expected gateway | The card named in interface is not the one on the wanted network. Case not tested in the lab | ip -br link on the gateway, fix interface in the policy |
Put it into practice
The guided lab starts from a three-node Cilium cluster without kube-proxy and a witness server placed outside the cluster, which answers with the source address it sees. You must enable the egress gateway with the BPF masquerade it requires, designate net-w2.lab as the exit node, and write a CiliumEgressGatewayPolicy that selects only the sortie-controlee Pod of the egress-demo namespace. The validation checks the Cilium configuration and the policy, then compares two Pods: the witness must see sortie-controlee arrive from net-w2.lab and autre, on the same node, still arrive from net-w1.lab.
Outside the lab, redo the walkthrough from start to finish on a three-node Cilium cluster, with your own witness server. You have succeeded when these four checks hold:
cilium statusdisplaysMasquerading: BPF, and theciliumegressgatewaypolicies.cilium.iodefinition exists.- The witness log shows the address of the exit node for the selected Pod, and the address of its own node for a non-selected Pod placed on the same node.
cilium-dbg bpf egress listdisplays the address of the selected Pod and theGateway IPof the gateway, on the Pod's node as well as on the gateway.- Once the label is removed from the exit node, the request of the selected Pod times out and the log holds no line for it. Once the label is put back, the exit resumes.
When you have finished, clean up: the policy, the test namespace and the node label. The egressGateway.enabled and bpf.masquerade settings stay active in Cilium, and the ciliumegressgatewaypolicies.cilium.io definition stays listed by kubectl get crd. Also stop the witness server.
kubectl delete ciliumegressgatewaypolicy sortie-par-net-w2kubectl delete namespace egress-demokubectl label node net-w2.lab egress-gateway-The module's challenge, to do alone and without hints, has its own page: Repair and audit the Cilium network.
Key points
- Without a policy, the destination sees the address of the Pod's node, which changes when the Pod changes node.
- The Cilium egress gateway requires
kubeProxyReplacement=true,egressGateway.enabled=trueandbpf.masquerade=true; the documentation adds identities incrdmode (identity-allocation-modeincilium-config). helm upgrade --reuse-values --set egressGateway.enabled=truewithoutbpf.masquerade=trueends with "Upgrade complete", then the agents crash: the message is read withkubectl logs <pod> -c cilium-agent --previous. You check the activation withMasquerading: BPFincilium status, and theciliumegressgatewaypolicies.cilium.iodefinition must exist. On its own it proves nothing: Helm leaves it in place when you disable the feature.- A
CiliumEgressGatewayPolicy(cilium.io/v2, no namespace) designates the Pods (podSelectorand namespace), the destination (destinationCIDRs) and the exit node (nodeSelector, andinterface, optional). - The proof is taken on the destination side: the selected Pod arrives with the gateway address, a non-selected Pod on the same node keeps that of its node.
cilium-dbg bpf egress listshows the selected Pod and the gateway everywhere, butEgress IPandEgress Ifindexare only filled in on the gateway.- Without a matching node, the selected traffic is dropped (timeout, nothing in the witness log), then it resumes when the label comes back.
- A single node serves as the gateway per policy (the first by alphabetical order of names if several match): it is a single point of passage, with no documented failover. The feature is incompatible with ClusterMesh and with Istio ambient mode.
Knowledge check
The questions cover the address the destination sees, the activation failure without bpf.masquerade, how the policy is written and how to read the BPF table.
Knowledge check
Check what you have learned with this interactive quiz
How it works
- The timer starts when you click Start
- Multiple choice, true/false and short answer questions
- You can move between questions
- Detailed results are shown at the end
Starts the quiz and the timer
Review
(0/0)Result saved on this device. It will be sent to your account at the next sync. Sync now
Score by domain
A domain groups several guides and gets several questions, so its score is more reliable than a per-topic score, which often rests on a single question.
Summary
Strengths
No topic passed at 80% on at least two questions yet.
Weak areas
No topic below the pass mark.
Recommended next
Hints before you try again?
Continue the course: Repair and audit the Cilium network
A new full quiz with random questions
Work again only on the questions you missed