[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-01 (世界標準時間)。"],[],[],null,["A user cluster created with Google Distributed Cloud (software only) for VMware has one\nor more\n[StorageClass](https://kubernetes.io/docs/concepts/storage/storage-classes/)\nobjects, and one of them is designated as the default StorageClass.\nThis page shows how to set the default StorageClass for a user cluster. For more\ninformation, see [Storage](/kubernetes-engine/distributed-cloud/vmware/docs/concepts/storage).\n\nThis page is for Storage specialists who configure and manage storage\nperformance, usage, and expense. To learn more about common roles and example\ntasks that we reference in Google Cloud content, see\n[Common GKE user roles and tasks](/kubernetes-engine/enterprise/docs/concepts/roles-tasks).\n\nFind the default StorageClass\n\nList all the StorageClasses:\n\n```\nkubectl --kubeconfig USER_CLUSTER_KUBECONFIG get storageclasses\n```\n\nIn the output, you can see which StorageClass is the default. For example, in\nthe following output, you can see that a StorageClass named `standard-rwo` is\nthe default StorageClass:\n\n```\nstandard kubernetes.io/vsphere-volume\nstandard-rwo (default) csi.vsphere.vmware.com\n```\n\nWhen you request storage, you can specify a StorageClass. If you do not specify\na StorageClass, the default StorageClass is used. For example, suppose you\ncreate a\n[PersistentVolumeClaim](https://kubernetes.io/docs/concepts/storage/persistent-volumes/)\nthat does not specify a StorageClass. The volume controller will fulfill the\nclaim according to the default StorageClass.\n\nChanging the default StorageClass\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\nDeploy 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](/kubernetes-engine/distributed-cloud/vmware/docs/how-to/install-csi-driver) in the\ncluster.\n\nThis step depends on the storage vendor you're using. For CSI drivers, vendors\nshould provide instructions for deploying their CSI driver to a Kubernetes\ncluster. A CSI driver's documentation should also include the\n[driver-specific parameters](https://kubernetes.io/docs/concepts/storage/storage-classes/#the-storageclass-resource)\nthat you provide in your StorageClass, including the provisioner name.\n\nWhen you create a StorageClass for your new appliance, you should name the\nStorageClass after its properties (such as \"fast\" or \"highly-replicated\"),\nrather than after the name of the specific driver or appliance behind it.\nThis will make it easier to have consistent storage policies across clusters and\nenvironments.\n\nRemove the default annotation from the default StorageClass\n\nOpen the default StorageClass in a text editor:\n\n```\nkubectl --kubeconfig [USER_CLUSTER_KUBECONFIG] edit storageclass \\\n DEFAULT_STORAGE_CLASS\n```\n\nIn the text editor, remove the\n`storageclass.kubernetes.io/is-default-class: \"true\"` annotation. Close the\ntext editor.\n\nTo verify that the annotation was removed, enter this command:\n\n```\nkubectl --kubeconfig [USER_CLUSTER_KUBECONFIG] get storageclass \\\n DEFAULT_STORAGE_CLASS --output yaml\n```\n\nCreate 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- [Read about Google Distributed Cloud's storage concepts](/kubernetes-engine/distributed-cloud/vmware/docs/concepts/storage)\n\n- [Install a CSI driver](/kubernetes-engine/distributed-cloud/vmware/docs/how-to/install-csi-driver)"]]