I want to see all the incoming requests to my istio gateway for debugging reasons. Where do I find it?
I am expecting something like nginx logs.
I am using
spec:
selector:
istio: ingressgateway # use Istio default gateway implementation
Building on the previous answer and its feedback, I've followed a portion of this example application and I've successfully obtained the Ingress
logs for HTTP requests with the following:
ingress_pod=$(kubectl get pods --namespace istio-system -l istio=ingress -o=jsonpath="{.items[0].metadata.name}")
kubectl logs $ingress_pod --namespace istio-system | grep -e '\] "GET'
You can also obtain the "East/West" HTTP traffic by obtaining the logs of the Envoy Sidecar with:
kubectl logs -l app=productpage,version=v1 --container=istio-proxy --namespace=default --tail 10000 | grep -e '\] "GET'
Feel free to modify the HTTP verbs in the grep
commands's expressions along with the labels and namespaces accordingly.
You can get the logs of the istio-ingressgateway pod by running the following command:
$ kubectl -n istio-system logs $(kubectl -n istio-system get pods -listio=ingressgateway -o=jsonpath="{.items[0].metadata.name}") --tail=300
It shows what happens with last 300 incoming requests and possible errors.
More debugging commands can be found in this blog article. I hope it helps.