Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSASINFRA-3652: openstack-cinder: Use new --with-topology flag #345

Merged
merged 2 commits into from
Apr 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
# Applied strategic merge patch overlays/openstack-cinder/patches/controller_add_driver.yaml
# Applied strategic merge patch common/sidecars/controller_driver_kube_rbac_proxy.yaml
# provisioner.yaml: Loaded from common/sidecars/provisioner.yaml
# provisioner.yaml: Added arguments [--timeout=3m --feature-gates=Topology=$(ENABLE_TOPOLOGY) --default-fstype=ext4]
# provisioner.yaml: Added arguments [--timeout=3m --default-fstype=ext4]
# provisioner.yaml: Applied JSON patch common/hypershift/sidecar_add_kubeconfig.yaml.patch
# provisioner.yaml: Applied strategic merge patch overlays/openstack-cinder/patches/provisioner_add_envvars.yaml
# Applied strategic merge patch provisioner.yaml
# attacher.yaml: Loaded from common/sidecars/attacher.yaml
# attacher.yaml: Added arguments [--timeout=3m]
Expand Down Expand Up @@ -94,12 +93,18 @@ spec:
- --endpoint=$(CSI_ENDPOINT)
- --cloud-config=$(CLOUD_CONFIG)
- --cluster=${CLUSTER_ID}
- --with-topology=$(ENABLE_TOPOLOGY)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The effect of this is that when set to false CreateVolume will not pull topology information from the CreateVolumeRequest even if it is present:

https://github.com/kubernetes/cloud-provider-openstack/blob/53a4505c3caa96365b12cfc7230a84e429744b7c/pkg/csi/cinder/controllerserver.go#L88-L101

and subsequently AvailabilityZone will always be empty in the cinder create call:

https://github.com/kubernetes/cloud-provider-openstack/blob/53a4505c3caa96365b12cfc7230a84e429744b7c/pkg/csi/cinder/controllerserver.go#L194-L204

- --v=${LOG_LEVEL}
env:
- name: CSI_ENDPOINT
value: unix://csi/csi.sock
- name: CLOUD_CONFIG
value: /etc/kubernetes/config/cloud.conf
- name: ENABLE_TOPOLOGY
valueFrom:
configMapKeyRef:
key: enable_topology
name: cloud-conf
image: ${DRIVER_IMAGE}
imagePullPolicy: IfNotPresent
livenessProbe:
Expand Down Expand Up @@ -164,17 +169,11 @@ spec:
- --leader-election-namespace=${NODE_NAMESPACE}
- --v=${LOG_LEVEL}
- --timeout=3m
- --feature-gates=Topology=$(ENABLE_TOPOLOGY)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this is fine, because we're now achieving the same outcome by nobbling the behaviour of CreateVolume when enable_topology is false.

- --default-fstype=ext4
- --kubeconfig=$(KUBECONFIG)
env:
- name: KUBECONFIG
value: /etc/hosted-kubernetes/kubeconfig
- name: ENABLE_TOPOLOGY
valueFrom:
configMapKeyRef:
key: enable_topology
name: cloud-conf
image: ${PROVISIONER_IMAGE}
imagePullPolicy: IfNotPresent
name: csi-provisioner
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
# Applied strategic merge patch overlays/openstack-cinder/patches/controller_add_driver.yaml
# Applied strategic merge patch common/sidecars/controller_driver_kube_rbac_proxy.yaml
# provisioner.yaml: Loaded from common/sidecars/provisioner.yaml
# provisioner.yaml: Added arguments [--timeout=3m --feature-gates=Topology=$(ENABLE_TOPOLOGY) --default-fstype=ext4]
# provisioner.yaml: Applied strategic merge patch overlays/openstack-cinder/patches/provisioner_add_envvars.yaml
# provisioner.yaml: Added arguments [--timeout=3m --default-fstype=ext4]
# Applied strategic merge patch provisioner.yaml
# attacher.yaml: Loaded from common/sidecars/attacher.yaml
# attacher.yaml: Added arguments [--timeout=3m]
Expand Down Expand Up @@ -64,12 +63,18 @@ spec:
- --endpoint=$(CSI_ENDPOINT)
- --cloud-config=$(CLOUD_CONFIG)
- --cluster=${CLUSTER_ID}
- --with-topology=$(ENABLE_TOPOLOGY)
- --v=${LOG_LEVEL}
env:
- name: CSI_ENDPOINT
value: unix://csi/csi.sock
- name: CLOUD_CONFIG
value: /etc/kubernetes/config/cloud.conf
- name: ENABLE_TOPOLOGY
valueFrom:
configMapKeyRef:
key: enable_topology
name: cloud-conf
image: ${DRIVER_IMAGE}
imagePullPolicy: IfNotPresent
livenessProbe:
Expand Down Expand Up @@ -134,14 +139,8 @@ spec:
- --leader-election-namespace=${NODE_NAMESPACE}
- --v=${LOG_LEVEL}
- --timeout=3m
- --feature-gates=Topology=$(ENABLE_TOPOLOGY)
- --default-fstype=ext4
env:
- name: ENABLE_TOPOLOGY
valueFrom:
configMapKeyRef:
key: enable_topology
name: cloud-conf
env: []
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: omit this?.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is auto-generated (and generated from scratch each time rather than updated) so I'm thinking I can't.

image: ${PROVISIONER_IMAGE}
imagePullPolicy: IfNotPresent
name: csi-provisioner
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,18 @@ spec:
- "--endpoint=$(CSI_ENDPOINT)"
- "--cloud-config=$(CLOUD_CONFIG)"
- "--cluster=${CLUSTER_ID}"
- "--with-topology=$(ENABLE_TOPOLOGY)"
- "--v=${LOG_LEVEL}"
env:
- name: CSI_ENDPOINT
value: unix://csi/csi.sock
- name: CLOUD_CONFIG
value: /etc/kubernetes/config/cloud.conf
- name: ENABLE_TOPOLOGY
valueFrom:
configMapKeyRef:
key: enable_topology
name: cloud-conf
ports:
- name: healthz
containerPort: 10301
Expand Down

This file was deleted.

3 changes: 0 additions & 3 deletions pkg/driver/openstack-cinder/openstack_cinder.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,7 @@ func GetOpenStackCinderGeneratorConfig() *generator.CSIDriverGeneratorConfig {
Sidecars: []generator.SidecarConfig{
commongenerator.DefaultProvisionerWithSnapshots.WithExtraArguments(
"--timeout=3m",
"--feature-gates=Topology=$(ENABLE_TOPOLOGY)",
"--default-fstype=ext4",
).WithPatches(generator.AllFlavours,
"controller.yaml", "overlays/openstack-cinder/patches/provisioner_add_envvars.yaml",
),
commongenerator.DefaultAttacher.WithExtraArguments(
"--timeout=3m",
Expand Down