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-31562 : Operator's Windows support #1176

Merged
merged 24 commits into from
Aug 15, 2023
Merged

Conversation

nikita-bhatia
Copy link
Contributor

@nikita-bhatia nikita-bhatia commented Jul 31, 2023

Changes done :

  1. Following node affinity is added to STC so that all the existing pods are scheduled on linux node only.

       requiredDuringSchedulingIgnoredDuringExecution:
         nodeSelectorTerms:
           - matchExpressions:
               - key: kubernetes.io/os
                 operator: In
                 values:
                   - linux
    
  2. DaemonSet added for Windows

  • px-csi-node-win-shared
  • px-installer-node-win
  1. Windows Storage Class added
  2. Airgap support added for windows pods

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

@nikita-bhatia nikita-bhatia changed the title Windows op support Operator's Windows support Jul 31, 2023
@pp511
Copy link
Contributor

pp511 commented Jul 31, 2023

@nikita-bhatia nodeSelectorTerms need to be updated for stork and stork-scheduler deployments as well. Any particular reason that is not being handled in this PR? Check the following ticket for more context https://portworx.atlassian.net/browse/PWX-28210

@github-actions github-actions bot added size/l and removed size/m labels Aug 1, 2023
@nikita-bhatia nikita-bhatia changed the title Operator's Windows support PWX-31562 : Operator's Windows support Aug 3, 2023
@github-actions
Copy link

github-actions bot commented Aug 7, 2023

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

deploy/crds/core_v1_storagecluster_crd.yaml Outdated Show resolved Hide resolved
drivers/storage/portworx/manifest/manifest.go Outdated Show resolved Hide resolved
drivers/storage/portworx/portworx.go Outdated Show resolved Hide resolved
drivers/storage/portworx/manifest/manifest.go Outdated Show resolved Hide resolved
deploy/windows/win.yaml Outdated Show resolved Hide resolved
Copy link
Member

@piyush-nimbalkar piyush-nimbalkar left a comment

Choose a reason for hiding this comment

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

I don't see the change to add the affinity to the storage cluster spec. Are we expecting the customer to add this or the spec generator?

drivers/storage/portworx/component/windows.go Outdated Show resolved Hide resolved
drivers/storage/portworx/component/windows.go Outdated Show resolved Hide resolved
drivers/storage/portworx/component/windows.go Outdated Show resolved Hide resolved
drivers/storage/portworx/component/windows.go Outdated Show resolved Hide resolved
drivers/storage/portworx/component/windows.go Outdated Show resolved Hide resolved
drivers/storage/portworx/portworx.go Outdated Show resolved Hide resolved
drivers/storage/portworx/testspec/win.yaml Outdated Show resolved Hide resolved
drivers/storage/portworx/component/windows.go Outdated Show resolved Hide resolved
pkg/controller/storagecluster/stork.go Outdated Show resolved Hide resolved
Copy link
Contributor

@pp511 pp511 left a comment

Choose a reason for hiding this comment

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

@nikita-bhatia I think we need the Windows feature behind a feature flag. Can you help me understand how is it being achieved?

@nikita-bhatia
Copy link
Contributor Author

@nikita-bhatia I think we need the Windows feature behind a feature flag. Can you help me understand how is it being achieved?

@pp511 It was decided not to have feature flag. Currently, it is being achieved by checking the existence of windows node, if there is no windows node in cluster, this feature will not work.
CC : @pnookala-px

@harsh-px
Copy link
Contributor

re: feature flag, I checked the code and I think we are fine without an explicit one. The windows component does not get enabled if no windows node is detected. So on all non-windows setups, the windows component code will be inactive.

@pp511 you okay with this?

@harsh-px
Copy link
Contributor

@nikita-bhatia can we make travis green?

Copy link
Member

@piyush-nimbalkar piyush-nimbalkar left a comment

Choose a reason for hiding this comment

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

Minor comments, but rest looks good.

