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

@hbagdi

how about when you have a URL instead of a hostname. Kongs does not accept this URL as path . i h ave also tried an encoded but no luck .

/XISOAPAdapter/MessageServlet?senderParty=&testingBC_xyz&receiverParty=&receiverService=&interface=SI_xyz_Sync_OB&interfaceNamespace=http://xxxx/yyyy