Skip to content

Commit

Permalink
Cherrypick Windows support for 23.7.0 (#1225)
Browse files Browse the repository at this point in the history
* PWX-31562 : Operator's Windows support (#1211)

* 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

* PWX-33085, PWX-33086 : Add linux nodeaffinity for operator  (#1216)

* Add linux nodeaffinity for operator

* enable windows component only if k8s version is greater or equal to 1.25

* update linux as os in nodeaffinity

* update linux as os in nodeaffinity

* PWX-33087 : CsiWindowsDriver image is not populating is storagecluster desired images (#1219)

* Update yaml tag for csiWindowsDriver to match with spec generator

* update csiWindowsDriver tag in storagecluster crd

* correct nodeaffinity format

* rename toleration from windows to Windows

* build fix

* Add nodeaffinity to operator 23.7.0

---------

Co-authored-by: Piyush Nimbalkar <pnimbalkar@purestorage.com>
  • Loading branch information
nikita-bhatia and piyush-nimbalkar committed Aug 24, 2023
1 parent 619b99b commit bdd9044
Show file tree
Hide file tree
Showing 49 changed files with 1,133 additions and 4 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,10 @@ getccmconfigs:
getpluginconfigs:
cp deploy/plugin/* bin/configs/

getconfigs: cleanconfigs getccmconfigs getpluginconfigs
getwindowsconfig:
cp deploy/windows/* bin/configs

getconfigs: cleanconfigs getccmconfigs getpluginconfigs getwindowsconfig
wget -q '$(PX_DOC_HOST)/samples/k8s/pxc/portworx-prometheus-rule.yaml' -P bin/configs --no-check-certificate
wget -q '$(PROMETHEUS_OPERATOR_CRD_URL_PREFIX)/crd-alertmanagerconfigs.yaml' -O bin/configs/prometheus-crd-alertmanagerconfigs.yaml
wget -q '$(PROMETHEUS_OPERATOR_CRD_URL_PREFIX)/crd-alertmanagers.yaml' -O bin/configs/prometheus-crd-alertmanagers.yaml
Expand Down
6 changes: 6 additions & 0 deletions deploy/crds/core_v1_storagecluster_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3825,6 +3825,12 @@ spec:
csiNodeDriverRegistrar:
type: string
description: Desired image for CSI node driver registrar.
csiLivenessProbe:
type: string
description: Desired image for Liveness probe.
csiWindowsDriver:
type: string
description: Desired image for csi driver for windows.
csiDriverRegistrar:
type: string
description: Desired image for CSI driver registrar.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,14 @@ spec:
values:
- portworx-operator
topologyKey: kubernetes.io/hostname
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: kubernetes.io/os
operator: In
values:
- linux
containers:
- name: portworx-operator
image: docker.io/portworx/px-operator:23.7.0-dev
Expand Down
104 changes: 104 additions & 0 deletions deploy/windows/px-csi-node-win.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: px-csi-node-win
spec:
selector:
matchLabels:
app: px-csi-node-win
template:
metadata:
labels:
app: px-csi-node-win
spec:
containers:
- args:
- '--csi-address=$(CSI_ENDPOINT)'
- '--probe-timeout=3s'
- '--health-port=29643'
- '--v=2'
command:
- /livenessprobe.exe
env:
- name: CSI_ENDPOINT
value: 'unix://C:\\csi\\csi.sock'
name: liveness-probe
resources:
limits:
memory: 100Mi
requests:
cpu: 10m
memory: 40Mi
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: 'C:\csi'
name: plugin-dir
- args:
- '--v=2'
- '--csi-address=$(CSI_ENDPOINT)'
- '--kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)'
command:
- /csi-node-driver-registrar.exe
env:
- name: CSI_ENDPOINT
value: 'unix://C:\\csi\\csi.sock'
- name: DRIVER_REG_SOCK_PATH
value: 'C:\\var\\lib\\kubelet\\plugins\\pxd.portworx.com\\csi.sock'
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
livenessProbe:
exec:
command:
- /csi-node-driver-registrar.exe
- '--kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)'
- '--mode=kubelet-registration-probe'
failureThreshold: 3
initialDelaySeconds: 60
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 30
name: node-driver-registrar
resources:
limits:
memory: 100Mi
requests:
cpu: 10m
memory: 40Mi
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: 'C:\var\lib\kubelet'
name: kubelet-dir
- mountPath: 'C:\csi'
name: plugin-dir
- mountPath: 'C:\registration'
name: registration-dir
dnsPolicy: ClusterFirst
hostNetwork: true
priorityClassName: system-node-critical
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
volumes:
- hostPath:
path: 'C:\var\lib\kubelet\plugins_registry\'
type: Directory
name: registration-dir
- hostPath:
path: 'C:\var\lib\kubelet\'
type: Directory
name: kubelet-dir
- hostPath:
path: 'C:\var\lib\kubelet\plugins\pxd.portworx.com\'
type: DirectoryOrCreate
name: plugin-dir
updateStrategy:
rollingUpdate:
maxSurge: 0
maxUnavailable: 1
type: RollingUpdate
29 changes: 29 additions & 0 deletions deploy/windows/px-csi-win-driver.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: px-csi-win-driver
labels:
app: px-csi-win-driver
spec:
selector:
matchLabels:
app: px-csi-win-driver
template:
metadata:
labels:
app: px-csi-win-driver
spec:
serviceAccountName: portworx
containers:
- name: windowsinstaller
image: docker.io/cnbuautomation800/pxwincsidriver:v0.1
imagePullPolicy: Always
securityContext:
windowsOptions:
hostProcess: true
runAsUserName: "NT AUTHORITY\\SYSTEM"
command:
- powershell.exe
- -command
- csidriver\\pxinstall.ps1
hostNetwork: true
Loading

0 comments on commit bdd9044

Please sign in to comment.