Magnum puts subnet-name instead of subnet-id in kube_openstack_config

Bug #1734311 reported by Grzegorz Bialas
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Magnum
Confirmed
Undecided
Unassigned

Bug Description

After creating a kubernetes cluster, config file /etc/kubernetes/kube_openstack_config is created.
This config is used to interact with openstack during creating external loadbalancer.

Config looks like:

[Global]
auth-url=https://xxxxxxxxx.xxxx.xxxx.xxx:5000/v3
ca-file=/etc/kubernetes/ca/openstack.pem
user-id=47ed0eda4ca84d55a139d238330cdc1c
password=j5s5Fh6NF73CfsVR8W
trust-id=cdeac8635a8b4d01a20b3f4a72a2b347
[LoadBalancer]
subnet=magnum-subnet
create-monitor=yes
monitor-delay=1m
monitor-timeout=30s
monitor-max-retries=3

Which results with error, when creating kuberntes service with type: loadbalancer.
Error message which can be found in logs:

Nov 24 10:06:28 mo-xalmqagc5x-0-bdjttiktarxv-kube-master-esbvlau3ldlj.novalocal kube-controller-manager[796]: E1124 10:06:28.073504 796 servicecontroller.go:779] Failed to process service. Retrying in 1m20s: Failed to create load balancer for service default/nginxservice: Error creating loadbalancer af6383a24d0fe11e79e45fa163e60988: Error creating loadbalancer {af6383a24d0fe11e79e45fa163e60988 Kubernetes external service af6383a24d0fe11e79e45fa163e60988 magnum-subnet <nil> }: Invalid request due to incorrect syntax or missing required parameters.

Config should contain subnet-id not subnet name as a value.

Working example:

[Global]
auth-url=https://xxxxxxxxx.xxxx.xxxx.xxx:5000/v3
ca-file=/etc/kubernetes/ca/openstack.pem
user-id=47ed0eda4ca84d55a139d238330cdc1c
password=j5s5Fh6NF73CfsVR8W
trust-id=cdeac8635a8b4d01a20b3f4a72a2b347
[LoadBalancer]
subnet-id=486f644d-5b5c-4fb0-b880-0c98960c6c1c
create-monitor=yes
monitor-delay=1m
monitor-timeout=30s
monitor-max-retries=3

After this change service with external loadbalancer is created properly.

Bartosz Bezak (bbezak)
Changed in magnum:
status: New → Confirmed
Revision history for this message
yatin (yatinkarel) wrote :

How did you install magnum and configured kube_openstack_config. Looking at the code it set's subnet-id only: https://github.com/openstack/magnum/blob/master/magnum/drivers/common/templates/kubernetes/fragments/write-kube-os-config.sh#L16

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.