0
votes

I have created K8S cluster with Rancher on DO(DigitalOcean) platform and behind the scene, it creates VPS(Droplet) to build the K8S cluster.

The way, how I have created on Rancher:

enter image description here

and choosed the DO plugin

On DO platform, you have the opportunity the create Load Balancers to add to K8S cluster, as described on https://www.digitalocean.com/docs/kubernetes/how-to/add-load-balancers/.

I have installed NGINX ingress on K8S via helm:

helm install ingress-nginx ingress-nginx/ingress-nginx --namespace nginx --set controller.publishService.enabled=true

and the status of the NGINX controller services shows:

k get service -n nginx                                                                                               
NAME                                 TYPE           CLUSTER-IP     EXTERNAL-IP   PORT(S)                      AGE
ingress-nginx-controller             LoadBalancer   10.43.117.7    <pending>     80:31609/TCP,443:32247/TCP   103s
ingress-nginx-controller-admission   ClusterIP      10.43.55.223   <none>        443/TCP                      103s  

Then I've created a load balancer with the following rules:

enter image description here

Afterwards I received an IP address. Therefore my question is, how to assign the IP to the ingress-nginx-controller?

1
The only thing related to Ingress-Nginx here is the name of the Service - you could have named it asdf and gotten the same result. You may want to edit the question to remove all those references.Alan J Castonguay

1 Answers

1
votes

A Service of type LoadBalancer is a declaration of your desire, and it should cause a DigitalOcean LB to be provisioned. Implementing this desire is the responsibility of a cloud controller: code which subscribes to the list of Services of type LoadBalancer and uses the cloud provider's API to ensure a cloud provider LB is provisioned.

https://github.com/digitalocean/digitalocean-cloud-controller-manager

You shouldn't handcraft the DigitialOcean LB yourself.