Charm configures "Topology=True" preventing volume mounts

Bug #2059126 reported by Peter Jose De Sousa
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Cinder CSI
Fix Committed
Undecided
Adam Dyess

Bug Description

Hello,

When deploying the cinder-csi charm, the cinder controller plugin is configured with Topology enabled = true. This prevents volumes from mounting in the case where nodes are setup in Host Aggregate groups, e.g. AZ1, AZ2, and so on.

This is because the PV is forced onto a "nova" AZ:

kubectl get -o yaml pv pvc-2b992195-0afb-4033-ab45-e371a671bfee
apiVersion: v1
kind: PersistentVolume
metadata:
  annotations:
    pv.kubernetes.io/provisioned-by: cinder.csi.openstack.org
    volume.kubernetes.io/provisioner-deletion-secret-name: ""
    volume.kubernetes.io/provisioner-deletion-secret-namespace: ""
  creationTimestamp: "2024-03-26T13:07:40Z"
  finalizers:
  - kubernetes.io/pv-protection
  name: pvc-2b992195-0afb-4033-ab45-e371a671bfee
  resourceVersion: "254584"
  uid: 7af9c1f5-f781-48ce-821f-5924006f0266
spec:
  accessModes:
  - ReadWriteOnce
  capacity:
    storage: 3Gi
  claimRef:
    apiVersion: v1
    kind: PersistentVolumeClaim
    name: task-pv-claim
    namespace: default
    resourceVersion: "254580"
    uid: 2b992195-0afb-4033-ab45-e371a671bfee
  csi:
    driver: cinder.csi.openstack.org
    fsType: ext4
    volumeAttributes:
      storage.kubernetes.io/csiProvisionerIdentity: 1711392938167-8081-cinder.csi.openstack.org
    volumeHandle: f2b028de-5960-43a5-bbec-a6db22ccc11d
  nodeAffinity:
    required:
      nodeSelectorTerms:
      - matchExpressions:
        - key: topology.cinder.csi.openstack.org/zone
          operator: In
          values:
          - nova

[Workaround]

This is forced by the CSI. To work around this, disable the feature gate:

kubectl edit deploy -n kube-system csi-cinder-controllerplugin

  template:
    metadata:
      creationTimestamp: null
      labels:
        app: csi-cinder-controllerplugin
    spec:
      containers:
      - args:
        - --csi-address=$(ADDRESS)
        - --timeout=3m
        - --leader-election=true
        - --default-fstype=ext4
        env:
        - name: ADDRESS
          value: /var/lib/csi/sockets/pluginproxy/csi.sock
        image: rocks.canonical.com:443/cdk/sig-storage/csi-attacher:v4.2.0
        imagePullPolicy: IfNotPresent
        name: csi-attacher
        resources: {}
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /var/lib/csi/sockets/pluginproxy/
          name: socket-dir
      - args:
        - --csi-address=$(ADDRESS)
        - --timeout=3m
        - --default-fstype=ext4
        - --feature-gates=Topology=false
        - --extra-create-metadata
        - --leader-election=true

The correct, long term solution here is to be able to configure topology via the charm or for the charm to automatically configure the topology.

Thanks,
Peter

Revision history for this message
Peter Jose De Sousa (pjds) wrote :

Subscribing field high as its affectecting a customer deployment and prevents PV attachment.

description: updated
description: updated
Revision history for this message
Adam Dyess (addyess) wrote :
Changed in charm-cinder-csi:
milestone: none → 1.30
status: New → In Progress
Adam Dyess (addyess)
Changed in charm-cinder-csi:
status: In Progress → Fix Committed
assignee: nobody → Adam Dyess (addyess)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.