Minikube PV와 NFS 연결
2025. 1. 3. 22:53ㆍk8s
PV
accessModes 중요
apiVersion: v1
kind: PersistentVolume
metadata:
name: nfs-pv
spec:
capacity:
storage: 10Gi
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Retain
nfs:
path: /data/shared # NFS server directory
server: 192.168.1.100 # NFS server IP
readOnly: false # Set to true if read-only
PVC
storageClassName: "" 중요
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nfs-pvc
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 10Gi
storageClassName: "" # Match PV with no storage class
만약 storageClassName: ""가 없으면 쿠버네티스가 자동으로 PV 와 PVC를 standard storage class로 생성
kubectl get pv
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
nfs-pv 1Gi RWX Retain Available 25m
pvc-c9382589-57fa-4bc7-9beb-959f18f64bca 1Gi RWX Delete Bound nfs/nfs-pvc standard 7m16s
kubectl get pvc -A
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
nfs-pv 1Gi RWX Retain Available 25m
'k8s' 카테고리의 다른 글
Minikube 이미지가 이상하게 변경해도 바뀌지 않는 경우 (0) | 2025.01.04 |
---|---|
Minikube 다운로드된 이미지 목록 확인 (1) | 2025.01.04 |
Minikube PV 디렉토리 NFS 마운트 (0) | 2025.01.01 |
Minikube PV 바인딩 (0) | 2025.01.01 |
Minikube root 권한 얻기 (0) | 2025.01.01 |