Kubernetes with an external openstack load balancer not working

11/18/2016

Following is my setup

  • Kubernetes cluser with a master node and worker node. (IP -
    192.168.55.40/41)

    • kubectl version - v1.4.5
    • Both nodes running coreos
  • Devstack single node setup on Ubuntu 14.04 (IP - 192.168.55.60)

    stack@vagrant-ubuntu-trusty-64:~/devstack$ neutron --version 6.0.0

I am trying to use openstack's loadbalancer to load balance a service running in the k8s cluster. I have made the following changes.

  • Added the following lines to kubernetes-apiserver.service and
    kubernetes-controller-manager.service

    --cloud_config=/etc/sysconfig/kube_openstack_config

    --cloud_provider=openstack

  • Following are the contents of /etc/sysconfig/kube_openstack_config

    [Global] auth-url=http://192.168.55.60/identity_admin username=admin password=password tenant-name=admin region=regionOne

  • Restarted kubernetes-apiserver.service

Now when I create a service with type - Loadbalancer, service gets created, but no change in Openstack side.

I had checked the logs on the system with journalctl and it showed an error regarding the cloud_config file.

plugins.go:80] Couldn't open cloud provider configuration /home/core/kube_openstack_config

The file exists and read permission is given for all users. Any idea on what could be wrong?

-- Pradeep
kubernetes
openstack

1 Answer

11/20/2016

Details on how to configure Kubernetes with Openstack Neutron are given here:

http://docs.openstack.org/developer/magnum/dev/kubernetes-load-balancer.html

My first question would be what version of Neutron are you running? The load balancing feature is only now evolving in more recent versions of Openstack, which would explain difficulties in setting it up.

Personally, I would favour the new Ingress feature in Kubernetes for configuring load balancers. This gives much more control over which load balancer is used and how it is configured. For example the simplest setup I have encountered is to use the Traefik ingress controller

https://docs.traefik.io/user-guide/kubernetes/

Runs as a simple Pod on the cluster.

-- Mark O'Connor
Source: StackOverflow