Add DNS entry to local /etc/hosts for traffic redirect to PKS Ingress controller Add DNS entry to local /etc/hosts for traffic redirect to PKS Ingress controller kubernetes kubernetes

Add DNS entry to local /etc/hosts for traffic redirect to PKS Ingress controller


The IP which you have to add to /etc/hosts is not the IP of the Kubernetes-Cluster, it must be the External-IP of the Ingress-Service.

And the port and targetPort of the Ingress-Service must be also correct (in your case port to 80 and targetPort to the one on which your Ingress Service listens).


Use curl with the --resolve flag, example;

host=test.domain.comadr=<your-external-or-loadbalancer-ip-for-the-nginx-service>curl -D - --resolv $host:80:$adr http://$host/

Or with https;

curl -D - --resolv $host:443:$adr --insecure https://$host/