Troubleshooting Kubernetes Ingress-Nginx

Use the ingress-nginx Kubernetes plugin to troubleshoot the Kubernetes Ingress-Nginx.

Verify the cluster you are connected to

kubectl config current-context

To switch to another cluster

kubectl config use-context docker-for-desktop

Get the address of the cluster

kubectl cluster-info

Get the list of pods

kubectl get pods --all-namespaces

Forward a port to the pod you want to test. The port forwarder will run in the background, press CTRL-C to stop it.

kubectl port-forward MY_POD_NAME MY_HOST_PORT:MY_POD_PORT

To send a request to the pod, keep the port-forwarding running in the terminal, open a browser and navigate to

http://127.0.0.1:MY_HOST_PORT

Verify if the ingress controller pod is running

kubectl get pods --all-namespaces | grep ingress

Check the cluster ingresses in the default namespace

kubectl ingress-nginx ingresses -n default

Get the Nginx ingress configuration

kubectl ingress-nginx conf -n ingress-nginx

Check if the service is accessible from the ingress pod

kubectl ingress-nginx exec -n ingress-nginx -- curl http://127.0.0.1

Leave a comment

Your email address will not be published. Required fields are marked *