kube-vip/kube-vip-cloud-provider

Configmap seems hardcoded with the kube-system namespace

gigi206 opened this issue · 4 comments

If I create the configmap in the namespace where I have installed kube-vip-cloud-provider, the configuration is not detected:

I0720 21:17:33.111202       1 event.go:291] "Event occurred" object="default/kubernetes" kind="Service" apiVersion="v1" type="Normal" reason="EnsuringLoadBalancer" message="Ensuring load balancer"
I0720 21:17:33.111178       1 loadBalancer.go:79] syncing service 'kubernetes' (ec4af361-dfc0-42c3-836a-c5b4c5e2ec9b)
I0720 21:17:33.111326       1 event.go:291] "Event occurred" object="default/kubernetes" kind="Service" apiVersion="v1" type="Warning" reason="UnAvailableLoadBalancer" message="There are no available nodes for LoadBalancer"
I0720 21:17:33.122677       1 loadBalancer.go:169] no cidr config for namespace [default] exists in key [cidr-default] configmap [kubevip]
I0720 21:17:33.122689       1 loadBalancer.go:172] no global cidr config exists [cidr-global]
I0720 21:17:33.122692       1 loadBalancer.go:186] no range config for namespace [default] exists in key [range-default] configmap [kubevip]
I0720 21:17:33.122694       1 loadBalancer.go:189] no global range config exists [range-global]
E0720 21:17:33.122706       1 controller.go:275] error processing service default/kubernetes (will retry): failed to ensure load balancer: no address pools could be found
I0720 21:17:33.122730       1 event.go:291] "Event occurred" object="default/kubernetes" kind="Service" apiVersion="v1" type="Warning" reason="SyncLoadBalancerFailed" message="Error syncing load balancer: failed to ensure load balancer: no address pools could be found"

It works only if I created in the kube-system namespace

Can you get the configmap you created in, which ever namespace?

it is hardcoded line 87 in loadBalancer.go

it is hardcoded line 87 in loadBalancer.go

Thank you @JinxCappa ;)

Is it possible to add a variable for the configmap in the namespace where the chart is installed?

np, well just kinda looking over the code, line 47 of provider.go seems to pull the namespace from an env var KUBEVIP_NAMESPACE so if that is defined then GetConfigMap should use that otherwise default to kube-system