Cilium can serve the Gateway and HTTPRoute objects of the Gateway API itself: you install their CRDs, enable gatewayAPI.enabled=true, then give the Gateway an address with a CiliumLoadBalancerIPPool. This lesson walks through that path on Cilium 1.20.5, serves an application over HTTP then HTTPS, and sets a CiliumNetworkPolicy that only allows GET on one path. It shows the trap of this combination: the policy cuts off the Gateway's own traffic until you allow the ingress entity. It is aimed at readers who already administer a Cilium cluster without kube-proxy and want to avoid a second entry component.
What you will learn
- Say what changes when Cilium serves the Gateway API instead of another controller.
- Install the Gateway API CRDs, enable
gatewayAPI.enabled=trueand restart the Cilium operator. - Explain why a Gateway stays in
Programmed=False(AddressNotAssigned), and give it an address. - Serve an application over HTTP, then over HTTPS with a
Terminatelistener. - Write a
CiliumNetworkPolicythat filters the HTTP method and path, and tell an L7 denial from a network denial. - Allow the Gateway's traffic with
fromEntities: [ingress], read the denials with Hubble, then remove the feature in the right order.
Prerequisites
- The lesson Install Cilium without kube-proxy and choose your IPAM, which installs this lesson's cluster with Helm and
kubeProxyReplacement=true. - The lesson Kubernetes Gateway API: Gateway, HTTPRoute and route diagnosis, which defines
GatewayClass,Gateway, listener andHTTPRoute. It is not repeated here. - The lesson Gateway API over HTTPS: serving a cert-manager certificate, which explains the certificate of an
HTTPSlistener. Here, the TLS Secret is created by hand, without cert-manager. - The lesson Kubernetes NetworkPolicies: isolating traffic between Pods, to know what a network policy that allows or denies traffic between Pods is.
- The lesson Hubble: observe, measure and audit network flows, which presents Cilium's observation tool. Here, it is only used to read L7 denials.
sshaccess to the nodes withsudoforhelm, akubectlthat administers the cluster, andopensslto make a test certificate.- The demonstration environment: three Ubuntu 24.04 VMs (
net-cp,net-w1,net-w2), Kubernetes 1.37.2 and Cilium 1.20.5 installed with Helm.
The outputs were captured on 18 November 2026 with Cilium 1.20.5. This version does not claim to support Kubernetes 1.37, which the demonstration cluster nevertheless uses. Everything the lesson shows worked, but an unexpected behavior may come from this version gap.
Why have Cilium serve the Gateway API?
A Gateway API needs a controller: a component that reads the Gateway and HTTPRoute objects and configures the entry point. The lesson Kubernetes Gateway API: Gateway, HTTPRoute and route diagnosis uses Traefik, and the lesson Gateway API over HTTPS: serving a cert-manager certificate uses Istio. On a cluster that already has Cilium as its network plugin, Cilium can play this role: the entry point is then served by the same component as the rest of the network.
This changes something that matters for what follows. The traffic that enters through the Gateway is handled by Cilium, so it carries an identity that Cilium's policies know how to read. You can write a rule that talks about the Gateway, and filter at L7 (at the level of the HTTP request: method, path) what reaches the Pod. The sections below show it in order: enable the feature, serve an application, filter.
How do you enable the Gateway API in Cilium?
Enabling it takes three steps, in this order: install the Gateway API CRDs, enable the feature in Cilium, restart the operator. Cilium does not install the CRDs (the definitions of the Gateway, HTTPRoute… objects) itself: without them, it has nothing to serve.
According to the Cilium documentation, the feature also requires two settings on the cluster: kubeProxyReplacement=true and the L7 proxy (l7Proxy=true). The nodes must also provide iptables and its netfilter modules, which redirect the Gateway's traffic to Envoy: without them, connections to the Gateway time out without reaching it. The demonstration cluster already had both settings. cilium status returns KubeProxyReplacement: True, and the cilium-config ConfigMap holds enable-l7-proxy: "true":
kubectl -n kube-system exec ds/cilium -- cilium-dbg status | grep -E '^(Cilium|KubeProxyReplacement):'kubectl -n kube-system get configmap cilium-config -o yaml | grep -iE 'gateway|l7-proxy|enable-envoy'kubectl get crd | grep gateway.networking.k8s.ioKubeProxyReplacement: True [enp1s0 10.10.50.14 fe80::5054:8bff:fed2:13 (Direct Routing)]Cilium: Ok 1.20.5 (v1.20.5-15012141) egress-gateway-reconciliation-trigger-interval: 1s enable-l7-proxy: "true"The third command returns nothing: no Gateway API CRD is installed at the start. You install those of the standard channel in version v1.6.3, the one Cilium 1.20.5 declares, with --server-side:
kubectl apply --server-side -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.6.3/standard-install.yamlcustomresourcedefinition.apiextensions.k8s.io/backendtlspolicies.gateway.networking.k8s.io serverside-appliedcustomresourcedefinition.apiextensions.k8s.io/gatewayclasses.gateway.networking.k8s.io serverside-appliedcustomresourcedefinition.apiextensions.k8s.io/gateways.gateway.networking.k8s.io serverside-appliedcustomresourcedefinition.apiextensions.k8s.io/grpcroutes.gateway.networking.k8s.io serverside-appliedcustomresourcedefinition.apiextensions.k8s.io/httproutes.gateway.networking.k8s.io serverside-appliedcustomresourcedefinition.apiextensions.k8s.io/listenersets.gateway.networking.k8s.io serverside-appliedcustomresourcedefinition.apiextensions.k8s.io/referencegrants.gateway.networking.k8s.io serverside-appliedcustomresourcedefinition.apiextensions.k8s.io/tcproutes.gateway.networking.k8s.io serverside-appliedcustomresourcedefinition.apiextensions.k8s.io/tlsroutes.gateway.networking.k8s.io serverside-appliedcustomresourcedefinition.apiextensions.k8s.io/udproutes.gateway.networking.k8s.io serverside-appliedvalidatingadmissionpolicy.admissionregistration.k8s.io/safe-upgrades.gateway.networking.k8s.io serverside-appliedvalidatingadmissionpolicybinding.admissionregistration.k8s.io/safe-upgrades.gateway.networking.k8s.io serverside-appliedThis file does not only bring CRDs: the last two lines are a ValidatingAdmissionPolicy named safe-upgrades.gateway.networking.k8s.io and its binding. kubectl delete -f on the same file removes them along with the CRDs. You then list the CRDs. This listing dates from an installation in v1.6.1: its ten names are those of the output above.
kubectl get crd | grep gateway.networking.k8s.iobackendtlspolicies.gateway.networking.k8s.io Namespaced v1(storage) 2026-11-18T04:42:11Zgatewayclasses.gateway.networking.k8s.io Cluster v1(storage),v1beta1 2026-11-18T04:42:11Zgateways.gateway.networking.k8s.io Namespaced v1(storage),v1beta1 2026-11-18T04:42:11Zgrpcroutes.gateway.networking.k8s.io Namespaced v1(storage) 2026-11-18T04:42:11Zhttproutes.gateway.networking.k8s.io Namespaced v1(storage),v1beta1 2026-11-18T04:42:11Zlistenersets.gateway.networking.k8s.io Namespaced v1(storage) 2026-11-18T04:42:11Zreferencegrants.gateway.networking.k8s.io Namespaced v1,v1beta1(storage) 2026-11-18T04:42:11Ztcproutes.gateway.networking.k8s.io Namespaced v1(storage) 2026-11-18T04:42:11Ztlsroutes.gateway.networking.k8s.io Namespaced v1(storage) 2026-11-18T04:42:11Zudproutes.gateway.networking.k8s.io Namespaced v1(storage) 2026-11-18T04:42:11ZCilium requires seven of these CRDs: GatewayClass, Gateway, HTTPRoute, GRPCRoute, BackendTLSPolicy, ReferenceGrant and TLSRoute. The standard-install.yaml file brings all seven, TLSRoute included, and adds three optional CRDs: ListenerSet, TCPRoute and UDPRoute. Without those three, Cilium disables the matching features, and the lesson does not use them.
Cilium 1.20.5 declares Gateway API version v1.6.3, in its documentation and in its go.mod, and that is the one the lab installs. The installation output above was captured in v1.6.3 on 18 November 2026. The other outputs of the lesson were captured with CRDs in v1.6.1; what they show worked.
Next comes the activation in Cilium. You keep the current values (--reuse-values) and add gatewayAPI.enabled=true:
sudo helm --kubeconfig /etc/kubernetes/admin.conf upgrade cilium cilium/cilium \ -n kube-system --version 1.20.5 --reuse-values \ --set gatewayAPI.enabled=truekubectl -n kube-system rollout status ds/cilium --timeout=300sRelease "cilium" has been upgraded. Happy Helming!NAME: ciliumLAST DEPLOYED: Wed Nov 18 04:42:12 2026NAMESPACE: kube-systemSTATUS: deployedREVISION: 14DESCRIPTION: Upgrade completeTEST SUITE: NoneWaiting for daemon set "cilium" rollout to finish: 2 out of 3 new pods have been updated...Waiting for daemon set "cilium" rollout to finish: 2 out of 3 new pods have been updated...Waiting 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 outOnly the first lines of the Helm output are shown. The Cilium agents are replaced one by one, and rollout status ends when all three are ready. You then restart the operator, the cilium-operator Deployment: it is the one that manages the GatewayClass and the Gateways, and the Cilium documentation asks you to restart it after enabling the feature. The cilium GatewayClass itself comes from the Helm chart: the chart creates it during the helm upgrade when the GatewayClass CRD already exists (setting gatewayAPI.gatewayClass.create, set to auto by default).
kubectl -n kube-system rollout restart deploy/cilium-operatorkubectl -n kube-system rollout status deploy/cilium-operator --timeout=180sdeployment.apps/cilium-operator restartedWaiting for deployment spec update to be observed...Waiting for deployment "cilium-operator" rollout to finish: 0 out of 2 new replicas have been updated...Waiting for deployment "cilium-operator" rollout to finish: 0 out of 2 new replicas have been updated...Waiting for deployment "cilium-operator" rollout to finish: 1 out of 2 new replicas have been updated...Waiting for deployment "cilium-operator" rollout to finish: 1 old replicas are pending termination...Waiting for deployment "cilium-operator" rollout to finish: 1 old replicas are pending termination...Waiting for deployment "cilium-operator" rollout to finish: 1 old replicas are pending termination...Waiting for deployment "cilium-operator" rollout to finish: 1 old replicas are pending termination...deployment "cilium-operator" successfully rolled outWhat is left is to check that the feature is active. Two readings are enough: the enable-gateway-api key of the ConfigMap, and the GatewayClass named cilium, which the Helm chart created and the operator accepted.
kubectl -n kube-system get configmap cilium-config -o yaml | grep -iE 'gateway-api|enable-envoy|l7-proxy'kubectl get gatewayclass -o widekubectl get gatewayclass cilium -o jsonpath='{.status.conditions}'; echo enable-envoy-config: "true" enable-gateway-api: "true" enable-gateway-api-alpn: "false" enable-gateway-api-app-protocol: "false" enable-gateway-api-proxy-protocol: "false" enable-gateway-api-secrets-sync: "true" enable-l7-proxy: "true" gateway-api-hostnetwork-enabled: "false" gateway-api-hostnetwork-nodelabelselector: "" gateway-api-secrets-namespace: cilium-secrets gateway-api-service-externaltrafficpolicy: Cluster gateway-api-use-remote-address: "true" gateway-api-xff-num-trusted-hops: "0"NAME CONTROLLER ACCEPTED AGE DESCRIPTIONcilium io.cilium/gateway-controller True 34s The default Cilium GatewayClass[{"lastTransitionTime":"2026-11-18T04:42:26Z","message":"Valid GatewayClass","observedGeneration":1,"reason":"Accepted","status":"True","type":"Accepted"}]enable-gateway-api: "true" confirms the activation. The cilium GatewayClass is Accepted=True: its controller is io.cilium/gateway-controller, and any Gateway that names it in gatewayClassName will be served by Cilium.
How do you declare a Gateway and a route?
You need an application, a Gateway and an HTTPRoute. The application is an echo server that answers vitrine-par-cilium, behind a Service vitrine on port 80:
kubectl create namespace vitrinekubectl -n vitrine create deployment vitrine --image=hashicorp/http-echo:1.0.0@sha256:fcb75f691c8b0414d670ae570240cbf95502cc18a9ba57e982ecac589760a186 -- /http-echo -text=vitrine-par-cilium -listen=:5678kubectl -n vitrine expose deployment vitrine --port=80 --target-port=5678namespace/vitrine createddeployment.apps/vitrine createdservice/vitrine exposedThe Gateway has a single HTTP listener on port 80. The route designates it in parentRefs, filters on the host name vitrine.formation.test and sends everything to the Service. Notice that nothing in these objects mentions Cilium except gatewayClassName: cilium.
apiVersion: gateway.networking.k8s.io/v1kind: Gatewaymetadata: name: entree namespace: vitrinespec: gatewayClassName: cilium listeners: - name: http protocol: HTTP port: 80---apiVersion: gateway.networking.k8s.io/v1kind: HTTPRoutemetadata: name: vitrine namespace: vitrinespec: parentRefs: - name: entree hostnames: - vitrine.formation.test rules: - backendRefs: - name: vitrine port: 80You apply this file (gw.yaml), then look at the state of the Gateway and of the Service:
kubectl apply -f gw.yamlkubectl -n vitrine get gateway entree -o widekubectl -n vitrine get svc -o widegateway.gateway.networking.k8s.io/entree createdhttproute.gateway.networking.k8s.io/vitrine createdNAME CLASS ADDRESS PROGRAMMED AGEentree cilium False 18sNAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTORcilium-gateway-entree LoadBalancer 10.99.187.142 <pending> 80:30279/TCP 18s <none>vitrine ClusterIP 10.98.22.30 <none> 80/TCP 19s app=vitrineThe Gateway is not programmed: PROGRAMMED is False and ADDRESS is empty. Cilium did create a cilium-gateway-entree Service, of type LoadBalancer, whose EXTERNAL-IP stays <pending>. The next section explains why.
Why does the Gateway stay without an address?
Cilium serves the Gateway behind a Service of type LoadBalancer, and this Service waits for an external address. Outside a cloud, nobody gives it one. The conditions of the Gateway and of its route say so:
kubectl -n vitrine get gateway entree -o jsonpath='{range .status.conditions[*]}{.type}={.status} {.reason}: {.message}{"\n"}{end}'kubectl -n vitrine get httproute vitrine -o jsonpath='{range .status.parents[*].conditions[*]}{.type}={.status} {.reason}{"\n"}{end}'Accepted=True Accepted: Gateway successfully scheduledProgrammed=False AddressNotAssigned: Gateway waiting for addressAccepted=True AcceptedResolvedRefs=True ResolvedRefsThe Gateway is Accepted=True: Cilium took it over. It is Programmed=False with the reason AddressNotAssigned, and the message says it is waiting for an address. The route, for its part, is correct: Accepted and ResolvedRefs are True, so the vitrine Service is found. The only problem is the address.
You provide it with a CiliumLoadBalancerIPPool, a resource that gives Cilium a block of addresses to hand out to LoadBalancer Services (LB-IPAM). The lesson Announce Services to the network with BGP and Cilium details these pools. The block must be a network that yours does not use elsewhere:
apiVersion: cilium.io/v2kind: CiliumLoadBalancerIPPoolmetadata: name: pool-gatewayspec: blocks: - cidr: 172.31.0.0/28kubectl apply -f pool.yamlkubectl -n vitrine get svc -o widekubectl -n vitrine get gateway entree -o widekubectl -n vitrine get gateway entree -o jsonpath='{range .status.conditions[*]}{.type}={.status} {.reason}{"\n"}{end}'ciliumloadbalancerippool.cilium.io/pool-gateway createdNAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTORcilium-gateway-entree LoadBalancer 10.99.187.142 172.31.0.0 80:30279/TCP 35s <none>vitrine ClusterIP 10.98.22.30 <none> 80/TCP 36s app=vitrineNAME CLASS ADDRESS PROGRAMMED AGEentree cilium 172.31.0.0 True 35sAccepted=True AcceptedProgrammed=True ProgrammedWith no other step, the Service received 172.31.0.0 and the Gateway moved to Programmed=True. This address is the first of the 172.31.0.0/28 block. The pool's allowFirstLastIPs field decides whether the first and last addresses of a block can be assigned: the BGP lesson explains it.
A Gateway without an address is therefore not a Cilium failure: it is the absence of an address provider, which the pool supplies. On a cloud, it is the provider's load balancer that plays this role.
How do you serve the application over HTTP, then HTTPS?
Once the address is assigned, you send a request to 172.31.0.0 and give the host name with the Host header. The name vitrine.formation.test exists in no DNS: curl -H is enough to tell the route which name you are asking for.
curl -s -m 5 -H 'Host: vitrine.formation.test' http://172.31.0.0/curl -s -m 5 -o /dev/null -w '%{http_code}\n' -H 'Host: autre.formation.test' http://172.31.0.0/curl -sI -m 5 -H 'Host: vitrine.formation.test' http://172.31.0.0/ | head -8vitrine-par-cilium404HTTP/1.1 200 OKx-app-name: http-echox-app-version: 1.0.0date: Wed, 18 Nov 2026 04:43:26 GMTcontent-length: 19content-type: text/plain; charset=utf-8x-envoy-upstream-service-time: 1server: envoyThe first call returns the application's answer. The second, with another host name, returns 404: no route declares it, and the Gateway answers by itself. With the headers in hand, server: envoy shows that the request went through an Envoy proxy, the one Cilium uses for L7.
For HTTPS, you add a listener in Terminate mode: the Gateway decrypts the TLS connection and speaks in clear text to the application. It reads its certificate from a TLS Secret. For a test, a self-signed certificate, valid for one day, is enough:
openssl req -x509 -newkey rsa:2048 -nodes -days 1 -subj '/CN=vitrine.formation.test' \ -addext 'subjectAltName=DNS:vitrine.formation.test' \ -keyout vitrine.key -out vitrine.crtkubectl -n vitrine create secret tls vitrine-tls --cert=vitrine.crt --key=vitrine.keykubectl -n vitrine patch gateway entree --type=json -p '[{"op":"add","path":"/spec/listeners/-","value":{"name":"https","protocol":"HTTPS","port":443,"hostname":"vitrine.formation.test","tls":{"mode":"Terminate","certificateRefs":[{"name":"vitrine-tls"}]}}}]'secret/vitrine-tls createdgateway.gateway.networking.k8s.io/entree patchedTo check the result, you read the conditions of each listener, then call the Gateway over HTTPS with a curl that only trusts this certificate. --resolve maps the host name to the Gateway's address, which lets curl present the right name in the TLS negotiation.
kubectl -n vitrine get gateway entree -o jsonpath='{range .status.listeners[*]}{.name}: {range .conditions[*]}{.type}={.status} {end}{"\n"}{end}'curl -s -m 5 --cacert vitrine.crt --resolve vitrine.formation.test:443:172.31.0.0 https://vitrine.formation.test/echo | openssl s_client -connect 172.31.0.0:443 -servername vitrine.formation.test 2>/dev/null | openssl x509 -noout -subject -issuerhttp: ResolvedRefs=True Accepted=True Programmed=Truehttps: ResolvedRefs=True Accepted=True Programmed=Truevitrine-par-ciliumsubject=CN = vitrine.formation.testissuer=CN = vitrine.formation.testBoth listeners are Programmed=True, https included: ResolvedRefs=True means Cilium found the vitrine-tls Secret. The HTTPS request returns the application's answer. The subject and the issuer are identical (CN = vitrine.formation.test): the certificate is self-signed, which is expected here. In production, you have cert-manager issue and renew it, as the lesson Gateway API over HTTPS: serving a cert-manager certificate shows for Istio.
On Cilium's side, the Gateway left three objects, which you can list: a CiliumEnvoyConfig that holds the proxy configuration, the cilium-gateway-entree Service (which now exposes ports 80 and 443), and an EndpointSlice of the same name.
kubectl -n vitrine get ciliumenvoyconfig -o namekubectl -n vitrine get svc,endpointslices -o wideciliumenvoyconfig.cilium.io/cilium-gateway-entreeNAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTORservice/cilium-gateway-entree LoadBalancer 10.99.187.142 172.31.0.0 80:30279/TCP,443:30410/TCP 54s <none>service/vitrine ClusterIP 10.98.22.30 <none> 80/TCP 55s app=vitrine
NAME ADDRESSTYPE PORTS ENDPOINTS AGEendpointslice.discovery.k8s.io/cilium-gateway-entree IPv4 9999 192.192.192.192 54sendpointslice.discovery.k8s.io/vitrine-99298 IPv4 5678 10.244.2.49 55sNo proxy Pod appears in the vitrine namespace. The 192.192.192.192 address of the Gateway's EndpointSlice is a dummy address set by Cilium: it is the address of no Pod, and you do not use it.
How do you filter the HTTP method and path with a CiliumNetworkPolicy?
A Kubernetes NetworkPolicy reasons in addresses and ports. A CiliumNetworkPolicy (CNP) can go further: under toPorts, a rules.http block limits the allowed requests to a method and a path. This is L7 filtering. It requires the L7 proxy to be active, which is the case here. The method and the path are regular expressions: the refusal of /admin, further down, shows that path: / only allows the root here.
You start with two clients, client (label app=client) and intrus (app=intrus), which run curl in the same namespace, then you check that before any policy both reach vitrine:
kubectl -n vitrine run client --image=curlimages/curl:8.17.0@sha256:935d9100e9ba842cdb060de42472c7ca90cfe9a7c96e4dacb55e79e560b3ff40 --labels=app=client --restart=Never --command -- sleep 36000kubectl -n vitrine run intrus --image=curlimages/curl:8.17.0@sha256:935d9100e9ba842cdb060de42472c7ca90cfe9a7c96e4dacb55e79e560b3ff40 --labels=app=intrus --restart=Never --command -- sleep 36000kubectl -n vitrine wait --for=condition=Ready pod/client pod/intrus --timeout=120skubectl -n vitrine exec client -- curl -s -m 5 -o /dev/null -w '%{http_code}\n' http://vitrine/kubectl -n vitrine exec intrus -- curl -s -m 5 -o /dev/null -w '%{http_code}\n' http://vitrine/pod/client createdpod/intrus createdpod/client condition metpod/intrus condition met200200Both Pods get 200. The policy below protects the app=vitrine Pods. It only accepts the app=client Pods, on port 5678 (the application's port, not the Service's port 80), and for them only the GET method on the / path:
apiVersion: cilium.io/v2kind: CiliumNetworkPolicymetadata: name: vitrine-get-seulement namespace: vitrinespec: endpointSelector: matchLabels: app: vitrine ingress: - fromEndpoints: - matchLabels: app: client toPorts: - ports: - port: "5678" protocol: TCP rules: http: - method: GET path: /You apply it, then try three requests from client and one from intrus:
kubectl apply -f l7.yamlkubectl -n vitrine exec client -- curl -s -m 5 -w '\n%{http_code}\n' http://vitrine/kubectl -n vitrine exec client -- curl -s -m 5 -w '\n%{http_code}\n' -X POST http://vitrine/kubectl -n vitrine exec client -- curl -s -m 5 -w '\n%{http_code}\n' http://vitrine/adminkubectl -n vitrine exec intrus -- curl -s -m 5 -o /dev/null -w '%{http_code}\n' http://vitrine/ciliumnetworkpolicy.cilium.io/vitrine-get-seulement createdvitrine-par-cilium
200Access denied
403Access denied
403000command terminated with exit code 28There are two kinds of denial, and you need to know how to recognize them. For client, the GET / goes through (200), but the POST / and the GET /admin receive 403 and the text Access denied: the connection is accepted, it is the request that the L7 proxy refuses. For intrus, nothing answers: curl returns 000 and exit code 28 (timeout). No rule allows it, so the connection is cut before any HTTP request.
You can also read the state of the policy. Valid means Cilium understood it, not that it does what you expect:
kubectl -n vitrine get cnp vitrine-get-seulement -o jsonpath='{.status.conditions}'; echo[{"lastTransitionTime":"2026-11-18T04:44:33Z","message":"Policy validation succeeded","status":"True","type":"Valid"}]Why does the L7 policy cut off the Gateway?
Right after the policy, you call the Gateway as before, and it no longer answers:
curl -s -m 5 -o /dev/null -w '%{http_code}\n' -H 'Host: vitrine.formation.test' http://172.31.0.0/000The Gateway is not an app=client Pod. The traffic leaving Cilium's proxy for vitrine carries a reserved identity, reserved:ingress, and the policy does not allow it: its traffic is cut, like that of intrus. You read this identity in Cilium's list:
kubectl -n kube-system exec ds/cilium -- cilium-dbg identity list | grep -E 'reserved:ingress|ID'ID LABELS8 reserved:ingressThe reserved ingress identity has number 8. The policy must therefore allow it, with the fromEntities field: an entity is a name that Cilium gives to a group of reserved identities (here, the entry traffic served by Cilium). You add a second ingress rule to the policy, with the same http rules. This keeps the L7 filtering for the Gateway's traffic:
kubectl -n vitrine patch cnp vitrine-get-seulement --type=json -p '[{"op":"add","path":"/spec/ingress/-","value":{"fromEntities":["ingress"],"toPorts":[{"ports":[{"port":"5678","protocol":"TCP"}],"rules":{"http":[{"method":"GET","path":"/"}]}}]}}]'kubectl -n vitrine get cnp vitrine-get-seulement -o yaml | sed -n '/^spec/,/^status/p'ciliumnetworkpolicy.cilium.io/vitrine-get-seulement patchedspec: endpointSelector: matchLabels: app: vitrine ingress: - fromEndpoints: - matchLabels: app: client toPorts: - ports: - port: "5678" protocol: TCP rules: http: - method: GET path: / - fromEntities: - ingress toPorts: - ports: - port: "5678" protocol: TCP rules: http: - method: GET path: /status:The policy now has two ingress rules: one for the app=client Pods, the other for the ingress entity, with the same GET /. The diagram shows the three paths that reach the Pod. Follow the Gateway's line: it passes the policy thanks to the ingress entity. The client Pod passes thanks to its label, and intrus, with no rule, stays cut off.
You check the four cases: GET and POST through the Gateway, HTTPS, and intrus.
curl -s -m 5 -w '\n%{http_code}\n' -H 'Host: vitrine.formation.test' http://172.31.0.0/curl -s -m 5 -w '\n%{http_code}\n' -X POST -H 'Host: vitrine.formation.test' http://172.31.0.0/curl -s -m 5 --cacert vitrine.crt --resolve vitrine.formation.test:443:172.31.0.0 https://vitrine.formation.test/kubectl -n vitrine exec intrus -- curl -s -m 5 -o /dev/null -w '%{http_code}\n' http://vitrine/vitrine-par-cilium
200Access denied
403vitrine-par-cilium000command terminated with exit code 28The Gateway answers 200 again for GET /, over HTTP as well as HTTPS. A POST through the Gateway receives 403: the L7 rule also applies to the traffic that arrives through it, not only to the Pods of the cluster. intrus is still cut off. The effect of a fromEntities rule without rules.http was not measured.
How do you read L7 denials in Hubble?
Hubble, Cilium's observation tool, displays the HTTP requests seen by the L7 proxy, with their verdict. The lesson Hubble: observe, measure and audit network flows explains the tool and its metrics. What matters here is where you run it. hubble observe run in a Cilium agent only sees the traffic of its node, and ds/cilium picks an agent at random: the command can return an empty list even though the denials exist. You must target the agent of the node of the Pod that receives the requests.
This test was done separately, in an essai-l7 namespace: a serveur Pod on net-w2, protected by a get-seulement policy of the same type as the previous one (GET / only for the app=client Pods), and a relance Pod on net-w1 that sends a POST /commandes then a GET / in a loop. You first find the agent of the server's node:
kubectl -n kube-system get pods -l k8s-app=cilium --field-selector spec.nodeName=net-w2.lab -o nameIn the demonstration, it is cilium-j87gp. The HTTP requests seen by this node:
kubectl -n kube-system exec pod/cilium-j87gp -c cilium-agent -- hubble observe --namespace essai-l7 --protocol http --last 6Nov 18 04:57:04.209: essai-l7/relance:47930 (ID:4317) -> essai-l7/serveur:5678 (ID:11356) http-request FORWARDED (HTTP/1.1 GET http://serveur/)Nov 18 04:57:04.210: essai-l7/relance:47930 (ID:4317) <- essai-l7/serveur:5678 (ID:11356) http-response FORWARDED (HTTP/1.1 200 0ms (GET http://serveur/))Nov 18 04:57:06.216: essai-l7/relance:47946 (ID:4317) -> essai-l7/serveur:5678 (ID:11356) http-request DROPPED (HTTP/1.1 POST http://serveur/commandes)Nov 18 04:57:06.216: essai-l7/relance:47946 (ID:4317) <- essai-l7/serveur:5678 (ID:11356) http-response FORWARDED (HTTP/1.1 403 0ms (POST http://serveur/commandes))Nov 18 04:57:06.221: essai-l7/relance:47950 (ID:4317) -> essai-l7/serveur:5678 (ID:11356) http-request FORWARDED (HTTP/1.1 GET http://serveur/)Nov 18 04:57:06.221: essai-l7/relance:47950 (ID:4317) <- essai-l7/serveur:5678 (ID:11356) http-response FORWARDED (HTTP/1.1 200 0ms (GET http://serveur/))Look at the verdict column. The GET / gives a FORWARDED request then a 200 response. The POST /commandes gives a DROPPED request, followed by a 403 response: the request is refused and the proxy returns the 403 itself. The word FORWARDED on the 403 response therefore does not mean the request went through: only the http-request line carries the policy's verdict. To keep only the denials, you filter on the verdict:
kubectl -n kube-system exec pod/cilium-j87gp -c cilium-agent -- hubble observe --namespace essai-l7 --verdict DROPPED --last 4Nov 18 04:57:00.165: essai-l7/relance:43996 (ID:4317) -> essai-l7/serveur:5678 (ID:11356) http-request DROPPED (HTTP/1.1 POST http://serveur/commandes)Nov 18 04:57:02.186: essai-l7/relance:44020 (ID:4317) -> essai-l7/serveur:5678 (ID:11356) http-request DROPPED (HTTP/1.1 POST http://serveur/commandes)Nov 18 04:57:04.203: essai-l7/relance:47924 (ID:4317) -> essai-l7/serveur:5678 (ID:11356) http-request DROPPED (HTTP/1.1 POST http://serveur/commandes)Nov 18 04:57:06.216: essai-l7/relance:47946 (ID:4317) -> essai-l7/serveur:5678 (ID:11356) http-request DROPPED (HTTP/1.1 POST http://serveur/commandes)You find the refused POST requests, one every two seconds, with the method and the path. Run in the agents of net-w1 (the client's node) and net-cp (unrelated), the same --protocol http command returns nothing: only the agent of the node of the receiving Pod sees these requests. For a view of the whole cluster, you have to go through Hubble Relay, which this lesson did not measure. The hubble command is not installed on the nodes: you run it in the agent.
How do you remove the Gateway API without breaking Helm?
The order of removal matters. If you delete the Gateway API CRDs first while Cilium still expects them, the next helm upgrade fails, because the Helm release contains a GatewayClass and its type no longer exists:
Error: UPGRADE FAILED: unable to build kubernetes objects from current release manifest: resource mapping not found for name: "cilium" namespace: "" from "": no matches for kind "GatewayClass" in version "gateway.networking.k8s.io/v1"ensure CRDs are installed firstThis message was obtained with the CRDs absent, while the release still had the Gateway API enabled. It does not talk about the activation, it only says that the CRDs are missing. The remedy is the order: you first disable the Gateway API in Cilium, then delete the GatewayClass and the CRDs.
helm upgrade cilium cilium/cilium -n kube-system --version 1.20.5 --reuse-values --set gatewayAPI.enabled=falsekubectl delete gatewayclass cilium --ignore-not-foundkubectl delete -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.6.3/standard-install.yaml --ignore-not-foundThe Helm command above was not replayed as is: the cluster was put back to its original values by the lab's cleanup tool. The two kubectl delete commands were run afterwards, in this order, with the v1.6.1 file; the delete of the v1.6.3 file removes the CRDs, the ValidatingAdmissionPolicy and its binding in the same way. You check that the configuration has disappeared and that Helm can still read the release:
kubectl -n kube-system get configmap cilium-config -o yaml | grep -E 'enable-gateway-api|enable-wireguard'kubectl get crd | grep -c gateway.networking.k8s.iohelm upgrade cilium cilium/cilium --version 1.20.5 -n kube-system --reuse-values --dry-run=client > /dev/null && echo 'release lisible par Helm'0release lisible par HelmThe first command returns no line: the enable-gateway-api key has disappeared from the ConfigMap (the search also targets enable-wireguard, which is absent too). The 0 says that no gateway.networking.k8s.io CRD remains, and the Helm dry-run succeeds: the release is readable again.
This removal still leaves three Cilium CRDs, which the search on gateway.networking.k8s.io does not see: ciliumenvoyconfigs.cilium.io, ciliumclusterwideenvoyconfigs.cilium.io and ciliumgatewayclassconfigs.cilium.io. They did not exist at the start of the lab. They are there after it has enabled the Gateway API and applied an L7 policy, and disabling the Gateway API does not remove them (measured by the lab repository on 18 November 2026, Cilium 1.20.5 and Kubernetes 1.37.2). Which of the two steps creates them, and what deleting them changes, was not measured. Only the lab's cleanup tool deletes them, to put the cluster back in its starting state. kubectl get crd | grep -E 'envoyconfigs|gatewayclassconfigs' shows all three.
The objects of the demonstration are removed along with the namespace:
kubectl delete namespace vitrinekubectl delete ciliumloadbalancerippool pool-gatewayTroubleshooting
Start with the Gateway's conditions (kubectl -n <ns> get gateway <name> -o jsonpath='{.status.conditions}'): they say whether Cilium accepted it and whether it has an address.
| Symptom | Likely cause | Solution |
|---|---|---|
kubectl get gatewayclass returns nothing | The Gateway API CRDs are missing, or the operator was not restarted after enabling the feature | kubectl get crd | grep gateway.networking.k8s.io, install the CRDs, then kubectl -n kube-system rollout restart deploy/cilium-operator |
The Gateway stays Programmed=False, reason AddressNotAssigned, and the cilium-gateway-<name> Service is <pending> | No address pool can serve the LoadBalancer Service | Create a CiliumLoadBalancerIPPool with a free block: the address arrives with no other step |
After an L7 CiliumNetworkPolicy, the Gateway no longer answers (curl returns 000, code 28) but the allowed Pods answer | The Gateway's traffic carries the reserved ingress identity, which the policy does not allow | Add a fromEntities: [ingress] rule with the same http rules |
403 and Access denied for a request you thought was allowed | The method or the path is not in rules.http: the denial comes from the L7 proxy, not from the network | Compare the request (curl -v) with the policy's method and path, then read hubble observe --verdict DROPPED on the agent of the receiving Pod |
curl returns 000 (code 28) for a Pod that is in no rule | No fromEndpoints rule allows it: the connection is cut before any HTTP request | Add its label to a rule, or accept this denial if it is intended |
hubble observe --protocol http returns nothing although requests are denied | The command is run in an agent that is not on the node of the receiving Pod | Find the agent with --field-selector spec.nodeName=<node> and run the command inside it |
helm upgrade fails on no matches for kind "GatewayClass" | The Gateway API CRDs were removed before the feature was disabled in Cilium | Reinstall the CRDs, disable gatewayAPI.enabled, then only remove the CRDs |
Put it into practice
The lab starts from a Cilium cluster without kube-proxy, without Gateway API CRDs and without a load balancer, with a fiches application and a lecteur Pod in the catalogue namespace. It has you install the v1.6.3 CRDs and enable the Gateway API in Cilium, then serve fiches.formation.test through a Gateway. You run into AddressNotAssigned and create a CiliumLoadBalancerIPPool to solve it. You then write a policy that allows GET / for lecteur and refuses POST / with a 403, then restore the Gateway with the ingress entity. The validation reads the Gateway's conditions, then sends real requests: GET and POST through the Gateway, and GET and POST from lecteur. It judges the state of the cluster, never the commands typed.
Key points
- Cilium serves the Gateway API after three steps in this order: install the CRDs (standard channel,
--server-side), enablegatewayAPI.enabled=true, restartdeploy/cilium-operator. TheciliumGatewayClassmust beAccepted=True. - Cilium requires
kubeProxyReplacement=trueand the L7 proxy (enable-l7-proxy); both were already active on the demonstration cluster. - A Gateway without an address is
Programmed=False, reasonAddressNotAssigned: aCiliumLoadBalancerIPPoolgives the address to thecilium-gateway-<name>Service, and the Gateway moves toProgrammed=True. - An
HTTPSlistener inTerminatemode reads its certificate from a TLS Secret (certificateRefs); routing by host name returns404for a name that no route declares. - A
CiliumNetworkPolicyfilters the method and the path withtoPorts.rules.http. A refused request returns403 Access denied; an unauthorized client is cut at the network level (000, code 28). - The Gateway's traffic carries the reserved
ingressidentity: an L7 policy that does not allow it cuts off the Gateway. You allow it withfromEntities: [ingress]and the samehttprules, which then also apply to the Gateway's traffic. hubble observeonly sees the node of its agent: to read an L7 denial, target the agent of the receiving Pod's node, with--protocol httpor--verdict DROPPED. The policy's verdict is on thehttp-requestline.- To remove the feature, disable
gatewayAPI.enabledin Cilium before deleting the CRDs, otherwisehelm upgradefails onno matches for kind "GatewayClass".
Knowledge check
Eight questions drawn from twelve: enabling the Gateway API in Cilium, the Gateway's address, the L7 policy, the ingress entity, reading denials in Hubble and removal in the right order. A missed answer points to the section to reread.
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: Expose and protect a service on Cilium
A new full quiz with random questions
Work again only on the questions you missed