diff --git a/README.md b/README.md index f382ee943..b28ba657e 100755 --- a/README.md +++ b/README.md @@ -15,6 +15,8 @@ The driver natively supports the following ways for you to provision your Cloud * **Static provisioning**: You create a PersistentVolume resource that refers to the Cloud Storage buckets bucket. Your client Pod can then reference a PersistentVolumeClaim that is bound to this PersistentVolume. To learn more about this workflow, see [Configure a Pod to Use a PersistentVolume for Storage](https://kubernetes.io/docs/tasks/configure-pod-container/configure-persistent-volume-storage/). +Currently, the driver does not support [Dynamic Volume Provisioning](https://kubernetes.io/docs/concepts/storage/dynamic-provisioning/). + ### Benefits * The Cloud Storage FUSE CSI driver on your cluster turns on automatic deployment and management of the driver. The driver works on both GKE Standard and Autopilot clusters. To leverage this benefit, you need to use GKE to automatically deploy and manage the CSI driver as a add-on feature. See the GKE documentation [Access Cloud Storage buckets with the Cloud Storage FUSE CSI driver](https://cloud.google.com/kubernetes-engine/docs/how-to/persistent-volumes/cloud-storage-fuse-csi-driver). diff --git a/docs/usage.md b/docs/usage.md index f91086e37..1c995885f 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -107,7 +107,7 @@ The Cloud Storage FUSE CSI driver allows developers to use standard Kubernetes A 1. [Static Provisioning](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#static) using a PersistentVolumeClaim bound to the PersistentVolume 2. Using [CSI Ephemeral Inline volumes](https://kubernetes.io/docs/concepts/storage/ephemeral-volumes/#csi-ephemeral-volumes) -The Cloud Storage FUSE CSI driver natively supports the above volume configuration methods. Currently, the [Dynamic Provisioning](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#dynamic) is not officially supported. +The Cloud Storage FUSE CSI driver natively supports the above volume configuration methods. Currently, the driver does not support [Dynamic Volume Provisioning](https://kubernetes.io/docs/concepts/storage/dynamic-provisioning/). ### Prepare to mount Cloud Storage FUSE buckets diff --git a/examples/README.md b/examples/README.md index 84f4432fe..62ce522fe 100644 --- a/examples/README.md +++ b/examples/README.md @@ -1,48 +1,17 @@ # Example Applications ## Install the CSI driver + See the documentation [Cloud Storage FUSE CSI Driver Installation](../docs/installation.md). ## Set up access to GCS buckets + See the documentation [Cloud Storage FUSE CSI Driver Usage](../docs/usage.md#set-up-access-to-gcs-buckets-via-gke-workload-identity). ## Install Example Applications -### Dynamic Provisioning Example (Unstable) -```bash -# create a secret containing the Kubernetes Service Account information -kubectl create secret generic gcs-csi-secret --namespace gcs-csi-example \ - --from-literal=projectID=${GCS_BUCKET_PROJECT_ID} \ - --from-literal=serviceAccountName=gcs-csi \ - --from-literal=serviceAccountNamespace=gcs-csi-example - -# deloy a StorageClass for non-root usage -kubectl apply -f ./examples/dynamic/storageclass-non-root.yaml - -# deploy Deployment -kubectl apply -f ./examples/dynamic/deployment.yaml -kubectl apply -f ./examples/dynamic/deployment-non-root.yaml - -# deploy StatefulSet -kubectl apply -f ./examples/dynamic/statefulset.yaml -kubectl apply -f ./examples/dynamic/statefulset-non-root.yaml - -# clean up -kubectl delete -f ./examples/dynamic/deployment.yaml -kubectl delete -f ./examples/dynamic/deployment-non-root.yaml -kubectl delete -f ./examples/dynamic/statefulset.yaml -kubectl delete -f ./examples/dynamic/statefulset-non-root.yaml - -# After the StatefulSet application get uninstalled, -# you will need to clean up the PVCs manually. -kubectl delete -n gcs-csi-example pvc gcs-bucket-gcp-gcs-csi-dynamic-statefulset-example-0 gcs-bucket-gcp-gcs-csi-dynamic-statefulset-example-1 gcs-bucket-gcp-gcs-csi-dynamic-statefulset-example-2 -kubectl delete -n gcs-csi-example pvc gcs-bucket-gcp-gcs-csi-dynamic-statefulset-non-root-example-0 gcs-bucket-gcp-gcs-csi-dynamic-statefulset-non-root-example-1 gcs-bucket-gcp-gcs-csi-dynamic-statefulset-non-root-example-2 - -# clean up the secret and non-root StorageClass after all the PVs are deleted -kubectl delete -f ./examples/dynamic/storageclass-non-root.yaml -kubectl delete secret gcs-csi-secret --namespace gcs-csi-example -``` ### Static Provisioning Example + ```bash # replace with your pre-provisioned GCS bucket name GCS_BUCKET_NAME=your-bucket-name @@ -60,6 +29,7 @@ kubectl delete -f ./examples/static/pv-pvc-deploymen-non-root.yaml ``` ### Ephemeral Volume Example + ```bash # replace with your pre-provisioned GCS bucket name GCS_BUCKET_NAME=your-bucket-name @@ -79,6 +49,7 @@ kubectl delete -f ./examples/ephemeral/deployment-two-vols.yaml ``` ### Batch Job Example + ```bash # replace with your pre-provisioned GCS bucket name GCS_BUCKET_NAME=your-bucket-name @@ -92,6 +63,7 @@ kubectl delete -f ./examples/batch-job/job.yaml ``` ### Performance Testing + ```bash # replace with your pre-provisioned GCS bucket name GCS_BUCKET_NAME=your-bucket-name @@ -106,6 +78,7 @@ kubectl delete -f ./examples/perf-test/pod.yaml ``` ### Cloud Storage FUSE E2E Test + ```bash # replace with your pre-provisioned GCS bucket name GCS_BUCKET_NAME=your-bucket-name @@ -120,6 +93,7 @@ kubectl delete -f ./examples/gcsfuse-e2e-test/pod.yaml ``` ### PyTorch Application Example + ```bash # add a new nood pool with GPU CLUSTER_NAME= @@ -155,6 +129,7 @@ kubectl delete -f ./examples/pytorch/train-job-pytorch.yaml ``` ### Machine Learning Application Example + ```bash # replace with your pre-provisioned GCS bucket name GCS_BUCKET_NAME=your-bucket-name @@ -168,4 +143,4 @@ kubectl port-forward jupyter-notebook-server 8888:8888 # clean up kubectl delete -f ./examples/machineLearning/jupyter-notebook-server.yaml -``` \ No newline at end of file +``` diff --git a/examples/dynamic/deployment-non-root.yaml b/examples/dynamic/deployment-non-root.yaml deleted file mode 100755 index 101fc1ada..000000000 --- a/examples/dynamic/deployment-non-root.yaml +++ /dev/null @@ -1,97 +0,0 @@ -# Copyright 2018 The Kubernetes Authors. -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: gcp-gcs-csi-dynamic-non-root-pvc - namespace: gcs-csi-example -spec: - storageClassName: gcs-fuse-class-non-root - accessModes: [ "ReadWriteMany" ] - resources: - requests: - storage: 5Gi ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: gcp-gcs-csi-dynamic-deployment-non-root-example - namespace: gcs-csi-example -spec: - replicas: 3 - selector: - matchLabels: - app: gcp-gcs-csi-dynamic-deployment-non-root-example - template: - metadata: - labels: - app: gcp-gcs-csi-dynamic-deployment-non-root-example - annotations: - gke-gcsfuse/volumes: "true" - spec: - securityContext: - runAsUser: 1001 - runAsGroup: 2002 - fsGroup: 3003 - containers: - - name: writer - image: busybox - resources: - limits: - cpu: 100m - memory: 100Mi - requests: - cpu: 10m - memory: 80Mi - command: - - "/bin/sh" - - "-c" - - touch /data/${MY_POD_NAME} && while true; do echo $(date) >> /data/${MY_POD_NAME}; sleep 1; done - env: - - name: MY_POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - volumeMounts: - - name: gcp-gcs-csi-pvc - mountPath: /data - - name: reader - image: busybox - resources: - limits: - cpu: 100m - memory: 100Mi - requests: - cpu: 10m - memory: 80Mi - command: - - "/bin/sh" - - "-c" - - tail -f /data/${MY_POD_NAME} - env: - - name: MY_POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - volumeMounts: - - name: gcp-gcs-csi-pvc - mountPath: /data - readOnly: true - serviceAccountName: gcs-csi - volumes: - - name: gcp-gcs-csi-pvc - persistentVolumeClaim: - claimName: gcp-gcs-csi-dynamic-non-root-pvc \ No newline at end of file diff --git a/examples/dynamic/deployment.yaml b/examples/dynamic/deployment.yaml deleted file mode 100755 index b94e66a20..000000000 --- a/examples/dynamic/deployment.yaml +++ /dev/null @@ -1,93 +0,0 @@ -# Copyright 2018 The Kubernetes Authors. -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: gcp-gcs-csi-dynamic-pvc - namespace: gcs-csi-example -spec: - storageClassName: gcs-fuse-class - accessModes: [ "ReadWriteMany" ] - resources: - requests: - storage: 5Gi ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: gcp-gcs-csi-dynamic-deployment-example - namespace: gcs-csi-example -spec: - replicas: 3 - selector: - matchLabels: - app: gcp-gcs-csi-dynamic-deployment-example - template: - metadata: - labels: - app: gcp-gcs-csi-dynamic-deployment-example - annotations: - gke-gcsfuse/volumes: "true" - spec: - containers: - - name: writer - image: busybox - resources: - limits: - cpu: 100m - memory: 100Mi - requests: - cpu: 10m - memory: 80Mi - command: - - "/bin/sh" - - "-c" - - touch /data/${MY_POD_NAME} && while true; do echo $(date) >> /data/${MY_POD_NAME}; sleep 1; done - env: - - name: MY_POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - volumeMounts: - - name: gcp-gcs-csi-pvc - mountPath: /data - - name: reader - image: busybox - resources: - limits: - cpu: 100m - memory: 100Mi - requests: - cpu: 10m - memory: 80Mi - command: - - "/bin/sh" - - "-c" - - tail -f /data/${MY_POD_NAME} - env: - - name: MY_POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - volumeMounts: - - name: gcp-gcs-csi-pvc - mountPath: /data - readOnly: true - serviceAccountName: gcs-csi - volumes: - - name: gcp-gcs-csi-pvc - persistentVolumeClaim: - claimName: gcp-gcs-csi-dynamic-pvc \ No newline at end of file diff --git a/examples/dynamic/statefulset-non-root.yaml b/examples/dynamic/statefulset-non-root.yaml deleted file mode 100755 index 30d806c81..000000000 --- a/examples/dynamic/statefulset-non-root.yaml +++ /dev/null @@ -1,91 +0,0 @@ -# Copyright 2018 The Kubernetes Authors. -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: gcp-gcs-csi-dynamic-statefulset-non-root-example - namespace: gcs-csi-example -spec: - selector: - matchLabels: - app: gcp-gcs-csi-dynamic-statefulset-non-root-example - serviceName: gcp-gcs-csi-dynamic-statefulset-non-root-example - replicas: 3 - template: - metadata: - labels: - app: gcp-gcs-csi-dynamic-statefulset-non-root-example - annotations: - gke-gcsfuse/volumes: "true" - spec: - securityContext: - runAsUser: 1001 - runAsGroup: 2002 - fsGroup: 3003 - serviceAccountName: gcs-csi - containers: - - name: writer - image: busybox - resources: - limits: - cpu: 100m - memory: 100Mi - requests: - cpu: 10m - memory: 80Mi - command: - - "/bin/sh" - - "-c" - - touch /data/${MY_POD_NAME} && while true; do echo $(date) >> /data/${MY_POD_NAME}; sleep 1; done - env: - - name: MY_POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - volumeMounts: - - name: gcs-bucket - mountPath: /data - - name: reader - image: busybox - resources: - limits: - cpu: 100m - memory: 100Mi - requests: - cpu: 10m - memory: 80Mi - command: - - "/bin/sh" - - "-c" - - tail -f /data/${MY_POD_NAME} - env: - - name: MY_POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - volumeMounts: - - name: gcs-bucket - mountPath: /data - readOnly: true - volumeClaimTemplates: - - metadata: - name: gcs-bucket - spec: - accessModes: [ "ReadWriteMany" ] - storageClassName: gcs-fuse-class-non-root - resources: - requests: - storage: 5Gi diff --git a/examples/dynamic/statefulset.yaml b/examples/dynamic/statefulset.yaml deleted file mode 100755 index 739b4168e..000000000 --- a/examples/dynamic/statefulset.yaml +++ /dev/null @@ -1,87 +0,0 @@ -# Copyright 2018 The Kubernetes Authors. -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: gcp-gcs-csi-dynamic-statefulset-example - namespace: gcs-csi-example -spec: - selector: - matchLabels: - app: gcp-gcs-csi-dynamic-statefulset-example - serviceName: gcp-gcs-csi-dynamic-statefulset-example - replicas: 3 - template: - metadata: - labels: - app: gcp-gcs-csi-dynamic-statefulset-example - annotations: - gke-gcsfuse/volumes: "true" - spec: - serviceAccountName: gcs-csi - containers: - - name: writer - image: busybox - resources: - limits: - cpu: 100m - memory: 100Mi - requests: - cpu: 10m - memory: 80Mi - command: - - "/bin/sh" - - "-c" - - touch /data/${MY_POD_NAME} && while true; do echo $(date) >> /data/${MY_POD_NAME}; sleep 1; done - env: - - name: MY_POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - volumeMounts: - - name: gcs-bucket - mountPath: /data - - name: reader - image: busybox - resources: - limits: - cpu: 100m - memory: 100Mi - requests: - cpu: 10m - memory: 80Mi - command: - - "/bin/sh" - - "-c" - - tail -f /data/${MY_POD_NAME} - env: - - name: MY_POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - volumeMounts: - - name: gcs-bucket - mountPath: /data - readOnly: true - volumeClaimTemplates: - - metadata: - name: gcs-bucket - spec: - accessModes: [ "ReadWriteMany" ] - storageClassName: gcs-fuse-class - resources: - requests: - storage: 5Gi diff --git a/examples/dynamic/storageclass-non-root.yaml b/examples/dynamic/storageclass-non-root.yaml deleted file mode 100755 index 88e14b932..000000000 --- a/examples/dynamic/storageclass-non-root.yaml +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2018 The Kubernetes Authors. -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: storage.k8s.io/v1 -kind: StorageClass -metadata: - name: gcs-fuse-class-non-root -provisioner: gcsfuse.csi.storage.gke.io -volumeBindingMode: Immediate -reclaimPolicy: Delete -mountOptions: - - uid=1001 - - gid=3003 -parameters: - csi.storage.k8s.io/provisioner-secret-name: gcs-csi-secret - csi.storage.k8s.io/provisioner-secret-namespace: ${pvc.namespace} \ No newline at end of file