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

feat(topology): add validation for node topology #825

Merged
merged 1 commit into from
May 20, 2024

Conversation

sinhaashish
Copy link
Member

Error out if nodeSpreadTopologyKey has same values as of nodeHasTopologyKey or nodeAffinityTopologyLabel

control-plane/csi-driver/src/context.rs Outdated Show resolved Hide resolved
control-plane/csi-driver/src/context.rs Outdated Show resolved Hide resolved
control-plane/csi-driver/src/context.rs Show resolved Hide resolved
@sinhaashish
Copy link
Member Author

sinhaashish commented May 15, 2024

Ran this test . Please validate the step
The storage class has

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: mayastor-5
parameters:
  ioTimeout: "30"
  protocol: nvmf
  repl: "3"
  nodeTopologyAffinityLabel: |
    zone-us: us-west-1
  nodeSpreadTopologyKey: |
    zone-us
  nodeHasTopologyKey: |
    zone-us
provisioner: io.openebs.csi-mayastor
volumeBindingMode: Immediate

Then created a PVC using the above sc

[nix-shell:~/code/rust/mayastor-control-plane]$ cat <<EOF | kubectl create -f -
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: ms-volume-claim
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
  storageClassName: mayastor-5
EOF
persistentvolumeclaim/ms-volume-claim created

The pvc is in pending state
upon checking the csi-controller logs it shows

failed to provision volume with StorageClass "mayastor-5": rpc error: code = InvalidArgument desc = Invalid node topology. `nodeSpreadTopologyKey` can't have same values as `nodeHasTopologyKey` or `nodeAffinityTopologyLabel`

Signed-off-by: sinhaashish <ashi.sinha.87@gmail.com>
@sinhaashish
Copy link
Member Author

bors merge

@bors-openebs-mayastor
Copy link

🕐 Waiting for PR status (GitHub check) to be set, probably by CI. Bors will automatically try to run when all required PR statuses are set.

@bors-openebs-mayastor
Copy link

Build succeeded:

@bors-openebs-mayastor bors-openebs-mayastor bot merged commit 8d4db1f into openebs:develop May 20, 2024
4 checks passed
@sinhaashish sinhaashish deleted the validation branch May 20, 2024 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants