diff --git a/Makefile b/Makefile index 188e4a7e2..1b58120a7 100644 --- a/Makefile +++ b/Makefile @@ -285,9 +285,13 @@ local-deploy: ## Deploy Kuadrant Operator in the cluster pointed by KUBECONFIG @echo @echo "Now you can export the kuadrant gateway by doing:" @echo "kubectl port-forward -n istio-system service/istio-ingressgateway-istio 9080:80 &" - @echo "after that, you can curl -H \"Host: myhost.com\" localhost:9080" - @echo "-- Linux only -- Ingress gateway is exported using nodePort service in port 9080" - @echo "curl -H \"Host: myhost.com\" localhost:9080" + @echo "export GATEWAY_URL=localhost:9080" + @echo "after that, you can curl -H \"Host: myhost.com\" $$GATEWAY_URL" + @echo "-- Linux only -- Ingress gateway is exported using loadbalancer service in port 80" + @echo "export INGRESS_HOST=$$(kubectl get gtw istio-ingressgateway -n istio-system -o jsonpath='{.status.addresses[0].value}')" + @echo "export INGRESS_PORT=$$(kubectl get gtw istio-ingressgateway -n istio-system -o jsonpath='{.spec.listeners[?(@.name==\"http\")].port\}')" + @echo "export GATEWAY_URL=$$INGRESS_HOST:$$INGRESS_PORT" + @echo "curl -H \"Host: myhost.com\" $$GATEWAY_URL" @echo .PHONY: local-setup diff --git a/doc/user-guides/authenticated-rl-for-app-developers.md b/doc/user-guides/authenticated-rl-for-app-developers.md index edf4619a3..ec2d3e5db 100644 --- a/doc/user-guides/authenticated-rl-for-app-developers.md +++ b/doc/user-guides/authenticated-rl-for-app-developers.md @@ -101,6 +101,15 @@ curl -H 'Host: api.toystore.com' http://$GATEWAY_URL/toy -i # HTTP/1.1 200 OK ``` +> **Note**: If the command above fails to hit the Toy Store API on your environment, try forwarding requests to the service and accessing over localhost: +> +> ```sh +> kubectl port-forward -n istio-system service/istio-ingressgateway 9080:80 2>&1 >/dev/null & +> export GATEWAY_URL=localhost:9080 +> curl -H 'Host: api.toystore.com' http://$GATEWAY_URL/toys -i +> # HTTP/1.1 200 OK +> ``` + ### ③ Enforce authentication on requests to the Toy Store API Create a Kuadrant `AuthPolicy` to configure the authentication: diff --git a/doc/user-guides/authenticated-rl-with-jwt-and-k8s-authnz.md b/doc/user-guides/authenticated-rl-with-jwt-and-k8s-authnz.md index 6e687ce66..af0ec94ed 100644 --- a/doc/user-guides/authenticated-rl-with-jwt-and-k8s-authnz.md +++ b/doc/user-guides/authenticated-rl-with-jwt-and-k8s-authnz.md @@ -97,6 +97,15 @@ curl -H 'Host: api.toystore.com' http://$GATEWAY_URL/toy -i It should return `200 OK`. +> **Note**: If the command above fails to hit the Toy Store API on your environment, try forwarding requests to the service and accessing over localhost: +> +> ```sh +> kubectl port-forward -n istio-system service/istio-ingressgateway 9080:80 2>&1 >/dev/null & +> export GATEWAY_URL=localhost:9080 +> curl -H 'Host: api.toystore.com' http://$GATEWAY_URL/toys -i +> # HTTP/1.1 200 OK +> ``` + ### ③ Deploy Keycloak Create the namesapce: diff --git a/doc/user-guides/simple-rl-for-app-developers.md b/doc/user-guides/simple-rl-for-app-developers.md index 0f146bc65..a2c77c78d 100644 --- a/doc/user-guides/simple-rl-for-app-developers.md +++ b/doc/user-guides/simple-rl-for-app-developers.md @@ -102,6 +102,15 @@ curl -H 'Host: api.toystore.com' http://$GATEWAY_URL/toys -i # HTTP/1.1 200 OK ``` +> **Note**: If the command above fails to hit the Toy Store API on your environment, try forwarding requests to the service and accessing over localhost: +> +> ```sh +> kubectl port-forward -n istio-system service/istio-ingressgateway 9080:80 2>&1 >/dev/null & +> export GATEWAY_URL=localhost:9080 +> curl -H 'Host: api.toystore.com' http://$GATEWAY_URL/toys -i +> # HTTP/1.1 200 OK +> ``` + ### ③ Enforce rate limiting on requests to the Toy Store API Create a Kuadrant `RateLimitPolicy` to configure rate limiting: