Can I Use Google Cloud Storage Buckets for Kubernetes Persistent Storage in Hybrid Deployment?
Question
Can I use Google Cloud Storage buckets for Kubernetes persistent storage in Hybrid Deployment?
Environment
Container platform: Kubernetes
Answer
Yes, you can use Google Cloud Storage (GCS) buckets as persistent storage for Kubernetes in Hybrid Deployment. To enable this setup, ensure your Google Kubernetes Engine (GKE) cluster has the Cloud Storage FUSE CSI driver enabled. For more information about enabling the driver, see Google Cloud documentation.
Once the driver is enabled, configure a Persistent Volume (PV) and a Persistent Volume Claim (PVC) that use the GCS FUSE CSI driver.
Example of Persistent Volume using GCS FUSE CSI driver:
apiVersion: v1
kind: PersistentVolume
metadata:
name: YOUR_PERSISTENT_VOLUME_NAME
spec:
accessModes:
- ReadWriteMany
capacity:
storage: 1Ti
storageClassName: YOUR_STORAGE_CLASS_NAME
mountOptions:
- implicit-dirs
csi:
driver: gcsfuse.csi.storage.gke.io
volumeHandle: YOUR_BUCKET_NAME
claimRef:
name: YOUR_PERSISTENT_VOLUME_CLAIM_NAME
namespace: default
Example of Persistent Volume Claim using GCS FUSE CSI driver:
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: YOUR_PERSISTENT_VOLUME_CLAIM_NAME
namespace: default
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Ti
storageClassName: YOUR_STORAGE_CLASS_NAME