Skip to content

Commit 37b3b7b

Browse files
committed
Add windows driver installation support
This PR adds windows driver support. It adds a windows base dir to install base yaml files. It also adds a windows alpha kustomization file. To install driver for windows, first set env GCE_PD_DRIVER_VERSION=windows/alpha and run deploy/kubernetes/deploy-driver-win.sh script.
1 parent ac1f8c0 commit 37b3b7b

File tree

5 files changed

+447
-0
lines changed

5 files changed

+447
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
kind: StatefulSet
2+
apiVersion: apps/v1
3+
metadata:
4+
name: csi-gce-pd-controller
5+
spec:
6+
serviceName: "csi-gce-pd"
7+
replicas: 1
8+
selector:
9+
matchLabels:
10+
app: gcp-compute-persistent-disk-csi-driver
11+
template:
12+
metadata:
13+
labels:
14+
app: gcp-compute-persistent-disk-csi-driver
15+
spec:
16+
# Host network must be used for interaction with Workload Identity in GKE
17+
# since it replaces GCE Metadata Server with GKE Metadata Server. Remove
18+
# this requirement when issue is resolved and before any exposure of
19+
# metrics ports
20+
hostNetwork: false
21+
serviceAccountName: csi-gce-pd-controller-sa
22+
priorityClassName: csi-gce-pd-controller
23+
containers:
24+
- name: csi-provisioner
25+
image: gke.gcr.io/csi-provisioner
26+
args:
27+
- "--v=5"
28+
- "--csi-address=/csi/csi.sock"
29+
- "--feature-gates=Topology=true"
30+
# - "--run-controller-service=false" # disable the controller service of the CSI driver
31+
# - "--run-node-service=false" # disable the node service of the CSI driver
32+
volumeMounts:
33+
- name: socket-dir
34+
mountPath: /csi
35+
- name: csi-attacher
36+
image: gke.gcr.io/csi-attacher
37+
args:
38+
- "--v=5"
39+
- "--csi-address=/csi/csi.sock"
40+
volumeMounts:
41+
- name: socket-dir
42+
mountPath: /csi
43+
- name: csi-resizer
44+
image: gke.gcr.io/csi-resizer
45+
args:
46+
- "--v=5"
47+
- "--csi-address=/csi/csi.sock"
48+
volumeMounts:
49+
- name: socket-dir
50+
mountPath: /csi
51+
- name: csi-snapshotter
52+
image: gke.gcr.io/csi-snapshotter
53+
args:
54+
- "--v=5"
55+
- "--csi-address=/csi/csi.sock"
56+
volumeMounts:
57+
- name: socket-dir
58+
mountPath: /csi
59+
- name: gce-pd-driver
60+
# Don't change base image without changing pdImagePlaceholder in
61+
# test/k8s-integration/main.go
62+
image: gke.gcr.io/gcp-compute-persistent-disk-csi-driver
63+
args:
64+
- "--v=5"
65+
- "--endpoint=unix:/csi/csi.sock"
66+
env:
67+
- name: GOOGLE_APPLICATION_CREDENTIALS
68+
value: "/etc/cloud-sa/cloud-sa.json"
69+
volumeMounts:
70+
- name: socket-dir
71+
mountPath: /csi
72+
- name: cloud-sa-volume
73+
readOnly: true
74+
mountPath: "/etc/cloud-sa"
75+
volumes:
76+
- name: socket-dir
77+
emptyDir: {}
78+
- name: cloud-sa-volume
79+
secret:
80+
secretName: cloud-sa
81+
# This is needed due to https://github.com/kubernetes-sigs/kustomize/issues/504
82+
volumeClaimTemplates: []
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
commonLabels:
2+
k8s-app: gcp-compute-persistent-disk-csi-driver
3+
namespace:
4+
gce-pd-csi-driver
5+
resources:
6+
- node_windows.yaml
7+
- controller.yaml
8+
- setup-cluster.yaml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
#TODO(#40): Force DaemonSet to not run on master.
2+
kind: DaemonSet
3+
apiVersion: apps/v1
4+
metadata:
5+
name: csi-gce-pd-node
6+
spec:
7+
selector:
8+
matchLabels:
9+
app: gcp-compute-persistent-disk-csi-driver
10+
template:
11+
metadata:
12+
labels:
13+
app: gcp-compute-persistent-disk-csi-driver
14+
spec:
15+
# Host network must be used for interaction with Workload Identity in GKE
16+
# since it replaces GCE Metadata Server with GKE Metadata Server. Remove
17+
# this requirement when issue is resolved and before any exposure of
18+
# metrics ports.
19+
hostNetwork: false
20+
priorityClassName: csi-gce-pd-node
21+
serviceAccountName: csi-gce-pd-node-sa
22+
containers:
23+
- name: csi-driver-registrar
24+
image: gke.gcr.io/csi-node-driver-registrar
25+
args:
26+
- "--v=5"
27+
- "--csi-address=unix://C:\\csi\\csi.sock"
28+
- "--kubelet-registration-path=C:\\var\\lib\\kubelet\\plugins\\pd.csi.storage.gke.io\\csi.sock"
29+
#lifecycle:
30+
# preStop:
31+
# exec:
32+
# command: ["/bin/sh", "-c", "rm -rf /registration/pd.csi.storage.gke.io /registration/pd.csi.storage.gke.io-reg.sock"]
33+
env:
34+
- name: KUBE_NODE_NAME
35+
valueFrom:
36+
fieldRef:
37+
fieldPath: spec.nodeName
38+
volumeMounts:
39+
- name: plugin-dir
40+
mountPath: /csi
41+
- name: registration-dir
42+
mountPath: /registration
43+
- name: gce-pd-driver
44+
# securityContext:
45+
# privileged: true
46+
# Don't change base image without changing pdImagePlaceholder in
47+
# test/k8s-integration/main.go
48+
image: gke.gcr.io/gcp-compute-persistent-disk-csi-driver-win
49+
args:
50+
- "--v=5"
51+
- "--endpoint=unix:/csi/csi.sock"
52+
volumeMounts:
53+
- name: kubelet-dir
54+
mountPath: C:\var\lib\kubelet
55+
- name: plugin-dir
56+
mountPath: C:\csi
57+
- name: csi-proxy-disk-pipe
58+
mountPath: \\.\pipe\csi-proxy-disk-v1alpha1
59+
- name: csi-proxy-volume-pipe
60+
mountPath: \\.\pipe\csi-proxy-volume-v1alpha1
61+
- name: csi-proxy-filesystem-pipe
62+
mountPath: \\.\pipe\csi-proxy-filesystem-v1alpha1
63+
nodeSelector:
64+
kubernetes.io/os: windows
65+
volumes:
66+
- name: csi-proxy-disk-pipe
67+
hostPath:
68+
path: \\.\pipe\csi-proxy-disk-v1alpha1
69+
type: ""
70+
- name: csi-proxy-volume-pipe
71+
hostPath:
72+
path: \\.\pipe\csi-proxy-volume-v1alpha1
73+
type: ""
74+
- name: csi-proxy-filesystem-pipe
75+
hostPath:
76+
path: \\.\pipe\csi-proxy-filesystem-v1alpha1
77+
type: ""
78+
- name: registration-dir
79+
hostPath:
80+
path: C:\var\lib\kubelet\plugins_registry\
81+
type: Directory
82+
- name: kubelet-dir
83+
hostPath:
84+
path: C:\var\lib\kubelet\
85+
type: Directory
86+
- name: plugin-dir
87+
hostPath:
88+
path: C:\var\lib\kubelet\plugins\pd.csi.storage.gke.io\
89+
type: DirectoryOrCreate
90+
# https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
91+
# See "special case". This will tolerate everything. Node component should
92+
# be scheduled on all nodes.
93+
tolerations:
94+
- operator: Exists

0 commit comments

Comments
 (0)