How to resolve Failed to start service controller: WARNING: no cloud provider provided

12/29/2018

Background:

$ kubectl get services -n ingress-nginx  
NAME            TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)                      AGE   
ingress-nginx   LoadBalancer   10.108.245.210   <pending>     80:30742/TCP,443:31028/TCP   41m     

$ kubectl cluster-info dump | grep LoadBalancer  
 14:35:47.072444 1 core.go:76] Failed to start service controller: WARNING: no cloud provider provided, services of type LoadBalancer will fail

k8s cluster is up and running fine. -

$ ls /etc/kubernetes/manifests  
etcd.yaml  kube-apiserver.yaml  kube-controller-manager.yaml  kube-scheduler.yaml  

~$ kubectl get services --all-namespaces
NAMESPACE       NAME                   TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)                      AGE
default         kubernetes             ClusterIP      10.96.0.1       <none>        443/TCP                      21h
ingress-nginx   default-http-backend   ClusterIP      10.100.2.163    <none>        80/TCP                       21h
ingress-nginx   ingress-nginx          LoadBalancer   10.108.221.18   <pending>     80:32010/TCP,443:31271/TCP   18h
kube-system     kube-dns               ClusterIP      10.96.0.10      <none>        53/UDP,53/TCP                21h

How do I link the cloud provider to kubernetes cluster in the existing setup?

-- tanmoy
amazon-web-services
cloud
kubernetes

1 Answer

12/30/2018

I would expect grep -r cloud-provider= /etc/kubernetes/manifests to either show you where the flag is being explicitly set to --cloud-provider= (that is, the empty value), or let you know that there is no such flag, in which case you'll need(?) to add them in three places:

I said "need(?)" because I thought that I read one upon a time that the kubernetes components were good enough at auto-detecting their cloud environment, and thus those flags were only required if you needed to improve or alter the default behavior. However, I just checked the v1.13 page and there doesn't seem to be any "optional" about it. They've even gone so far as to now make --cloud-config= seemingly mandatory, too

-- mdaniel
Source: StackOverflow