1

Is that possible to define an ingress (ingresses.networking.k8s.io) forwarding requests to a concrete static IP-address in a private network?

I have a service that isn't running on a K8S cluster, but it resides in a private network, and all K8S pods have access to this network. There are many auxiliary services in this network, I don't want to deploy these services in a K8S cluster due to certain reasons. And I'd like to have some of these services exposed via ingress-nginx, but at this time I don't see a way to define the backend as a static IP-address.

Is that possible?

Thanks!

  • Hi! So you wan to use an external service as Ingress backend? I need to know if I understand you correctly. – Wytrzymały Wiktor Aug 14 '19 at 11:32
  • Thanks for your interest, @OhHiMark. It's not fully "external", it's an auxiliary service that runs as a "pet" in an internal network. All the pods in the K8S clusters could reach this network and communicate with this service. Of course, I can assign a public IP-address to this service and the pods could reach it via the Internet, but I'd like to avoid assigning a public IP-address and would like to make it reachable via ingress. – Volodymyr Melnyk Aug 14 '19 at 11:41
  • 1
    Could you please see this and let me know if something like that fits you? – Wytrzymały Wiktor Aug 14 '19 at 12:01
  • Yes, absolutely! I forgot about endpoints, I should use them in this scheme. Thank you very much! – Volodymyr Melnyk Aug 14 '19 at 15:02
  • Great! I will post this as an answer in a few moments. Please accept it so the others could also benefit from it. – Wytrzymały Wiktor Aug 16 '19 at 7:21
3

You can use external service as Ingress backend.

You can introduce any external IP address as a Kubernetes service by creating a matching Service and Endpoint object. Then you can use this service as a backend for your Ingress rules.

More details can be found here.

  • Thank you very much, friend, I shouldn't have forgotten about Endpoints! – Volodymyr Melnyk Aug 20 '19 at 12:54
  • Thank you, i have searched far and wide, did not realise you must create a service with external IP, and knew nothing about endpoints! – Vladimir Akopyan Nov 27 '19 at 3:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.