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

PWX-37570 | Add missing fields for updateStrategy #597

Merged
merged 2 commits into from
Jul 26, 2024

Conversation

hitesh-wani-px
Copy link
Collaborator

What this PR does / why we need it:
Added missing fields for updateStrategy component in storageCluster template

Which issue(s) this PR fixes (optional)
Closes #https://purestorage.atlassian.net/browse/PWX-37570

Special notes for your reviewer:

Signed-off-by: hitesh-wani-px <[email protected]>
@hitesh-wani-px
Copy link
Collaborator Author

Testing Notes:

  1. RollingUpdate
    1. Enter all possible values for updateStrategy RollingUpdate in values.yaml
      (Enter old PX version and then upgrade to latest)
    imageVersion: 3.0.5
    updateStrategy:   
      type:    RollingUpdate                             
      maxUnavailable:  3                     
      minReadySeconds: 30                     
      autoUpdateComponents: Always                 
    internalKVDB: true
    1. Install PX
    helm install my-release --set internalKVDB=true,clusterName=$(uuidgen) ./charts/portworx/ -n portworx --debug
    
    1. The generated storageCluster template should incorporate all specified values.
    kind: StorageCluster
    apiVersion: core.libopenstorage.org/v1
    metadata:
     name: "mycluster"
     namespace: kube-system
     annotations:
     labels:
       heritage: "Helm"
       release: "my-release"
       chart: "portworx-3.1.0"
       app.kubernetes.io/managed-by: "Helm"
       app.kubernetes.io/instance: "my-release"
    spec:
     image: portworx/oci-monitor:3.0.5
     imagePullPolicy: Always
     updateStrategy:
       type: RollingUpdate
       rollingUpdate:
         maxUnavailable: 3
         minReadySeconds: 30
     autoUpdateComponents: Always
    
      kvdb:
       internal: true
     storage:
       useAll: true
     secretsProvider: k8s
    
     env:
     - name: PX_SECRETS_NAMESPACE
       value: portworx
    
     stork:
       enabled: true
     csi:
       enabled: false
    1. After successfully installation of PX upgrade PX version to 3.1.0
    helm upgrade my-release --set internalKVDB=true,imageVersion=3.1.0 ./charts/portworx/ -n portworx
    
    During upgrade max 3 nodes should be down at time for performing rolling update
    and upgraded pods to be ready for at least minReadySeconds before updating the next batch of pods.
  2. OnDelete
    1. Add upgrade strategy type to OnDelete
      (Enter old PX version and then upgrade to latest)
        imageVersion: 3.0.5
        updateStrategy:   
          type:    OnDelete                             
        autoUpdateComponents: Always                 
        internalKVDB: true
    1. Install PX
    helm install my-release --set internalKVDB=true,clusterName=$(uuidgen) ./charts/portworx/ -n portworx --debug
    
    1. The generated storageCluster yaml should have upgradeStrategy as OnDelete
    2. After successfully installation of PX upgrade PX version to 3.1.0
    helm upgrade my-release --set internalKVDB=true,imageVersion=3.1.0 ./charts/portworx/ -n portworx
    
    1. Delete one of the pod manually to perform upgrade for OnDelete strategy. After that we should be able to see the new px
      pod with upgraded version (3.1.0).
      image: docker.io/portworx/oci-monitor:3.1.0
      

@hitesh-wani-px hitesh-wani-px marked this pull request as ready for review July 10, 2024 04:57
@hitesh-wani-px hitesh-wani-px changed the title PWX-37570 | Added missing fields for updateStrategy PWX-37570 | Add missing fields for updateStrategy Jul 10, 2024
@@ -115,3 +115,14 @@ clusterToken:

deleteStrategy: # Optional: Delete strategy for the portworx cluster
type: # Valid values: Uninstall, UninstallAndWipe

updateStrategy:
type: # portworx supports the following update strategies- RollingUpdate and OnDelete

Choose a reason for hiding this comment

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

should we add RollingUpdate as default?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We are only adding the updateStrategy in storageCluster if the user has specified valid values. The operator can handle the default values later if we not specifies any value in type.

@nikita-bhatia
Copy link

nikita-bhatia commented Jul 26, 2024

PR looks good to me.
I would want @vinayakshnd @diptiranjanpx to confirm if we want to set default value of UpdateStrategy as mentioned in PWX-29986
Since from portworx-central, by default it is not added, I am approving the PR.

Signed-off-by: hitesh-wani-px <[email protected]>
@hitesh-wani-px hitesh-wani-px merged commit 7496677 into PWX-29986 Jul 26, 2024
@hitesh-wani-px hitesh-wani-px deleted the PWX-37570 branch July 26, 2024 10:40
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.

None yet

2 participants