You are browsing unreleased documentation. See the latest documentation here.
Create a Route
After you’ve installed all of the required components and configured a GatewayClass
you can route some traffic to a service in your Kubernetes cluster.
Configure the echo service
-
In order to route a request using Kong Gateway we need a service running in our cluster. Install an
echo
service using the following command:kubectl apply -f https://docs.konghq.com/assets/kubernetes-ingress-controller/examples/echo-service.yaml
-
Create a
HTTPRoute
to send any requests that start with/echo
to the echo service.echo ' kind: HTTPRoute apiVersion: gateway.networking.k8s.io/v1 metadata: name: echo 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 -
The results should look like this:
httproute.gateway.networking.k8s.io/echo created
Test the configuration
-
To test the configuration, make a call to the
$PROXY_IP
that you configured.curl $PROXY_IP/echo
-
You should see the following:
Welcome, you are connected to node king. Running on Pod echo-965f7cf84-rm7wq. In namespace default. With IP address 192.168.194.10.
Congratulations! You just configured Kong Gateway Operator, Kong Ingress Controller and Kong Gateway using open standards.
Next steps
Now that you have a running DataPlane
configured using Gateway API resources, you can explore the power that Kong Gateway provides:
- Configuring Kong Gateway plugins using Kong Ingress Controller
- Upgrading Kong Gateway Operator managed data planes