ingress-nginx commands

7 commands, each with a one-line explanation. Click a command to copy it, or its title for details.

Commands 7 shown

  • kubectl exec deploy/ingress-nginx-controller -n ingress-nginx -- nginx -T | less

    Render the full live nginx.conf with all server blocks the controller actually generated

    debug · troubleshooting · k8s

  • kubectl exec deploy/ingress-nginx-controller -n ingress-nginx -- curl -s localhost:10254/nginx_status

    Live active connections, reading/writing/waiting counters from the stub_status endpoint

    monitoring · performance · observability

  • kubectl logs -n ingress-nginx deploy/ingress-nginx-controller --tail=2000 | grep -iE 'upstream timed out|504|499'

    Hunt backend timeouts and client-aborted requests; note: 499 means client closed before upstream replied

    troubleshooting · network · debug

  • kubectl annotate ingress <name> -n <ns> nginx.ingress.kubernetes.io/canary=true nginx.ingress.kubernetes.io/canary-weight="20"

    Route 20% of traffic to a canary ingress; needs a primary ingress on the same host/path

    ci · gitops · network

  • kubectl annotate ingress <name> -n <ns> nginx.ingress.kubernetes.io/limit-rps="10" nginx.ingress.kubernetes.io/proxy-body-size="50m"

    Cap requests-per-second per client IP and raise upload limit; rps burst defaults to 5x

    security · performance · network

  • kubectl annotate ingress <name> -n <ns> nginx.ingress.kubernetes.io/rewrite-target='/$2' nginx.ingress.kubernetes.io/use-regex='true'

    Strip a path prefix via regex capture; path must use (/|$)(.*) for $2 to resolve

    network · troubleshooting

  • kubectl get ingressclass -o custom-columns='NAME:.metadata.name,DEFAULT:.metadata.annotations.ingressclass\.kubernetes\.io/is-default-class'

    Show controllers and which IngressClass is default; only one should be marked default

    k8s · troubleshooting