1. PV ( Persistent Volume ) 란?
Persistent Volume (PV)은 Kubernetes의 스토리지 추상화로, 이를 사용하는 pod 에서 storage 구성을 분리할 수 있습니다.
Persistent Volume 은 Cluster 관리자가 동적으로 프로비저닝하거나 정적으로 구성할 수 있는 클러스터 전체 리소스입니다. Pod 와 Storage 백엔드 사이에 추상화 계층을 제공하여 애플리케이션의 유연성과 이식성을 높일 수 있습니다.
2. Pv 예제
Persistent Volume 구성해보기
* Create a persistent volume with name app-config, of capacity 1Gi and access mode ReadWriteMany
* StorageClass: az-c
* The type of volume is hostPath and its location is /srv/app-config
apiVersion: v1
kind: PersistentVolume
metadata:
name: app-config
spec:
capacity:
storage: 1Gi
accessModes:
- ReadWriteMany
storageClassName: az-c
hostPath:
path: /srv/app-config
type: Directory
3. 결과
root@k8s-master:~/cka30# kubectl apply -f 19.yaml
persistentvolume/app-config created
root@k8s-master:~/cka30# kubectl get pv
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
app-config 1Gi RWX Retain Available az-c 4s
https://kubernetes.io/docs/concepts/storage/persistent-volumes/
Persistent Volumes
This document describes persistent volumes in Kubernetes. Familiarity with volumes is suggested. Introduction Managing storage is a distinct problem from managing compute instances. The PersistentVolume subsystem provides an API for users and administrator
kubernetes.io
'Kubernetes (k8s)' 카테고리의 다른 글
[k8s] TLS Ingress 생성해서 https로 서비스 하기 (1) | 2023.05.03 |
---|---|
[k8s] Deploy & Pod Scale (1) | 2023.04.24 |
[k8s] Resource 사용량 확인을 위한 Metric Server 설치 (1) | 2023.04.18 |
[k8s] Static Pod (0) | 2023.04.17 |
[k8s] Node resource usage, Pods and their containers resource usage 리소스 사용량 조회 (2) | 2023.04.13 |
댓글