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

Operator's Windows container support #1079

Closed
wants to merge 17 commits into from
Closed

Conversation

nikita-bhatia
Copy link
Contributor

@nikita-bhatia nikita-bhatia commented Jun 19, 2023

Changes done :

  1. All px deployments will be appended with
    “nodeSelector:
    kubernetes.io/os: linux”
  2. csidriver pxd.portworx.com modified to have ‘attachedrequired = true
  3. DaemonSet added for Windows
  4. Windows Storage Class added
  5. Cluster role the px.csi.driver has additional permission on volumeattachments/status

Testing :
Tested on OCP cluster for with mix of linux and windows node

Few changes will be taken in next phase , this is initial PR to get Portworx support on windows node.

Makefile Outdated Show resolved Hide resolved
deploy/windows/win.yaml Show resolved Hide resolved
drivers/storage/portworx/component/windows.go Outdated Show resolved Hide resolved
return nil
}

func (w *windows) createStorageClass() error {
Copy link
Member

Choose a reason for hiding this comment

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

Can we move this to the storage_class component instead of adding it to this windows component?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason why this was kept here is we can have control over creation of this storage class on detection of windows only, do we still want to move it?

return getErr
}

// pxutil.ApplyStorageClusterSettingsToPodSpec(cluster, &daemonSet.Spec.Template.Spec)
Copy link
Member

Choose a reason for hiding this comment

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

We need to add this, otherwise the DS will get created on nodes where pod is not supposed to be deployed or it won't honor the image registry, pull policy, etc from the stroageclass.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The only reason this is commented right now is because this is overwrting nodeselector from storagecluster, for windows support we have nodeaffinity as os=linux and for this daemonset, we need nodeaffinity as os=windows.

This is planned to be taken in next PR.

"--csi-address=$(ADDRESS)",
"--leader-election=true",
"--leader-election-type=" + leaderElectionType,
"--http-endpoint=:8080",
Copy link
Member

Choose a reason for hiding this comment

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

Is this arg needed only for windows?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes

@@ -675,13 +678,13 @@ func getCSIDeploymentSpec(
deployment.Spec.Template.Spec.Containers,
v1.Container{
Name: csiAttacherContainerName,
Image: attacherImage,
Image: "registry.k8s.io/sig-storage/csi-attacher:v4.3.0",
Copy link
Member

Choose a reason for hiding this comment

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

This image should come from the csi_generator like the other csi images. Let's not hard code it here.

Choose a reason for hiding this comment

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

Hold off on adding the attacher sidecar until I see why we need it. I am not convinced we need volume attachment objects and the volume attacher for windows support.

Choose a reason for hiding this comment

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

We don't need the above sidecar for now.

drivers/storage/portworx/component/csi.go Outdated Show resolved Hide resolved
@@ -190,6 +190,9 @@ func (g *CSIGenerator) GetCSIConfiguration() *CSIConfiguration {
cv.IncludeCsiDriverInfo = true
}

cv.IncludeAttacher = true
Copy link
Member

Choose a reason for hiding this comment

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

Let's make this conditional and not set to true all the time.

Choose a reason for hiding this comment

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

Not required for now.

drivers/storage/portworx/util/csi_generator.go Outdated Show resolved Hide resolved
@github-actions github-actions bot added size/xl and removed size/m labels Jun 21, 2023
@github-actions
Copy link

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

@github-actions github-actions bot added size/xl and removed size/m labels Jun 21, 2023
@github-actions
Copy link

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

@github-actions github-actions bot added size/m and removed size/xl labels Jun 21, 2023
- hostPath:
path: \\.\pipe\csi-proxy-filesystem-v1
type: ''
name: csi-proxy-fs-pipe-v1

Choose a reason for hiding this comment

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

Looks like you copied this code from the SMB CSI Driver:
https://github.com/kubernetes-csi/csi-driver-smb/blob/d18eaf64b2ebd2ec299d1090c4262d02cd0ac161/deploy/csi-smb-node-windows.yaml#L120

Let's remove deadcode we're not using when copying external code

Choose a reason for hiding this comment

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

Same for other volumes below... remove volumes that are not mounted anywhere

@github-actions
Copy link

This PR is stale because it has been in review for 3 days with no activity.

@nikita-bhatia nikita-bhatia deleted the windows_support branch September 6, 2023 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants