Skip to content

Commit e6efebf

Browse files
authored
PWX-27563: Setting stork as the default scheduler for px-csi-ext pods (#807) (#811)
* PWX-27563: Setting stork as the default scheduler for px-csi-ext pods Signed-off-by: Priyanshu Pandey <[email protected]> * PWX-27563: Using stork as the shecduler for csi only when it is enabled in StorageCluster Signed-off-by: Priyanshu Pandey <[email protected]> * PWX-27563: Fixing static check error. Signed-off-by: Priyanshu Pandey <[email protected]> * PWX-27563: Handling csi-ext-pod scheduler when stork is enabled or disabled at run time Signed-off-by: Priyanshu Pandey <[email protected]> * PWX-27563: Fixing typo in function param Signed-off-by: Priyanshu Pandey <[email protected]> * PWX-27563: Handling empty stork spec correctly and adding UTs Signed-off-by: Priyanshu Pandey <[email protected]> * PWX-27563: Do not change csi deployment if stork spec is missing and scheduler is set to default-scheduler Signed-off-by: Priyanshu Pandey <[email protected]> Signed-off-by: Priyanshu Pandey <[email protected]> Signed-off-by: Priyanshu Pandey <[email protected]>
1 parent 1c3b1a7 commit e6efebf

16 files changed

+64
-1
lines changed

drivers/storage/portworx/component/csi.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,11 +509,11 @@ func (c *csi) createDeployment(
509509
healthMonitorControllerImage != existingHealthMonitorControllerContainerName ||
510510
util.HasPullSecretChanged(cluster, existingDeployment.Spec.Template.Spec.ImagePullSecrets) ||
511511
util.HasNodeAffinityChanged(cluster, existingDeployment.Spec.Template.Spec.Affinity) ||
512+
util.HasSchedulerStateChanged(cluster, existingDeployment.Spec.Template.Spec.SchedulerName) ||
512513
util.HaveTolerationsChanged(cluster, existingDeployment.Spec.Template.Spec.Tolerations) ||
513514
util.HaveTopologySpreadConstraintsChanged(updatedTopologySpreadConstraints,
514515
existingDeployment.Spec.Template.Spec.TopologySpreadConstraints) ||
515516
hasCSITopologyChanged(cluster, existingDeployment)
516-
517517
if !c.isCreated || modified {
518518
deployment := getCSIDeploymentSpec(cluster, csiConfig, ownerRef, provisionerImage, attacherImage,
519519
snapshotterImage, resizerImage, snapshotControllerImage, healthMonitorControllerImage, updatedTopologySpreadConstraints)
@@ -666,6 +666,10 @@ func getCSIDeploymentSpec(
666666
},
667667
}
668668

669+
if pxutil.IsStorkEnabled(cluster) {
670+
deployment.Spec.Template.Spec.SchedulerName = util.StorkSchedulerName
671+
}
672+
669673
if csiConfig.IncludeAttacher && attacherImage != "" {
670674
deployment.Spec.Template.Spec.Containers = append(
671675
deployment.Spec.Template.Spec.Containers,

drivers/storage/portworx/testspec/csiDeploymentAlphaDisabledK8s_1_14.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ spec:
4141
volumeMounts:
4242
- name: socket-dir
4343
mountPath: /csi
44+
schedulerName: stork
4445
volumes:
4546
- name: socket-dir
4647
hostPath:

drivers/storage/portworx/testspec/csiDeploymentAlphaDisabledK8s_1_16.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ spec:
5454
volumeMounts:
5555
- name: socket-dir
5656
mountPath: /csi
57+
schedulerName: stork
5758
volumes:
5859
- name: socket-dir
5960
hostPath:

drivers/storage/portworx/testspec/csiDeploymentWithPKS.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ spec:
6868
volumeMounts:
6969
- name: socket-dir
7070
mountPath: /csi
71+
schedulerName: stork
7172
volumes:
7273
- name: socket-dir
7374
hostPath:

drivers/storage/portworx/testspec/csiDeploymentWithResizerAndOldDriver_1.0.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ spec:
5656
volumeMounts:
5757
- name: socket-dir
5858
mountPath: /csi
59+
schedulerName: stork
5960
volumes:
6061
- name: socket-dir
6162
hostPath:

drivers/storage/portworx/testspec/csiDeploymentWithResizer_1.0.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ spec:
6767
volumeMounts:
6868
- name: socket-dir
6969
mountPath: /csi
70+
schedulerName: stork
7071
volumes:
7172
- name: socket-dir
7273
hostPath:

drivers/storage/portworx/testspec/csiDeploymentWithResizer_1_17.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ spec:
6767
volumeMounts:
6868
- name: socket-dir
6969
mountPath: /csi
70+
schedulerName: stork
7071
volumes:
7172
- name: socket-dir
7273
hostPath:

drivers/storage/portworx/testspec/csiDeployment_1.0.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ spec:
6969
volumeMounts:
7070
- name: socket-dir
7171
mountPath: /csi
72+
schedulerName: stork
7273
volumes:
7374
- name: socket-dir
7475
hostPath:

drivers/storage/portworx/testspec/csiDeployment_1.0_k8s116.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ spec:
7676
volumeMounts:
7777
- name: socket-dir
7878
mountPath: /csi
79+
schedulerName: stork
7980
volumes:
8081
- name: socket-dir
8182
hostPath:

drivers/storage/portworx/testspec/csiDeployment_1.0_k8s120.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ spec:
8282
args:
8383
- --v=3
8484
- --leader-election=true
85+
schedulerName: stork
8586
volumes:
8687
- name: socket-dir
8788
hostPath:

0 commit comments

Comments
 (0)