Exploring the Kubernetes Gateway API with Istio
The Kubernetes Gateway API leverages ingress controllers to deploy and manage gateways using a unified API. Essentially, the Gateway API can turn Istio into an ingress controller, providing a simple interface to deploy and manage multiple Istio gateways.
Prerequisites
- ArgoCD
- Kubectl
Clone the Project
Clone the project:
git clone https://github.com/jonathanelbailey/homelab.catalog.git
cd homelab.catalog/istio-k8s-gateway-api/
Deploy Kuberentes Gateway API CRDs
This Application
manifest will conifigure ArgoCD to deploy the Gateway API CRDs:
deploy the Application
manifest using kubectl
:
In ArgoCD the CRDs should sync successfully.
Deploy Istio Components
Deploy istio-base
and istiod
:
kubectl apply -f applications/istio-base/istio-base-1-16-5.yaml
kubectl apply -f applications/istiod/istiod-1-16-5.yaml
What about Istio Gateway?
If you are wondering why an Istio gateway was not deployed, it is because the Kubernetes Gateway API uses istiod
as an ingress-controller. An Istio gateway will spawn as soon as ArgoCD applies a Gateway
resource.
Deploy Bookinfo
Bookinfo's Application
manifest has some interesting configurations to note:
ArgoCD provides powerful flexibility with the use of multiple sources. We can now use the original bookinfo manifest straight from Istio, and then we can replace Bookinfo's gateway manifest with our own. Now deploy bookinfo
:
Validate Bookinfo-Gateway
Access https://bookinfo.internal.magiccityit.com/productpage
from your browser. A 404 response is returned. However, when attempting to access http://bookinfo.internal.magiccityit.com/productpage
, Product Page appears, albeit on an insecure connection. Even though the Gateway
has port 443 configured, and includes the correct TLS configuration, Istio cannot natively access secrets from another namespace. To remedy this, we will add a ReferenceGrant
to a namespace that does have the required certificate:
services/bookinfo/referencegrant.yaml | |
---|---|
Once we add this manifest to services/bookinfo/referencegrant.yaml
and push to the project's remote repository, ArgoCD will automatically pick up the change. If we try again, we will receive a sucessful response.
Add a Second Gateway
Now that we have Product Page accessible, let's deploy a second microservice using Jaeger's Hot Rod demo app:
ArgoCD will deploy the Hot Rod app as well as its own Istio gateway. Validate this by accessing https://hotrod.internal.magiccityit.com
: