From 004e0cd74216142588f876900cc6cf619be5759d Mon Sep 17 00:00:00 2001 From: Mathieu Velten Date: Fri, 25 Nov 2016 15:21:09 +0100 Subject: [PATCH] Remove underscores from Nova server names It creates a mismatch between the generated Nova name and its hostname which can lead to weird problems. Closes-Bug: 1645730 Change-Id: I1c7dd459caefacaf41dd77e59c1a6e1df3ef0d42 --- .../k8s_coreos_v1/templates/kubemaster.yaml | 7 +++++-- .../k8s_coreos_v1/templates/kubeminion.yaml | 10 +++------- .../templates/kubemaster.yaml | 9 ++++++--- .../templates/kubeminion.yaml | 9 +++------ .../templates/kubemaster.yaml | 15 +++++++++------ .../templates/kubeminion.yaml | 9 +++------ .../mesos_ubuntu_v1/templates/mesosmaster.yaml | 7 +++++-- .../mesos_ubuntu_v1/templates/mesosslave.yaml | 7 +++++-- .../templates/swarmmaster.yaml | 9 ++++++--- .../templates/swarmnode.yaml | 9 ++++++--- 10 files changed, 51 insertions(+), 40 deletions(-) diff --git a/magnum/drivers/k8s_coreos_v1/templates/kubemaster.yaml b/magnum/drivers/k8s_coreos_v1/templates/kubemaster.yaml index 39b3d93039..ab8ea1693c 100644 --- a/magnum/drivers/k8s_coreos_v1/templates/kubemaster.yaml +++ b/magnum/drivers/k8s_coreos_v1/templates/kubemaster.yaml @@ -157,7 +157,7 @@ resources: master_wait_condition: type: OS::Heat::WaitCondition - depends_on: kube_master + depends_on: kube-master properties: handle: {get_resource: master_wait_handle} timeout: {get_param: wait_condition_timeout} @@ -364,7 +364,10 @@ resources: # a single kubernetes master. # - kube_master: + # do NOT use "_" (underscore) in the Nova server name + # it creates a mismatch between the generated Nova name and its hostname + # which can lead to weird problems + kube-master: type: OS::Nova::Server properties: image: {get_param: server_image} diff --git a/magnum/drivers/k8s_coreos_v1/templates/kubeminion.yaml b/magnum/drivers/k8s_coreos_v1/templates/kubeminion.yaml index 3312844a77..973e6ea45f 100644 --- a/magnum/drivers/k8s_coreos_v1/templates/kubeminion.yaml +++ b/magnum/drivers/k8s_coreos_v1/templates/kubeminion.yaml @@ -246,13 +246,9 @@ resources: "$enable_kube_proxy": {get_attr: [enable_kube_proxy, config]} "$wc_notify": {get_attr: [wc_notify, config]} - # Important: the name for the heat resource kube-minion below must - # not contain "_" (underscore) because it will be used in the - # hostname. Because DNS domain name does not allow "_", the "_" - # will be converted to a "-" and this will make the hostname different - # from the Nova instance name. This in turn will break the load - # balancer feature in Kubernetes. - + # do NOT use "_" (underscore) in the Nova server name + # it creates a mismatch between the generated Nova name and its hostname + # which can lead to weird problems kube-minion: type: OS::Nova::Server properties: diff --git a/magnum/drivers/k8s_fedora_atomic_v1/templates/kubemaster.yaml b/magnum/drivers/k8s_fedora_atomic_v1/templates/kubemaster.yaml index 66d779a0f6..fb22495a8a 100644 --- a/magnum/drivers/k8s_fedora_atomic_v1/templates/kubemaster.yaml +++ b/magnum/drivers/k8s_fedora_atomic_v1/templates/kubemaster.yaml @@ -190,7 +190,7 @@ resources: master_wait_condition: type: OS::Heat::WaitCondition - depends_on: kube_master + depends_on: kube-master properties: handle: {get_resource: master_wait_handle} timeout: {get_param: wait_condition_timeout} @@ -390,7 +390,10 @@ resources: # a single kubernetes master. # - kube_master: + # do NOT use "_" (underscore) in the Nova server name + # it creates a mismatch between the generated Nova name and its hostname + # which can lead to weird problems + kube-master: type: OS::Nova::Server properties: image: {get_param: server_image} @@ -450,7 +453,7 @@ resources: docker_volume_attach: type: Magnum::Optional::Cinder::VolumeAttachment properties: - instance_uuid: {get_resource: kube_master} + instance_uuid: {get_resource: kube-master} volume_id: {get_resource: docker_volume} mountpoint: /dev/vdb diff --git a/magnum/drivers/k8s_fedora_atomic_v1/templates/kubeminion.yaml b/magnum/drivers/k8s_fedora_atomic_v1/templates/kubeminion.yaml index a2f8963446..88c610d15c 100644 --- a/magnum/drivers/k8s_fedora_atomic_v1/templates/kubeminion.yaml +++ b/magnum/drivers/k8s_fedora_atomic_v1/templates/kubeminion.yaml @@ -367,14 +367,11 @@ resources: ###################################################################### # # a single kubernetes minion. - # Important: the name for the heat resource kube-minion below must - # not contain "_" (underscore) because it will be used in the - # hostname. Because DNS domain name does not allow "_", the "_" - # will be converted to a "-" and this will make the hostname different - # from the Nova instance name. This in turn will break the load - # balancer feature in Kubernetes. # + # do NOT use "_" (underscore) in the Nova server name + # it creates a mismatch between the generated Nova name and its hostname + # which can lead to weird problems kube-minion: type: OS::Nova::Server properties: diff --git a/magnum/drivers/k8s_fedora_ironic_v1/templates/kubemaster.yaml b/magnum/drivers/k8s_fedora_ironic_v1/templates/kubemaster.yaml index 27f4fe2e55..9236a19d9c 100644 --- a/magnum/drivers/k8s_fedora_ironic_v1/templates/kubemaster.yaml +++ b/magnum/drivers/k8s_fedora_ironic_v1/templates/kubemaster.yaml @@ -190,7 +190,7 @@ resources: master_wait_condition: type: OS::Heat::WaitCondition - depends_on: kube_master + depends_on: kube-master properties: handle: {get_resource: master_wait_handle} timeout: {get_param: wait_condition_timeout} @@ -389,7 +389,10 @@ resources: # a single kubernetes master. # - kube_master: + # do NOT use "_" (underscore) in the Nova server name + # it creates a mismatch between the generated Nova name and its hostname + # which can lead to weird problems + kube-master: type: OS::Nova::Server properties: image: {get_param: server_image} @@ -406,13 +409,13 @@ resources: floating_network: get_param: external_network port_id: - get_attr: [kube_master, addresses, {get_param: fixed_network}, 0, port] + get_attr: [kube-master, addresses, {get_param: fixed_network}, 0, port] api_pool_member: type: Magnum::Optional::Neutron::LBaaS::PoolMember properties: pool: {get_param: api_pool_id} - address: {get_attr: [kube_master, networks, private, 0]} + address: {get_attr: [kube-master, networks, private, 0]} subnet: { get_param: fixed_subnet } protocol_port: {get_param: kubernetes_port} @@ -420,14 +423,14 @@ resources: type: Magnum::Optional::Neutron::LBaaS::PoolMember properties: pool: {get_param: etcd_pool_id} - address: {get_attr: [kube_master, networks, private, 0]} + address: {get_attr: [kube-master, networks, private, 0]} subnet: { get_param: fixed_subnet } protocol_port: 2379 outputs: kube_master_ip: - value: {get_attr: [kube_master, networks, private, 0]} + value: {get_attr: [kube-master, networks, private, 0]} description: > This is the "private" IP address of the Kubernetes master node. diff --git a/magnum/drivers/k8s_fedora_ironic_v1/templates/kubeminion.yaml b/magnum/drivers/k8s_fedora_ironic_v1/templates/kubeminion.yaml index 38d67667d6..cdfcecf87a 100644 --- a/magnum/drivers/k8s_fedora_ironic_v1/templates/kubeminion.yaml +++ b/magnum/drivers/k8s_fedora_ironic_v1/templates/kubeminion.yaml @@ -366,14 +366,11 @@ resources: ###################################################################### # # a single kubernetes minion. - # Important: the name for the heat resource kube-minion below must - # not contain "_" (underscore) because it will be used in the - # hostname. Because DNS domain name does not allow "_", the "_" - # will be converted to a "-" and this will make the hostname different - # from the Nova instance name. This in turn will break the load - # balancer feature in Kubernetes. # + # do NOT use "_" (underscore) in the Nova server name + # it creates a mismatch between the generated Nova name and its hostname + # which can lead to weird problems kube-minion: type: OS::Nova::Server properties: diff --git a/magnum/drivers/mesos_ubuntu_v1/templates/mesosmaster.yaml b/magnum/drivers/mesos_ubuntu_v1/templates/mesosmaster.yaml index 1ae7ad9a51..5ebf3cda07 100644 --- a/magnum/drivers/mesos_ubuntu_v1/templates/mesosmaster.yaml +++ b/magnum/drivers/mesos_ubuntu_v1/templates/mesosmaster.yaml @@ -50,7 +50,10 @@ resources: # Mesos master server. # - mesos_master: + # do NOT use "_" (underscore) in the Nova server name + # it creates a mismatch between the generated Nova name and its hostname + # which can lead to weird problems + mesos-master: type: OS::Nova::Server properties: image: {get_param: server_image} @@ -96,6 +99,6 @@ outputs: description: > This is the "public" address of the Mesos master node. mesos_server_id: - value: {get_resource: mesos_master} + value: {get_resource: mesos-master} description: > This is the logical id of the Mesos master node. diff --git a/magnum/drivers/mesos_ubuntu_v1/templates/mesosslave.yaml b/magnum/drivers/mesos_ubuntu_v1/templates/mesosslave.yaml index d03da4e1e7..f6932bbcb9 100644 --- a/magnum/drivers/mesos_ubuntu_v1/templates/mesosslave.yaml +++ b/magnum/drivers/mesos_ubuntu_v1/templates/mesosslave.yaml @@ -138,7 +138,7 @@ resources: slave_wait_condition: type: OS::Heat::WaitCondition - depends_on: mesos_slave + depends_on: mesos-slave properties: handle: {get_resource: slave_wait_handle} timeout: {get_param: wait_condition_timeout} @@ -235,7 +235,10 @@ resources: # a single Mesos slave. # - mesos_slave: + # do NOT use "_" (underscore) in the Nova server name + # it creates a mismatch between the generated Nova name and its hostname + # which can lead to weird problems + mesos-slave: type: OS::Nova::Server properties: image: {get_param: server_image} diff --git a/magnum/drivers/swarm_fedora_atomic_v1/templates/swarmmaster.yaml b/magnum/drivers/swarm_fedora_atomic_v1/templates/swarmmaster.yaml index dcffa9d720..2422acfd67 100644 --- a/magnum/drivers/swarm_fedora_atomic_v1/templates/swarmmaster.yaml +++ b/magnum/drivers/swarm_fedora_atomic_v1/templates/swarmmaster.yaml @@ -169,7 +169,7 @@ resources: master_wait_condition: type: "OS::Heat::WaitCondition" - depends_on: swarm_master + depends_on: swarm-master properties: handle: {get_resource: master_wait_handle} timeout: 6000 @@ -387,7 +387,10 @@ resources: # side the swarm agent. # - swarm_master: + # do NOT use "_" (underscore) in the Nova server name + # it creates a mismatch between the generated Nova name and its hostname + # which can lead to weird problems + swarm-master: type: "OS::Nova::Server" properties: image: @@ -453,7 +456,7 @@ resources: docker_volume_attach: type: Magnum::Optional::Cinder::VolumeAttachment properties: - instance_uuid: {get_resource: swarm_master} + instance_uuid: {get_resource: swarm-master} volume_id: {get_resource: docker_volume} mountpoint: /dev/vdb diff --git a/magnum/drivers/swarm_fedora_atomic_v1/templates/swarmnode.yaml b/magnum/drivers/swarm_fedora_atomic_v1/templates/swarmnode.yaml index c60be2dbd9..5b1f345102 100644 --- a/magnum/drivers/swarm_fedora_atomic_v1/templates/swarmnode.yaml +++ b/magnum/drivers/swarm_fedora_atomic_v1/templates/swarmnode.yaml @@ -168,7 +168,7 @@ resources: node_wait_condition: type: "OS::Heat::WaitCondition" - depends_on: swarm_node + depends_on: swarm-node properties: handle: {get_resource: node_wait_handle} timeout: 6000 @@ -343,7 +343,10 @@ resources: - config: {get_resource: cfn_signal} - config: {get_resource: volume_service} - swarm_node: + # do NOT use "_" (underscore) in the Nova server name + # it creates a mismatch between the generated Nova name and its hostname + # which can lead to weird problems + swarm-node: type: "OS::Nova::Server" properties: image: @@ -393,7 +396,7 @@ resources: docker_volume_attach: type: Magnum::Optional::Cinder::VolumeAttachment properties: - instance_uuid: {get_resource: swarm_node} + instance_uuid: {get_resource: swarm-node} volume_id: {get_resource: docker_volume} mountpoint: /dev/vdb