Skip to content

Commit

Permalink
Spawn cinder volumes in the same Availability Zone
Browse files Browse the repository at this point in the history
At the moment volumes for workers are gonna be spawn in a random
AZ completely disregarding user request for Availability Zone.

In a design where cross_az_attach is not posisble an attempt
to add a volume to worker has high failure percentage due to random
selection of AZ.

This patch suggests using provided to cluster availability_zone by
supplying `availability` parameter to cinder csi [1]

This ensures that volume will be created in a same zone as workers are
preventing failures where cross_az_attach is False.

[1] https://github.com/kubernetes/cloud-provider-openstack/blob/master/docs/cinder-csi-plugin/using-cinder-csi-plugin.md#supported-parameters
  • Loading branch information
noonedeadpunk committed Nov 29, 2024
1 parent 724a3fb commit 706147c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions magnum_cluster_api/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,9 @@ def get_object(self) -> pykube.ConfigMap:
"provisioner": "cinder.csi.openstack.org",
"parameters": {
"type": vt.name,
"availability": self.cluster.labels.get(
"availability_zone", ""
),
},
"reclaimPolicy": "Delete",
"volumeBindingMode": "Immediate",
Expand Down

0 comments on commit 706147c

Please sign in to comment.