Specify internal network to improve stability in a multi-NIC scenario.

When there is more than one NIC attached to an instance, openstack cloud
provider returns a random InternalIP back to the host resulting in instability
with API server which only talks to a default interface.

This patch incorporates the changes made in
https://github.com/kubernetes/cloud-provider-openstack/pull/444 which enables
OpenStack Cloud Controller Manager (OCCM) to respect the
`internal-network-name` in cloud-config file which ensures that InternalIP
remains stable.

Uses a separate cloud-config file for OCCM to ensure in-tree Cinder volumes
remain compatible.

Change-Id: Idfa52ed2d512e7dc383a556371e896205dd542f9
Story: 2005333
Task: 30271
This commit is contained in:
Bharat Kunwar 2019-06-20 15:57:09 +00:00
parent 85bd42474b
commit 110fbe25aa
4 changed files with 12 additions and 1 deletions

View File

@ -292,7 +292,7 @@ spec:
command:
- /bin/openstack-cloud-controller-manager
- --v=2
- --cloud-config=/etc/kubernetes/cloud-config
- --cloud-config=/etc/kubernetes/cloud-config-occm
- --cluster-name=${CLUSTER_UUID}
- --use-service-account-credentials=true
- --bind-address=127.0.0.1

View File

@ -32,6 +32,7 @@ HEAT_PARAMS=/etc/sysconfig/heat-params
ETCD_DISCOVERY_URL="$ETCD_DISCOVERY_URL"
USERNAME="$USERNAME"
PASSWORD="$PASSWORD"
CLUSTER_NETWORK="$CLUSTER_NETWORK"
CLUSTER_SUBNET="$CLUSTER_SUBNET"
TLS_DISABLED="$TLS_DISABLED"
KUBE_DASHBOARD_ENABLED="$KUBE_DASHBOARD_ENABLED"

View File

@ -41,3 +41,12 @@ fi
# backwards compatibility, some apps may expect this file from previous magnum versions.
$ssh_cmd cp ${KUBE_OS_CLOUD_CONFIG} /etc/kubernetes/kube_openstack_config
# Extra networking cloud config for openstack cloud controller manager.
$ssh_cmd cp ${KUBE_OS_CLOUD_CONFIG}{,-occm}
# Append networking config to config file specific to openstack cloud controller manager.
cat >> ${KUBE_OS_CLOUD_CONFIG}-occm <<EOF
[Networking]
internal-network-name=$CLUSTER_NETWORK
EOF

View File

@ -560,6 +560,7 @@ resources:
"$AUTH_URL": {get_param: auth_url}
"$USERNAME": {get_param: username}
"$PASSWORD": {get_param: password}
"$CLUSTER_NETWORK": {get_param: fixed_network}
"$CLUSTER_SUBNET": {get_param: fixed_subnet}
"$TLS_DISABLED": {get_param: tls_disabled}
"$TRAEFIK_INGRESS_CONTROLLER_TAG": {get_param: traefik_ingress_controller_tag}