From 8144b2fc2185eea5c32481315800c953a41d4d53 Mon Sep 17 00:00:00 2001 From: Paul Rey Date: Mon, 29 Jun 2020 12:05:12 +0200 Subject: [PATCH] Add additional metadata configuration option to external Openstack CCM (kubernetes-sigs#6338) --- docs/openstack.md | 6 ++++++ inventory/sample/group_vars/all/openstack.yml | 1 + .../openstack/templates/external-openstack-cloud-config.j2 | 3 +++ roles/kubespray-defaults/defaults/main.yaml | 1 + 4 files changed, 11 insertions(+) diff --git a/docs/openstack.md b/docs/openstack.md index ee1047ae9e0..c74ecbec47c 100644 --- a/docs/openstack.md +++ b/docs/openstack.md @@ -108,5 +108,11 @@ The new cloud provider is configured to have Octavia by default in Kubespray. - "" ``` +- You can override the default OpenStack metadata configuration (see [#6338](https://github.com/kubernetes-sigs/kubespray/issues/6338) for explanation): + + ```yaml + external_openstack_metadata_search_order: "configDrive,metadataService" + ``` + - Run `source path/to/your/openstack-rc` to read your OpenStack credentials like `OS_AUTH_URL`, `OS_USERNAME`, `OS_PASSWORD`, etc. Those variables are used for accessing OpenStack from the external cloud provider. - Run the `cluster.yml` playbook diff --git a/inventory/sample/group_vars/all/openstack.yml b/inventory/sample/group_vars/all/openstack.yml index ca76bb0928a..71c392414ed 100644 --- a/inventory/sample/group_vars/all/openstack.yml +++ b/inventory/sample/group_vars/all/openstack.yml @@ -33,6 +33,7 @@ # - "" # external_openstack_network_public_networks: # - "" +# external_openstack_metadata_search_order: "configDrive,metadataService" ## The tag of the external OpenStack Cloud Controller image # external_openstack_cloud_controller_image_tag: "latest" diff --git a/roles/kubernetes-apps/external_cloud_controller/openstack/templates/external-openstack-cloud-config.j2 b/roles/kubernetes-apps/external_cloud_controller/openstack/templates/external-openstack-cloud-config.j2 index d807426a01a..8516575e89b 100644 --- a/roles/kubernetes-apps/external_cloud_controller/openstack/templates/external-openstack-cloud-config.j2 +++ b/roles/kubernetes-apps/external_cloud_controller/openstack/templates/external-openstack-cloud-config.j2 @@ -57,3 +57,6 @@ internal-network-name="{{ network_name }}" {% for network_name in external_openstack_network_public_networks %} public-network-name="{{ network_name }}" {% endfor %} + +[Metadata] +search-order="{{ external_openstack_metadata_search_order }}" \ No newline at end of file diff --git a/roles/kubespray-defaults/defaults/main.yaml b/roles/kubespray-defaults/defaults/main.yaml index 80e6f3b25b2..888f6739602 100644 --- a/roles/kubespray-defaults/defaults/main.yaml +++ b/roles/kubespray-defaults/defaults/main.yaml @@ -363,6 +363,7 @@ external_openstack_network_internal_networks: - "" external_openstack_network_public_networks: - "" +external_openstack_metadata_search_order: "configDrive,metadataService" ## List of authorization modes that must be configured for ## the k8s cluster. Only 'AlwaysAllow', 'AlwaysDeny', 'Node' and