Can I get an NGinX ingress controller to proxy external (not in my cloud) resources?

7/24/2020

So, I'm dabbling with setting up a Kubernetes cloud on Azure AKS. I get that an Nginx ingress controller routes requests to services in the same namespace, and I understand that the path can be rewritten. I'm now trying to set up something which is borderline dodgy, but would potentially allow more actual work to be done on each of my nodes.

The scenario is as follows - a part of my cloud is going to be static HTML content. I can add a web-server in a pod and mount an Azure fileshare with the static files in, and that works great with NGingx ingress controller. I have also noticed that I can create a static web site Azure blob, which basically serves my web content cheaply via an ugly Microssoft Url.

What I'm wondering is if can I configure NGinx ingress server to proxy content from a full external website Url instead of a service name from my own Kubernetes namespace and therefore host my static content in my Url space without burning Node memory and Cpu cycles.

As I said, maybe a bit dodgy, but also seamingly simple approach to static content. If anybody knows for certain that this is possible, I'd be keen to learn how. I'd also be very interested in learning that this is absolutely not possible - thanks.

-- Mark Rabjohn
kubernetes
nginx-ingress

1 Answer

7/25/2020

What you want to do is proxying from load balancer(created by Nginx Ingress) to Azure blob?
If my understanding is correct, you maybe can proxy with using a service of type ExternalName.

https://www.elvinefendi.com/2018/08/08/ingress-nginx-proxypass-to-external-upstream.html
https://github.com/kubernetes/ingress-nginx/issues/4280

-- bells17
Source: StackOverflow