Show the effective nginx config

Print the full live nginx.conf with all server blocks the controller really generated

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

tool
ingress-nginx7 commands
tags
ingress-nginxdebugtroubleshootingk8s

More ingress-nginx commands

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

    Current active connections and reading/writing/waiting counters from stub_status

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

    Find backend timeouts and requests the client dropped. Note: 499 means the client closed the connection before upstream replied

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

    Send 20% of traffic to a canary ingress. You need a main ingress on the same host and path

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

    Limit requests per second per client IP and raise the upload limit. Burst is 5x rps by default

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

    Strip a path prefix with a regex capture. The path must use (/|$)(.*) so that $2 works

all 7 ingress-nginx commands