<button class="button button-with-icon cloud-select-dropdown__button button-primary" aria-haspopup="true">Version 1.10 (unsupported)</button>

- [Latest](https://docs.cloud.google.com/anthos/clusters/docs/bare-metal/latest/installing/default-storage-class)
- [Version 1.16](https://docs.cloud.google.com/anthos/clusters/docs/bare-metal/1.16/installing/default-storage-class.md.txt)
- [Earlier versions (unsupported)](https://docs.cloud.google.com/anthos/clusters/docs/bare-metal/1.10/getting-support.md.txt#version-support)

<br />

This page shows how to set the default StorageClass for an
Google Distributed Cloud cluster.

## Overview

Google Distributed Cloud can integrate with block or file storage by using any of
the following mechanisms:

- [Kubernetes in-tree volume plugins](https://kubernetes.io/docs/concepts/storage/volumes/#types-of-volumes)
- [Container Storage Interface (CSI)](https://docs.cloud.google.com/anthos/clusters/docs/bare-metal/1.10/installing/install-csi-driver.md.txt)

## Default StorageClass

When you request storage with a
[PersistentVolumeClaim](https://kubernetes.io/docs/concepts/storage/persistent-volumes/)
(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.

## Change 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](https://docs.cloud.google.com/anthos/clusters/docs/bare-metal/1.10/installing/install-csi-driver.md.txt)
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](https://kubernetes.io/docs/tasks/administer-cluster/change-default-storage-class/).

### Create a new StorageClass

[Create a manifest for a new StorageClass](https://kubernetes.io/docs/concepts/storage/storage-classes/).
Include the `storageclass.kubernetes.io/is-default-class: "true"` annotation.
For example:

```
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  annotations:
    storageclass.kubernetes.io/is-default-class: "true"
  ...
  name: my-storage-class
  ...
parameters:
  ...
provisioner: [MY_PROVISIONER]
...
```

Save your manifest as a YAML file, and create the new StorageClass:

```
kubectl --kubeconfig [CLUSTER_KUBECONFIG] apply -f [MANIFEST_FILE]
```

where <var translate="no">\[MANIFEST_FILE\]</var> is the path to your new StorageClass manifest
file.

## What's next

- [Read about Google Distributed Cloud's storage concepts](https://docs.cloud.google.com/anthos/clusters/docs/bare-metal/1.10/installing/storage.md.txt)

- [Install a CSI driver](https://docs.cloud.google.com/anthos/clusters/docs/bare-metal/1.10/installing/install-csi-driver.md.txt)