Version 1.6. This version is no longer supported. For information about how to upgrade to version 1.7, see Upgrading Anthos on bare metal in the 1.7 documentation. For more information about supported and unsupported versions, see the Version history page in the latest documentation.
When you request storage with a
PersistentVolumeClaim
(PVC), you can specify a StorageClass. If you do not specify a StorageClass, the
default StorageClass is used if one is configured in the cluster.
Google Distributed Cloud does not configure a default StorageClass. For example,
suppose you create a PVC that does not specify a StorageClass. The volume
controller will fulfill the claim according to the default StorageClass.
Changing the default StorageClass
As a cluster administrator, you might want to change the default storage class.
Then all requests for storage that do not specify a StorageClass will be
fulfilled according to the StorageClass of your choice. This section gives the
steps for changing the default.
Deploy a new storage system
Deploy a new storage system and any software components for integrating the new
storage mechanism with a Kubernetes cluster. For example, you might need to
install a CSI driver
in the cluster.
Mark any existing default StorageClass as non-default
Search your cluster for any existing default StorageClass if one already exists
and mark it as non-default. For details, see
Change the default StorageClass.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThis guide explains how to set a default StorageClass in a Google Distributed Cloud cluster for handling storage requests when no specific StorageClass is defined.\u003c/p\u003e\n"],["\u003cp\u003eGoogle Distributed Cloud allows integration with block or file storage using Kubernetes in-tree volume plugins or Container Storage Interface (CSI).\u003c/p\u003e\n"],["\u003cp\u003eChanging the default StorageClass involves deploying a new storage system, marking any existing default StorageClass as non-default, and creating a new StorageClass with the \u003ccode\u003estorageclass.kubernetes.io/is-default-class: "true"\u003c/code\u003e annotation.\u003c/p\u003e\n"],["\u003cp\u003eWhen creating a new StorageClass manifest, you must include the desired provisioner and set the annotation to "true" to make it the new default.\u003c/p\u003e\n"]]],[],null,["# Setting the default StorageClass\n\n\u003cbr /\u003e\n\nThis page shows how to set the default StorageClass for an\nGoogle Distributed Cloud cluster.\n\nOverview\n--------\n\nGoogle Distributed Cloud can integrate with block or file storage by using any of\nthe following mechanisms:\n\n- [Kubernetes in-tree volume plugins](https://kubernetes.io/docs/concepts/storage/volumes/#types-of-volumes)\n- [Container Storage Interface (CSI)](/anthos/clusters/docs/bare-metal/1.6/installing/install-csi-driver)\n\nDefault StorageClass\n--------------------\n\nWhen you request storage with a\n[PersistentVolumeClaim](https://kubernetes.io/docs/concepts/storage/persistent-volumes/)\n(PVC), you can specify a StorageClass. If you do not specify a StorageClass, the\ndefault StorageClass is used if one is configured in the cluster.\nGoogle Distributed Cloud does not configure a default StorageClass. For example,\nsuppose you create a PVC that does not specify a StorageClass. The volume\ncontroller will fulfill the claim according to the default StorageClass.\n\nChanging the default StorageClass\n---------------------------------\n\nAs a cluster administrator, you might want to change the default storage class.\nThen all requests for storage that do not specify a StorageClass will be\nfulfilled according to the StorageClass of your choice. This section gives the\nsteps for changing the default.\n\n### Deploy a new storage system\n\nDeploy a new storage system and any software components for integrating the new\nstorage mechanism with a Kubernetes cluster. For example, you might need to\n[install a CSI driver](/anthos/clusters/docs/bare-metal/1.6/installing/install-csi-driver)\nin the cluster.\n\n### Mark any existing default StorageClass as non-default\n\nSearch your cluster for any existing default StorageClass if one already exists\nand mark it as non-default. For details, see\n[Change the default StorageClass](https://kubernetes.io/docs/tasks/administer-cluster/change-default-storage-class/).\n\n### Create a new StorageClass\n\n[Create a manifest for a new StorageClass](https://kubernetes.io/docs/concepts/storage/storage-classes/).\nInclude the `storageclass.kubernetes.io/is-default-class: \"true\"` annotation.\nFor example: \n\n```\napiVersion: storage.k8s.io/v1\nkind: StorageClass\nmetadata:\n annotations:\n storageclass.kubernetes.io/is-default-class: \"true\"\n ...\n name: my-storage-class\n ...\nparameters:\n ...\nprovisioner: [MY_PROVISIONER]\n...\n```\n\nSave your manifest as a YAML file, and create the new StorageClass: \n\n```\nkubectl --kubeconfig [CLUSTER_KUBECONFIG] apply -f [MANIFEST_FILE]\n```\n\nwhere \u003cvar translate=\"no\"\u003e[MANIFEST_FILE]\u003c/var\u003e is the path to your new StorageClass manifest\nfile.\n\nWhat's next\n-----------\n\n- [Read about Google Distributed Cloud's storage concepts](/anthos/clusters/docs/bare-metal/1.6/installing/storage)\n\n- [Install a CSI driver](/anthos/clusters/docs/bare-metal/1.6/installing/install-csi-driver)"]]