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

Initialize hosts during dynamic secret update #362

Merged
merged 2 commits into from
Oct 23, 2024

Conversation

lukeatdell
Copy link
Contributor

@lukeatdell lukeatdell commented Oct 23, 2024

Description

Formerly, the secret watcher was updating the array object when the secret config changed. In the case where a new array was added to the secret, only the array object was updated to add the new array info, and hosts were not configured for the node in the PowerStore system.

This change will re-initialize the driver node container when a changes is detected by the secret watcher, setting up the hosts for the node in the PowerStore system, avoiding a pod restart to accomplish the same.

GitHub Issues

GitHub Issue #
dell/csm#1538

Checklist:

  • I have performed a self-review of my own code to ensure there are no formatting, vetting, linting, or security issues
  • I have verified that new and existing unit tests pass locally with my changes
  • I have not allowed coverage numbers to degenerate
  • I have maintained at least 90% code coverage
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • Backward compatibility is not broken

Testing

Procedure

  • Install the driver with one array in the secret, configured for NVMeTCP.
  • Create a corresponding storage class for the array.
  • Execute cert-csi test suite against the storage class configured for the array using NVMeTCP.
  • Observe results. Should pass all tests at 100%.
  • Execute the command to update the secret, adding a second PowerStore array configured for ISCSI, setting the second array as default, and re-configuring the first array to no longer be default.
  • Create a corresponding storage class for the second array.
  • Execute cert-csi test suite against the storage class configured for the new array using ISCSI.
  • Observer results. Should pass all tests at 100%.

Results

Test with only one array configured for NVMeTCP
image
image
Test with two arrays in the secret, the second set as default and configured for ISCSI
image
image

Configs

cert-csi-config.yaml

storageClasses:
  - name: powerstore-nvmetcp
    minSize: 5Gi
    rawBlock: true
    expansion: true
    clone: true
    snapshot: false
    RWX: false
    RWXOP: true
  - name: powerstore-iscsi
    minSize: 5Gi
    rawBlock: true
    expansion: true
    clone: true
    snapshot: false
    RWX: false
    RWXOP: true

powerstore-nvmetcp.yaml

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: powerstore-nvmetcp
parameters:
  arrayID: "array-id-1"
  csi.storage.k8s.io/fstype: ext4
provisioner: csi-powerstore.dellemc.com
reclaimPolicy: Delete
volumeBindingMode: Immediate
allowVolumeExpansion: true

powerstore-iscsi.yaml

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: powerstore-iscsi
parameters:
  arrayID: "array-id-2"
  csi.storage.k8s.io/fstype: ext4
provisioner: csi-powerstore.dellemc.com
reclaimPolicy: Delete
volumeBindingMode: Immediate
allowVolumeExpansion: true

secret-one.yaml

arrays:
   - endpoint: "https://<array-ip-1>/api/rest"
     globalID: "array-id-1"
     username: "username"
     password: "password"
     skipCertificateValidation: true
     blockProtocol: "NVMeTCP"
     nasName: "nas-name"
     isDefault: true

secret-two.yaml

arrays:
   - endpoint: "https://<array-ip-1>/api/rest"
     globalID: "array-id-1"
     username: "username"
     password: "password"
     skipCertificateValidation: true
     blockProtocol: "NVMeTCP"
     nasName: "nas-name"
   - endpoint: "https://<array-ip-2>/api/rest"
     globalID: "array-id-2"
     username: "username"
     password: "password"
     skipCertificateValidation: true
     isDefault: true
     blockProtocol: "ISCSI"
     nasName: "nas-name"

@lukeatdell lukeatdell merged commit fc8ce02 into main Oct 23, 2024
5 checks passed
@lukeatdell lukeatdell deleted the usr/lukeatdell/dynamic-secret-update branch October 23, 2024 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants