Use Kong to reverse proxy to an external backend?

I see how to use Kong as an API Gateway in front of services that live inside the same Kubernetes cluster. But what if my API lives elsewhere? How can I point to an external url?

I’ve been playing around with Kong 2.0 for Kubernetes on GKE, and have the demo working, but I’m not sure how to modify the Ingress Spec to point to an external backend.

echo "
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: demo
spec:
  rules:
  - http:
      paths:
      - path: /foo
        backend:
          serviceName: echo
          servicePort: 80
" | kubectl apply -f -

You are looking for ExternalName k8s services:
https://kubernetes.io/docs/concepts/services-networking/service/#externalname


© 2019 Kong Inc.    Terms  •  Privacy  •  FAQ