From a0e62df0935bbf4e65663c8ca8b732ee69495809 Mon Sep 17 00:00:00 2001 From: Feilong Wang Date: Thu, 16 Jan 2020 12:34:25 +1300 Subject: [PATCH] [k8s] Fix volumes availability zone issue For a multi AZ env, if Nova doesn't support cross AZ volume mount, then the cluster creation may fail because of block device mapping error. The patch fixes this issue by passing in the AZ information when creating volumes for etcd, docker and the node root disk. Task: 38131 Story: 2007097 Change-Id: I39c99259abc84cbbee50ac1a827e9349ede6593c --- .../k8s_fedora_atomic_v1/templates/kubemaster.yaml | 3 +++ .../k8s_fedora_atomic_v1/templates/kubeminion.yaml | 2 ++ .../k8s_fedora_coreos_v1/templates/kubemaster.yaml | 3 +++ .../k8s_fedora_coreos_v1/templates/kubeminion.yaml | 2 ++ .../notes/k8s-volumes-az-fix-85ad48998d2c12aa.yaml | 9 +++++++++ 5 files changed, 19 insertions(+) create mode 100644 releasenotes/notes/k8s-volumes-az-fix-85ad48998d2c12aa.yaml diff --git a/magnum/drivers/k8s_fedora_atomic_v1/templates/kubemaster.yaml b/magnum/drivers/k8s_fedora_atomic_v1/templates/kubemaster.yaml index 9eaf91e0cf..e8a4279876 100644 --- a/magnum/drivers/k8s_fedora_atomic_v1/templates/kubemaster.yaml +++ b/magnum/drivers/k8s_fedora_atomic_v1/templates/kubemaster.yaml @@ -780,6 +780,7 @@ resources: image: {get_param: server_image} size: {get_param: boot_volume_size} volume_type: {get_param: boot_volume_type} + availability_zone: {get_param: availability_zone} # do NOT use "_" (underscore) in the Nova server name # it creates a mismatch between the generated Nova name and its hostname @@ -865,6 +866,7 @@ resources: properties: size: {get_param: etcd_volume_size} volume_type: {get_param: etcd_volume_type} + availability_zone: {get_param: availability_zone} etcd_volume_attach: type: Magnum::Optional::Etcd::VolumeAttachment @@ -884,6 +886,7 @@ resources: properties: size: {get_param: docker_volume_size} volume_type: {get_param: docker_volume_type} + availability_zone: {get_param: availability_zone} docker_volume_attach: type: Magnum::Optional::Cinder::VolumeAttachment diff --git a/magnum/drivers/k8s_fedora_atomic_v1/templates/kubeminion.yaml b/magnum/drivers/k8s_fedora_atomic_v1/templates/kubeminion.yaml index 085291292f..47343810eb 100644 --- a/magnum/drivers/k8s_fedora_atomic_v1/templates/kubeminion.yaml +++ b/magnum/drivers/k8s_fedora_atomic_v1/templates/kubeminion.yaml @@ -464,6 +464,7 @@ resources: image: {get_param: server_image} size: {get_param: boot_volume_size} volume_type: {get_param: boot_volume_type} + availability_zone: {get_param: availability_zone} # do NOT use "_" (underscore) in the Nova server name # it creates a mismatch between the generated Nova name and its hostname @@ -533,6 +534,7 @@ resources: properties: size: {get_param: docker_volume_size} volume_type: {get_param: docker_volume_type} + availability_zone: {get_param: availability_zone} docker_volume_attach: type: Magnum::Optional::Cinder::VolumeAttachment diff --git a/magnum/drivers/k8s_fedora_coreos_v1/templates/kubemaster.yaml b/magnum/drivers/k8s_fedora_coreos_v1/templates/kubemaster.yaml index 2c4007f457..f3b05308ef 100644 --- a/magnum/drivers/k8s_fedora_coreos_v1/templates/kubemaster.yaml +++ b/magnum/drivers/k8s_fedora_coreos_v1/templates/kubemaster.yaml @@ -783,6 +783,7 @@ resources: image: {get_param: server_image} size: {get_param: boot_volume_size} volume_type: {get_param: boot_volume_type} + availability_zone: {get_param: availability_zone} # do NOT use "_" (underscore) in the Nova server name # it creates a mismatch between the generated Nova name and its hostname @@ -866,6 +867,7 @@ resources: properties: size: {get_param: etcd_volume_size} volume_type: {get_param: etcd_volume_type} + availability_zone: {get_param: availability_zone} etcd_volume_attach: type: Magnum::Optional::Etcd::VolumeAttachment @@ -885,6 +887,7 @@ resources: properties: size: {get_param: docker_volume_size} volume_type: {get_param: docker_volume_type} + availability_zone: {get_param: availability_zone} docker_volume_attach: type: Magnum::Optional::Cinder::VolumeAttachment diff --git a/magnum/drivers/k8s_fedora_coreos_v1/templates/kubeminion.yaml b/magnum/drivers/k8s_fedora_coreos_v1/templates/kubeminion.yaml index c14a2c6cb0..62f812c806 100644 --- a/magnum/drivers/k8s_fedora_coreos_v1/templates/kubeminion.yaml +++ b/magnum/drivers/k8s_fedora_coreos_v1/templates/kubeminion.yaml @@ -465,6 +465,7 @@ resources: image: {get_param: server_image} size: {get_param: boot_volume_size} volume_type: {get_param: boot_volume_type} + availability_zone: {get_param: availability_zone} # do NOT use "_" (underscore) in the Nova server name # it creates a mismatch between the generated Nova name and its hostname @@ -532,6 +533,7 @@ resources: properties: size: {get_param: docker_volume_size} volume_type: {get_param: docker_volume_type} + availability_zone: {get_param: availability_zone} docker_volume_attach: type: Magnum::Optional::Cinder::VolumeAttachment diff --git a/releasenotes/notes/k8s-volumes-az-fix-85ad48998d2c12aa.yaml b/releasenotes/notes/k8s-volumes-az-fix-85ad48998d2c12aa.yaml new file mode 100644 index 0000000000..35997554f4 --- /dev/null +++ b/releasenotes/notes/k8s-volumes-az-fix-85ad48998d2c12aa.yaml @@ -0,0 +1,9 @@ +--- +fixes: + - | + In a multi availability zone (AZ) environment, if Nova doesn't support + cross AZ volume mount, then the cluster creation may fail because Nova can + not mount volume in different AZ. This issue only impact Fedora Atomic and + Fedora CoreOS drivers. Now this issue is fixed by passing in the AZ info + when creating volumes. +