Course contentsShow
← Docker, Kubernetes & CI/CD
Lesson 322 of 8025. Advanced Kubernetes ConfigurationFree lesson

Provisioning Persistent Volumes via Static Binding

Master the manual process of creating Persistent Volumes to map specific underlying storage resources to your cluster for immediate consumption by pods.

In this lesson, you will learn how to manually bridge the gap between physical storage infrastructure and your Kubernetes cluster using Static Binding.

The Concept of Static Binding

While Kubernetes often automates storage, Static Binding is the manual approach where you—the administrator—pre-provision the storage and define it within the cluster. Think of this like manually mounting a specific external hard drive to a computer; you decide exactly which piece of hardware is used and make it known to the system before the application even asks for it.

In Kubernetes, this involves creating a PersistentVolume (PV) object. Unlike a PersistentVolumeClaim (PVC) which is a request for storage, the PV is the actual representation of the storage resource itself.

Defining the Persistent Volume

To statically bind storage, you create a YAML manifest that points to a specific piece of storage infrastructure, such as an NFS share or a directory on a host machine.

apiVersion: v1
kind: PersistentVolume
metadata:
  name: manual-pv
spec:
  capacity:
    storage: 5Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: /mnt/data

Once you apply this manifest, the manual-pv resource exists in your cluster. It is now ready to be claimed. If a developer creates a PVC requesting 5Gi of storage with ReadWriteOnce access, Kubernetes will "bind" their claim to your pre-provisioned PV.

Why Use Static Binding?

Static binding gives you complete control over your storage. You choose the exact capacity, the specific underlying file system, and the mount points. This is particularly useful in environments where you have existing, pre-configured storage infrastructure (like an enterprise SAN or a specific high-performance SSD partition) that cannot be managed by dynamic automated drivers. By explicitly defining the PV, you ensure that your workloads are pinned to the precise resources you intended.

Key Takeaway: Static Binding allows administrators to manually define specific storage resources as PersistentVolume objects, ensuring that application pods consume precisely provisioned underlying infrastructure.