create cloud.conf for k8s to refer to use openstack resources

[Global]
username=######
password=######
auth-url=https://10.240.100.xx:5000/v3
tenant-id=d4f4190305a14179855e45433xxxxxx
domain-id=default

[LoadBalancer]
subnet-id=03026f64-c979-4163-9dd9-xxxxxxxxx

Another and more secured option is to use Trustee-id, this way you won’t leak real admin information.

auth-url=$AUTH_URL
user-id=$TRUSTEE_USER_ID
password=$TRUSTEE_PASSWORD
trust-id=$TRUST_ID

save it under master nodes’ /etc/kubernetes/cloud.conf

update /etc/kubernetes/manifests/kube-controller-manager.yaml and /etc/kubernetes/manifests/kube-apiserver.manifest to use cloud.conf

spec/containers/command

- --cloud-provider=openstack

- --cloud-config=/etc/kubernetes/cloud.conf

enable this on kubelet on all nodes under /etc/kubernetes/kubelet.env:

KUBELET_CLOUDPROVIDER="--cloud-provider=openstack --cloud-config=/etc/kubernetes/cloud_config"

then reload process with new settings.

systemctl daemon-reload

systemctl restart kubelet