Please update the branch and fix the failing csi unit test.

deploy/windows/px-installer-node-win.yaml Outdated Show resolved Hide resolved
drivers/storage/portworx/deployment_test.go Outdated Show resolved Hide resolved
drivers/storage/portworx/manifest/manifest.go Outdated Show resolved Hide resolved
drivers/storage/portworx/portworx_test.go Outdated Show resolved Hide resolved
drivers/storage/portworx/component/windows.go Outdated Show resolved Hide resolved
@pp511
Copy link
Contributor

pp511 commented Aug 14, 2023

re: feature flag, I checked the code and I think we are fine without an explicit one. The windows component does not get enabled if no windows node is detected. So on all non-windows setups, the windows component code will be inactive.

@pp511 you okay with this?

@harsh-px I am good.

@nikita-bhatia
Copy link
Contributor Author

nikita-bhatia commented Aug 14, 2023

@piyush-nimbalkar @pp511 re-requesting review, after rebasing branch to master and addressing all review comments.

@codecov
Copy link

codecov bot commented Aug 14, 2023

Codecov Report

Patch coverage: 83.53% and project coverage change: +0.06% 🎉

Comparison is base (7843b18) 75.70% compared to head (8ce0671) 75.77%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1176      +/-   ##
==========================================
+ Coverage   75.70%   75.77%   +0.06%     
==========================================
  Files          64       65       +1     
  Lines       18246    18410     +164     
==========================================
+ Hits        13814    13951     +137     
- Misses       3449     3464      +15     
- Partials      983      995      +12     
Files Changed Coverage Δ
drivers/storage/portworx/component/windows.go 80.85% <80.85%> (ø)
drivers/storage/portworx/deployment.go 95.91% <100.00%> (+0.01%) ⬆️
drivers/storage/portworx/manifest/manifest.go 91.50% <100.00%> (+0.11%) ⬆️
drivers/storage/portworx/portworx.go 83.10% <100.00%> (+0.03%) ⬆️
drivers/storage/portworx/util/csi_generator.go 100.00% <100.00%> (ø)
drivers/storage/portworx/util/util.go 76.18% <100.00%> (+0.32%) ⬆️
pkg/migration/generate.go 88.87% <100.00%> (+0.05%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@piyush-nimbalkar piyush-nimbalkar left a comment

Choose a reason for hiding this comment

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

Thanks for fixing all the comments @nikita-bhatia.
Everything looks good!

apiVersion: apps/v1
kind: DaemonSet
metadata:
name: px-csi-node-win-shared
Copy link
Member

Choose a reason for hiding this comment

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

Why name the daemonset as shared? Let's rename this back to px-csi-node-win.
The previous comment was for the storageclass because it was a shared storageclass.

Copy link
Contributor

@pp511 pp511 left a comment

Choose a reason for hiding this comment

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

Lgtm. Thanks @nikita-bhatia

@nikita-bhatia
Copy link
Contributor Author

Thanks @piyush-nimbalkar @pp511 for the approval, merging this to master.

@nikita-bhatia nikita-bhatia merged commit 4810a06 into master Aug 15, 2023
8 checks passed
@nikita-bhatia nikita-bhatia deleted the windows_op_support branch August 15, 2023 06:19
nikita-bhatia added a commit that referenced this pull request Aug 16, 2023
* Add windows operator support

* update daemonset labels

* Replace nodeselecter with nodeaffinity

* Add tests

* add nodeselector for stork and stork-scheduler

* remove nodeaffinity from components

* add nodeselector as linux in storagecluster

* address review comments

* address review comments

* address review comments

* update windows specific affinity and tolerations

* add px-installer daemonset for windows

* fix failing tests

* fix failing tests

* remove fmt logs

* set default csi-installer image for windows

* fix failing test

* fix review comments

* fix failing test

* rename px driver and node-win daemonset file names

* remove fmt logs

* rename px-csi-node-win-shared daemonset to px-csi-node-win
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