This walkthrough is based on using Kubernetes as the compute platform. The configuration of workloads running on Universal will be exactly the same from a Kong Mesh point of view, and we will use kumactl YAML notation in all of our examples.
We will use kubectx
and kubens
to navigate between clusters and namespaces. These tools will save you a lot of time!
Let’s go ahead and create a namespace in each zone, label the namespaces so that workloads that land there are part of the Mesh, and deploy our Echo workload and Kubernetes service:
kubectx zone1
kubectl create namespace kong
kubectl label namespace kong kuma.io/sidecar-injection=enabled
kubectl apply -f https://developer.konghq.com/manifests/kic/echo-service.yaml -n kong
kubectx zone2
kubectl create namespace kong
kubectl label namespace kong kuma.io/sidecar-injection=enabled
kubectl apply -f https://developer.konghq.com/manifests/kic/echo-service.yaml -n kong
For each zone, follow the instructions to deploy Kong Operator into each zone.
The Gateway will need to be part of the Mesh, so make sure your Dataplanes are deployed into the kong
namespace that has been marked as being part of the Mesh.
Let’s test that everything in each zone is correctly plumbed together by deploying an HTTPRoute for our zone-based echo service.
echo '
kind: HTTPRoute
apiVersion: gateway.networking.k8s.io/v1
metadata:
name: echo
namespace: kong
spec:
parentRefs:
- group: gateway.networking.k8s.io
kind: Gateway
name: kong
rules:
- matches:
- path:
type: PathPrefix
value: /echo
backendRefs:
- name: echo
port: 1027
' | kubectl apply -f -
Kong Mesh will automatically resolve the Kubernetes echo
service to the Cluster IP address and route traffic through the Mesh dataplanes. We do not have to do anything.
Test the route has been created and programmed by calling the echo
service through the Gateway:
curl http://${GATEWAY_IP}/echo
Welcome, you are connected to node mesh-zone2.
Running on Pod echo-6bf5d86c87-6f6hg.
In namespace kong.
With IP address 10.244.0.36.
This confirms that the service is reachable by the Gateway.