متقدم
البحث فيأدلة التثبيت
طريقة البحث
  • الصق رسالة الخطأ بين علامتي تنصيص، مثل "permission denied"، لتجد جدول الحل.
  • اختر مجالًا وجزءًا من الدليل (التثبيت، أول الإعدادات، الاستخدام اليومي، الأمان، الحلول) لتصل مباشرة إلى الخطوة الصحيحة.
  • "كلمتان" تجد العبارة بالضبط.
  • الكلمات العادية تجد الأسماء والنصوص والأمثلة.
  • ↑ ↓ للتنقل · Enter للفتح · Esc للإغلاق · / للبحث
جرّب:

الدليل 56ingress-nginx · Kubernetes

ingress-nginx (retired) and the move to Gateway API

For years ingress-nginx was the most used way to bring HTTP traffic into Kubernetes. In November 2025 the Kubernetes project announced its retirement: maintenance ended in March 2026, so there are no new releases and no security fixes any more. Many clusters still run it, so you must know how it works — but new clusters should use the Gateway API. This guide explains both: how to run and secure an existing ingress-nginx, and how to install a Gateway API controller (Envoy Gateway), write Gateways and HTTPRoutes, and migrate.

  • 10 الدروس
  • 6 الأوامر

هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.

$ مستخدم عادي# بصلاحية root (أو مع sudo)

56.1

Know it before you install

An Ingress object says "host + path → Service"; an ingress controller (like ingress-nginx) makes it work. The Gateway API is the newer standard with clear roles: a GatewayClass (which controller), a Gateway (listeners: ports, hostnames, TLS — owned by the platform team) and HTTPRoutes (routes — owned by app teams).

Itemingress-nginxGateway API (Envoy Gateway)
StatusRetired (no fixes since March 2026)Active standard (Kubernetes SIG Network)
InstallHelm chart ingress-nginxHelm chart oci://docker.io/envoyproxy/gateway-helm
ObjectsIngress + many annotationsGatewayClass, Gateway, HTTPRoute, GRPCRoute …
Namespaceingress-nginxenvoy-gateway-system
Other controllers—NGINX Gateway Fabric, Traefik, Cilium, Istio, Kong, HAProxy

56.2

Existing clusters: run ingress-nginx safely

If a cluster still uses ingress-nginx, keep it on the last release, plan the migration, and reduce risk:

helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
helm search repo ingress-nginx/ingress-nginx --versions | head -3
helm upgrade --install ingress-nginx ingress-nginx/ingress-nginx --namespace ingress-nginx --create-namespace --version LAST_VERSION
kubectl -n ingress-nginx get pods,svc
kubectl get ingressclass

انتبه

Use the last chart version and read its notes. In 2025 a critical bug in the admission webhook ("IngressNightmare", CVE-2025-1974) allowed code execution in the controller — keep the admission webhook reachable only from the API server, and limit who may create Ingress objects. With no more security fixes, every new CVE stays open: migrate.

A typical Ingress with TLS from cert-manager:

ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: shop
  namespace: shop
  annotations:
    cert-manager.io/cluster-issuer: letsencrypt-prod
    nginx.ingress.kubernetes.io/proxy-body-size: "20m"
spec:
  ingressClassName: nginx
  tls:
    - hosts: [shop.example.com]
      secretName: shop-tls
  rules:
    - host: shop.example.com
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service: { name: shop, port: { number: 80 } }

Also: turn off risky features you do not use (allow-snippet-annotations: "false" in the controller ConfigMap), and inventory which annotations your Ingresses use — they decide how hard the migration is.

56.3

New clusters: install a Gateway API controller

Envoy Gateway installs the Gateway API CRDs and its controller in one chart (pin the version from its releases):

helm install eg oci://docker.io/envoyproxy/gateway-helm --version v1.5.4 -n envoy-gateway-system --create-namespace
kubectl -n envoy-gateway-system rollout status deploy/envoy-gateway
kubectl get crd | grep gateway.networking.k8s.io

56.4

First configuration: GatewayClass, Gateway and HTTPRoute

The platform team owns the class and the Gateway (ports, hostnames, TLS):

gateway.yaml
apiVersion: gateway.networking.k8s.io/v1
kind: GatewayClass
metadata:
  name: eg
spec:
  controllerName: gateway.envoyproxy.io/gatewayclass-controller
---
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: public
  namespace: gateway
  annotations:
    cert-manager.io/cluster-issuer: letsencrypt-prod
spec:
  gatewayClassName: eg
  listeners:
    - name: http
      protocol: HTTP
      port: 80
      allowedRoutes:
        namespaces: { from: All }
    - name: https
      protocol: HTTPS
      port: 443
      hostname: "*.example.com"
      tls:
        mode: Terminate
        certificateRefs:
          - name: wildcard-example-tls
      allowedRoutes:
        namespaces:
          from: Selector
          selector:
            matchLabels: { gateway-access: "true" }

App teams own their routes, in their own namespace:

httproute.yaml
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: shop
  namespace: shop
spec:
  parentRefs:
    - name: public
      namespace: gateway
      sectionName: https
  hostnames: ["shop.example.com"]
  rules:
    - matches:
        - path: { type: PathPrefix, value: /api }
      backendRefs:
        - name: shop-api
          port: 8080
    - backendRefs:
        - name: shop-web
          port: 80
kubectl create namespace gateway
kubectl label namespace shop gateway-access=true
kubectl apply -f gateway.yaml -f httproute.yaml
kubectl -n gateway get gateway public
NAME     CLASS   ADDRESS        PROGRAMMED
public   eg      203.0.113.40   True
kubectl -n shop get httproute shop -o jsonpath='{.status.parents[0].conditions[*].type}'
PartWhy
allowedRoutes with a namespace selectorOnly labelled namespaces may attach routes to the public HTTPS listener.
TLS on the GatewayOne place for certificates (cert-manager with Gateway API support turned on: config.enableGatewayAPI=true).
HTTPRoute in the app namespaceTeams change their routes without touching the shared Gateway.
Weighted backendRefsCanary releases without annotations (weight: 90 / weight: 10).

An HTTP → HTTPS redirect is one more HTTPRoute on the http listener with a RequestRedirect filter (scheme: https, statusCode: 301).

الأوامر في هذا الدرس

56.5

Migrate from Ingress to Gateway API

  1. Inventory: kubectl get ingress -A -o yaml — list hosts, TLS secrets and every nginx.ingress.kubernetes.io/* annotation.
  2. Convert: the ingress2gateway tool writes Gateway API YAML from your Ingresses:
go install github.com/kubernetes-sigs/ingress2gateway@latest
ingress2gateway print --providers=ingress-nginx --all-namespaces > converted.yaml
  1. Review the output (annotations without a Gateway API match need filters or policies of your controller).
  2. Run both side by side: the new Gateway gets its own IP; test with curl --resolve shop.example.com:443:NEW_IP https://shop.example.com/.
  3. Move DNS host by host; watch errors; then delete the Ingresses and finally ingress-nginx.

56.6

Daily use: the commands and the real uses

kubectl get gatewayclass,gateway -A
kubectl get httproute -A
kubectl -n shop describe httproute shop
kubectl -n envoy-gateway-system logs deploy/envoy-gateway --tail 50
kubectl get ingress -A
kubectl -n ingress-nginx logs deploy/ingress-nginx-controller --tail 50

Real uses at work:

  • One public entry for all apps, with TLS, redirects, path routing and canaries.
  • Clear ownership: platform team (Gateway) vs. app teams (Routes).
  • Planning and running the ingress-nginx → Gateway API migration in 2026 clusters.

الأوامر في هذا الدرس

56.7

Make it safe

Security checklist:

  • Do not start new work on ingress-nginx; plan its removal (no security fixes).
  • Until then: last release, admission webhook only reachable from the API server, snippet annotations off, RBAC on who can create Ingresses.
  • Gateway listeners: limit allowedRoutes to labelled namespaces; HTTPS only with HSTS.
  • Keep the Gateway controller updated; pin chart versions.
  • Rate limits and auth with the controller's policies (for example Envoy Gateway SecurityPolicy, BackendTrafficPolicy).

56.8

Update and remove

helm upgrade eg oci://docker.io/envoyproxy/gateway-helm --version v1.5.5 -n envoy-gateway-system
helm uninstall ingress-nginx -n ingress-nginx
kubectl delete namespace ingress-nginx

Remove ingress-nginx only after all hosts are moved and no Ingress with ingressClassName: nginx is left.

56.9

Fix common problems

ProblemCauseFix
Gateway PROGRAMMED is FalseNo address (no LoadBalancer in the cluster) or bad listener.kubectl describe gateway; on bare metal use MetalLB or a NodePort service.
HTTPRoute Accepted: False (NotAllowedByListeners)The namespace is not allowed by allowedRoutes.Label the namespace, or fix sectionName/hostnames.
HTTPRoute ResolvedRefs: FalseBackend Service name/port wrong, or another namespace without a ReferenceGrant.Fix the Service; add a ReferenceGrant for cross-namespace backends.
404 from ingress-nginxNo rule for the host, or wrong ingressClassName.kubectl get ingress -A; check host and class.
ingress-nginx 413 / timeoutsSize and timeout annotations.proxy-body-size, proxy-read-timeout annotations (and plan the Gateway equivalent).
Certificate missing on the Gatewaycert-manager Gateway API support is off.Enable it in cert-manager (config.enableGatewayAPI=true) and check the Certificate.

الأوامر في هذا الدرس

56.10

Next steps

1Why should a new cluster not use ingress-nginx?

It is retired: since March 2026 there are no releases and no security fixes.

2In the Gateway API, which object does the app team own, and which the platform team?

App teams own HTTPRoutes; the platform team owns the GatewayClass and the Gateway.

كل الأوامر في هذا الفصل