Google Distributed Cloud (GDC) air-gapped provides file and block persistent storage for virtual machine (VM) and container workloads in your air-gapped sovereign environment.
GDC uses Kubernetes, which provides persistent
block and file storage through PersistentVolumeClaim
objects. A
PersistentVolumeClaim
(PVC) is a request for storage which is referenced by a
Pod
object. A pod is a group of one or more containers, with shared storage and
network resources. A PersistentVolumeClaim
object has an independent lifecycle
from the pod which allows it to persist beyond a single pod.
Persistent storage is dynamically provisioned, so that the underlying volumes
are created on-demand. In GDC, dynamic provisioning is
provided by the following pre-installed StorageClass
objects:
standard-rwo
:ReadWriteOnce
block storage class. The volume can only be accessed by one node at a time. This is the default.standard-rwx
:ReadWriteMany
file storage. The volume can be accessed simultaneously by multiple nodes.
See Create stateful workloads for an example of how to deploy a stateful application with storage.
Before you begin
To run commands against a Kubernetes cluster, ensure you have the following resources:
Locate the cluster name, or ask your Platform Administrator what the cluster name is.
Sign in and generate the kubeconfig file for the Kubernetes cluster if you don't have one.
Use the kubeconfig path of the Kubernetes cluster to replace
KUBERNETES_CLUSTER_KUBECONFIG
in these instructions.
To get the required permissions to create a multi-writer volume, ask your
Organization IAM Admin to grant you the Namespace Admin role (namespace-admin
)
in your project namespace.
Create a multi-writer volume
The GDC standard-rwx
StorageClass
provides
multi-writer storage shared simultaneously by multiple Pod
objects. The
following instructions show how to create a multi-writer volume.
Create a
PersistentVolumeClaim
and configure it with aReadWriteMany
access mode and astandard-rwx
storage class:kubectl --kubeconfig KUBERNETES_CLUSTER_KUBECONFIG \ --namespace NAMESPACE apply -f - <<EOF apiVersion: v1 kind: PersistentVolumeClaim metadata: name: PVC_NAME spec: accessModes: - ReadWriteMany resources: requests: storage: 10Gi EOF
Replace the following:
KUBERNETES_CLUSTER_KUBECONFIG
: the kubeconfig file for the cluster.NAMESPACE
: the project namespace in which to create the PVC.PVC_NAME
: the name of thePersistentVolumeClaim
object.
Configure your container workloads to use the multi-writer volume. The following is an example deployment of
nginx
that uses a multi-writer volume:apiVersion: apps/v1 kind: Deployment metadata: name: web-server-deployment labels: app: nginx spec: replicas: 3 selector: matchLabels: app: nginx template: metadata: labels: app: nginx spec: containers: - name: nginx image: nginx volumeMounts: - mountPath: /usr/share/nginx/html name: data volumes: - name: data persistentVolumeClaim: claimName: PVC_NAME
Replace
PVC_NAME
with the PVC you created.
Expand volume capacity
To increase the capacity of a PersistentVolumeClaim
object, update the
spec.resources.storage
field to your desired capacity. The maximum supported
volume size is 14.5 Ti.
Update the volume to a larger size in the manifest file of the
PersistentVolumeClaim
object:
kubectl --kubeconfig KUBERNETES_CLUSTER_KUBECONFIG \
--namespace NAMESPACE apply -f - <<EOF
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: PVC_NAME
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: VOLUME_STORAGE_SIZE
EOF
Replace the following:
KUBERNETES_CLUSTER_KUBECONFIG
: the kubeconfig file for the cluster.NAMESPACE
: the project namespace in which the PVC resource exists.PVC_NAME
: the name of the PVC for which you are increasing the storage size.VOLUME_SNAPSHOT_SIZE
: the storage size amount to increase, such as50Gi
.