Persistent Volume Example: Let’s Encrypt Certs Demo
This example demonstrates how to use persistent storage with the Local Path Provisioner in a Kubernetes deployment. The configuration shows a workload (locus-ws) that uses a persistent volume to store Let’s Encrypt certificates under /tmp/locus/acme.
Deployment YAML
The following Kubernetes Deployment mounts two volumes:
- A read-only ConfigMap for configuration files
- A writable PersistentVolumeClaim for storing certs
apiVersion: apps/v1 |
Persistent Volume Claim (PVC)
This PVC requests 2Gi of storage using the standard storage class and supports ReadWriteOnce access mode.
apiVersion: v1 |
Notes
- The volumeMounts section ensures Let’s Encrypt data persists even if the pod is restarted.
- This configuration is compatible with QBO’s local path provisioner or any CSI-compliant storage backend.
- Ensure the standard StorageClass is available in your cluster, or replace it with your provisioner’s class.