I'm new to Kubernetes and their is a concept I'm not sure to fully understand: Cloud Providers.
I manage to have running applications with L7 ingresses and ClusterIP services but everytime I try to have a L4 LoadBalancer, the LoadBalancer is stuck in pending state. According to https://github.com/rancher/rancher/issues/14424 this is because I doesn't have any CloudProvider.
But what is exactly the purpose of a CloudProvider? Isn't it to run Kubernetes nodes, pods, ... on the cloud? If yes, why should I bother getting a CloudProvider if my applications are pods are already on the cloud and accessible from the outside thanks to my configuration.
So my following questions are:
Thanks for any clarification/recommandation on this subject. -
In case of Rancher
An external cloud provider is a kubernetes controller that runs cloud provider-specific loops required for the functioning of kubernetes. These loops were originally a part of the kube-controller-manager, but they were tightly coupling the kube-controller-manager to cloud-provider specific code. In order to free the kubernetes project of this dependency, the cloud-controller-manager was introduced.
This brings us to the topic of Kubernetes Cloud Controller Manager
Kubernetes v1.6 introduced a new binary called cloud-controller-manager. cloud-controller-manager is a daemon that embeds cloud-specific control loops. These cloud-specific control loops were originally in the kube-controller-manager. Since cloud providers develop and release at a different pace compared to the Kubernetes project, abstracting the provider-specific code to the cloud-controller-manager binary allows cloud vendors to evolve independently from the core Kubernetes code.
Regarding the LoadBalancer part:
You need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster.
An API object that manages external access to the services in a cluster, typically HTTP. Ingress can provide load balancing, SSL termination and name-based virtual hosting.
If you want to get a better idea of this concept than check out this SO thread.
And lastly regarding the custom Cloud Provider. It is possible to enable a different cloud provider for RKE:
If you want to enable a different cloud provider, RKE allows for custom cloud provider options. A name must be provided and the custom Cloud Provider options can be passed in as a multiline string in
customCloudProvider
.
I hope it helps.