Create local PersistentVolume
This page describes steps required to create local StorageClass and PersistentVolume which can be used to deploy Built-in vault-server in case if CSI provider is unavailable in a cluster.
Check Kubernetes documentation for details.
It is not recommended to use local PersistentVolumes for production clusters.
mkdir -p /local_storage/vault-server-pv
cat << 'EOF' | tee local-storage-sc.yaml
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: local-storage
provisioner: kubernetes.io/no-provisioner
volumeBindingMode: WaitForFirstConsumer
EOF
kubectl apply -f local-storage-sc.yaml
Replace <NODE-HOSTNAME> with hostname of the node on which you want to create this PV
cat << 'EOF' | tee pv.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: vault-server-pv
spec:
capacity:
storage: 10Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
storageClassName: local-storage
local:
path: /local_storage/vault-server-pv
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- <NODE-HOSTNAME> # hostname of the iCP master node
EOF
kubectl apply -f pv.yaml