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

Cherrypick PWX-31562 : Operator's Windows support #1211

Merged
merged 1 commit into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,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.
csiDriverWin:
type: string
description: Desired image for csi driver for windows.
csiDriverRegistrar:
type: string
description: Desired image for CSI driver registrar.
Expand Down
116 changes: 116 additions & 0 deletions deploy/windows/px-csi-node-win.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
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
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/os
operator: In
values:
- windows
priorityClassName: system-node-critical
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
tolerations:
- key: os
value: Windows
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
Loading