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.

  • Hi @Bhargav Lalaji, any progress? – Mikolaj S. Aug 30 '21 at 07:53
  • @MikolajS., check this out ,https://devops.stackexchange.com/questions/14577/how-to-assign-static-ip-to-kubernetes-cluster – Bhargav Lalaji Aug 31 '21 at 07:07
  • Does this answer your question? [What network file sharing protocol has the best performance and reliability?](https://serverfault.com/questions/14577/what-network-file-sharing-protocol-has-the-best-performance-and-reliability) – fswings Sep 02 '21 at 23:17

1 Answers1

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

  • 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. – Bhargav Lalaji Aug 27 '21 at 11:15