1

Is there any way to assign static IP to Kubernetes cluster, in which any user can able to access its application over static IP only.

for an example, I have set up a cluster over 192.168.0.131 (master), 192.168.0.132(worker1) and 192.168.0.133(worker 2). One dotnet application is running on nodeport 32000, which is accessible over all the cluster as expected.

Now I have to assign one IP which communicate to this cluster and user can get access on that. Also is there any way that we can use this IP for other applications as well which can be differentiate based on different ports not nodeport.

FYI, I am using kubernetes cluster over bare metal.

3

1 Answer 1

0

To reuse single IP for multiple projects, as long as we're talking HTTP, I suggest you use Ingress and deploy IngressController like nginx-ingess, traefik or similar. That way any http traffic will be served over single http IP / port using vhosts managed by IngressController.

The problem remains to expose a NodePort based service over a single IP. For an on prem, I'd probably run something like HA Proxy on a known IP (maybe master node) and use it to direct traffic to nodePort service of ingress controller or configure some loadbalancer/router you have in your network to do so. Alternatively you could run ingress directly on master node with nodePort or hostNetwork: true

1
  • it is very helpful for me, if you share any link of it. because I have tried that one still somehow I am not getting success on it. Aug 27, 2021 at 11:15

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.