From 54c2983d4e020c4d9f3247bc4186d80fc9bb0641 Mon Sep 17 00:00:00 2001 From: Jing Xu Date: Mon, 28 Sep 2020 17:46:26 -0700 Subject: [PATCH] Add CSI Windows Suppoort Doc add doc for csi windows support --- README.md | 6 ++++- docs/kubernetes/user-guides/basic.md | 8 +++++- docs/kubernetes/user-guides/windows.md | 35 ++++++++++++++++++++++++++ examples/kubernetes/demo-windows.yaml | 34 +++++++++++++++++++++++++ examples/kubernetes/demo-zonal-sc.yaml | 12 +++++++++ 5 files changed, 93 insertions(+), 2 deletions(-) create mode 100644 docs/kubernetes/user-guides/windows.md create mode 100644 examples/kubernetes/demo-windows.yaml diff --git a/README.md b/README.md index aa9129b17..7ab67fc48 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,10 @@ This driver supports only one topology key: `topology.gke.io/zone` that represents availability by zone (e.g. `us-central1-c`, etc.). +### CSI Windows Support + +GCE PD driver starts to support CSI Windows with [CSI Proxy] (https://github.com/kubernetes-csi/csi-proxy). It requires csi-proxy.exe to be installed on every Windows node. Please see more details in CSI Windows page (docs/kubernetes/user-guides/windows.md) + ### Features in Development | Feature | Stage | Min Kubernetes Master Version | Min Kubernetes Nodes Version | Min Driver Version | Deployment Overlay | @@ -72,7 +76,7 @@ that represents availability by zone (e.g. `us-central1-c`, etc.). | Snapshots | Beta | 1.17 | Any | v1.0.0 | Stable | | Resize (Expand) | Alpha | 1.14 | 1.14 | v0.6.0 | Alpha | | Resize (Expand) | Beta | 1.16 | 1.16 | v0.7.0 | Stable | -| Windows* | Beta | 1.18 | 1.18 | v1.1.0 | Stable | +| Windows* | Beta | 1.18 | 1.18 | v1.1.0 | Alpha | * For Windows, it is recommended to use this driver with CSI proxy v0.2.2+. diff --git a/docs/kubernetes/user-guides/basic.md b/docs/kubernetes/user-guides/basic.md index 15442a62a..52f7b112f 100644 --- a/docs/kubernetes/user-guides/basic.md +++ b/docs/kubernetes/user-guides/basic.md @@ -8,7 +8,7 @@ Kubernetes 1.14. See [instructions](driver-install.md) -## Zonal PD example +## Zonal PD example for Linux or Windows cluster This example provisions a zonal PD in both single-zone and regional clusters. 1. Create example Zonal Storage Class @@ -17,10 +17,16 @@ $ kubectl apply -f ./examples/kubernetes/demo-zonal-sc.yaml ``` 2. Create example PVC and Pod +For Linux cluster, ``` $ kubectl apply -f ./examples/kubernetes/demo-pod.yaml ``` +For Windows cluster, +``` +$ kubectl apply -f ./examples/kubernetes/demo-windows.yaml +``` + 3. Verify PV is created and bound to PVC ``` $ kubectl get pvc diff --git a/docs/kubernetes/user-guides/windows.md b/docs/kubernetes/user-guides/windows.md new file mode 100644 index 000000000..f408f9d91 --- /dev/null +++ b/docs/kubernetes/user-guides/windows.md @@ -0,0 +1,35 @@ +# Kubernetes CSI Windows User Guide + +>**Attention:** CSI Windows Beta is only available in the driver version v1.1.0+ +>**Attention:** CSI Windows Alpha is only available in the driver version v1.0.0-v1.0.* + +### Install CSI Proxy binary +CSI proxy can be installed as binary or run as a Windows service on each Windows node. Please see details on CSI Proxy [installation and usage page](https://github.com/kubernetes-csi/csi-proxy/blob/master/README.md#usage). + +If you are using kube-up to start a GCE Kubernetes cluster, starting Kubernetes 1.19, [CSI Proxy Alpha](https://github.com/kubernetes-csi/csi-proxy/releases/tag/v0.1.0) binary is automatically installed during node start up. In Kubernetes 1.20, [CSI Proxy Beta.2 v0.2.2](https://github.com/kubernetes-csi/csi-proxy/releases/tag/v0.2.2) is installed and running as a windows service to improve its stablibity. + +For GKE cluster, starting from 1.18, [CSI Proxy Beta](https://github.com/kubernetes-csi/csi-proxy/releases/tag/v0.2.2) will be installed automatically. GCE PD driver will be also automatically deployed as daemonSet on GKE. Please follow instruction here to create a [GKE Windows cluster](https://cloud.google.com/kubernetes-engine/docs/how-to/creating-a-cluster-windows). + + +### Install Driver with CSI Windows support + +1. [One-time per project] Create GCP service account for the CSI driver and set required roles + +``` +$ PROJECT=your-project-here # GCP project +$ GCE_PD_SA_NAME=my-gce-pd-csi-sa # Name of the service account to create +$ GCE_PD_SA_DIR=/my/safe/credentials/directory # Directory to save the service account key +$ ./deploy/setup-project.sh +``` + +2. Deploy driver to Kubernetes Cluster + +``` +$ GCE_PD_SA_DIR=/my/safe/credentials/directory # Directory to get the service account key +$ GCE_PD_DRIVER_VERSION=alpha # Currently alpha deploy Driver version with Windows Alpha support. Will add beta supporot to beta GCE_PD_DRIVER_VERSION deployment script. +$ ./deploy/kubernetes/deploy-driver.sh +``` + +3. Create a pod on Windows node + +See [instructions](basic.md) \ No newline at end of file diff --git a/examples/kubernetes/demo-windows.yaml b/examples/kubernetes/demo-windows.yaml new file mode 100644 index 000000000..1b76cfe01 --- /dev/null +++ b/examples/kubernetes/demo-windows.yaml @@ -0,0 +1,34 @@ +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: podpvc-windows +spec: + accessModes: + - ReadWriteOnce + storageClassName: csi-gce-pd-ntfs + resources: + requests: + storage: 1Gi + +--- + +apiVersion: v1 +kind: Pod +metadata: + name: web-windows +spec: + tolerations: + - operator: Exists + nodeSelector: + kubernetes.io/os: windows + containers: + - name: web-server + image: k8s.gcr.io/e2e-test-images/agnhost:2.21 + volumeMounts: + - mountPath: /www/html + name: mypvc + volumes: + - name: mypvc + persistentVolumeClaim: + claimName: podpvc-windows + readOnly: false diff --git a/examples/kubernetes/demo-zonal-sc.yaml b/examples/kubernetes/demo-zonal-sc.yaml index 631d192f7..b040f8d9e 100644 --- a/examples/kubernetes/demo-zonal-sc.yaml +++ b/examples/kubernetes/demo-zonal-sc.yaml @@ -6,3 +6,15 @@ provisioner: pd.csi.storage.gke.io parameters: type: pd-standard volumeBindingMode: WaitForFirstConsumer + +--- +#Zonal StorageClass for fsType ntfs +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: csi-gce-pd-ntfs +provisioner: pd.csi.storage.gke.io +parameters: + type: pd-standard + csi.storage.k8s.io/fstype: ntfs +volumeBindingMode: WaitForFirstConsumer