Expose a service located outside the Kubernetes cluster using an Ingress.
Read this link https://kubernetes.io/docs/concepts/services-networking/service/#externalname to become more familiar with ExternalName
Service type
In this scenario, We're going to proxy from k8s
to ubuntu.com
kubectl apply -f kong-gateway.yml
kubectl apply -f external-service.yml
kubectl apply -f http-route.yml
Make sure hostname ubuntu-from-k8s.kong
is available in your /etc/hosts
and points to external-ip
of kong-gateway-proxy
service and then open your browser and type http://ubuntu-from-k8s.kong
. You'll see that your request is routed to ubuntu.com
.