Skip to content

Initialize hosts during dynamic secret update#362

Merged
lukeatdell merged 2 commits into
mainfrom
usr/lukeatdell/dynamic-secret-update
Oct 23, 2024
Merged

Initialize hosts during dynamic secret update#362
lukeatdell merged 2 commits into
mainfrom
usr/lukeatdell/dynamic-secret-update

Conversation

@lukeatdell

@lukeatdell lukeatdell commented Oct 23, 2024

Copy link
Copy Markdown
Contributor

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 #
https://github.com/dell/csm/issues/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
@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