Run example
k apply -f https://raw.githubusercontent.com/antonputra/tutorials/main/lessons/155/3-example/6-gateway.yaml
How to access istio gateway from localhost?
Tried
export INGRESS_HOST=$(kubectl get gateway api -o jsonpath='{.status.addresses[0].value}')
export INGRESS_PORT=$(kubectl get gateway api -o jsonpath='{.spec.listeners[?(@.name=="http")].port}')
curl -s -I -HHost:app.devopsbyexample.com "http://$INGRESS_HOST:$INGRESS_PORT"
However INGRESS_HOST is empty as
kubectl get gateway api -o jsonpath='{.status.addresses[0].value}'
empty as well
To access an Istio Gateway from your localhost using curl, you need to set
INGRESS_HOSTandINGRESS_PORTvariables.The environment variables you have set doesnt contain the
<gateway name>. Try adding the gateway name and set the variables.Replace the with the name of your Istio gateway. These commands retrieve the external IP or domain address and the port number assigned to the Istio Gateway and set them as the values of the
INGRESS_HOSTandINGRESS_PORTvariables respectively.Now you can access the Istio Gateway using curl.
Make sure app.devopsbyexample.com is the desired hostname or the domain that matches the routing rules defined in your Istio Gateway configuration.
By setting these variables and using curl, you can access the Istio Gateway from your local host.