반응형
01. 특정 조건의 persistent volume을 생성한다. | capacity 2Gi / accss mode는 ReadWriteMany / type은 hostpath
[solve]
[root@k8s-master ~]# vi 16-test.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: app-data
labels:
type: local
spec:
storageClassName: manual
capacity:
storage: 2Gi
accessModes:
- ReadWriteMany
hostPath:
path: "/srv/app-data"
[root@k8s-master ~]# kubectl apply -f 16-test.yaml
persistentvolume/app-data created
[root@k8s-master ~]# kubectl describe pv/app-data
Name: app-data
Labels: type=local
Annotations: <none>
Finalizers: [kubernetes.io/pv-protection]
StorageClass: manual
Status: Available
Claim:
Reclaim Policy: Retain
Access Modes: RWX
VolumeMode: Filesystem
Capacity: 2Gi
Node Affinity: <none>
Message:
Source:
Type: HostPath (bare host directory volume)
Path: /srv/app-data
HostPathType:
Events: <none>
[root@k8s-master ~]#
반응형
'Compute > kubernetis' 카테고리의 다른 글
[CKA] 11. cluster upgrade | 노드 drain | cordon / uncordon (0) | 2025.01.14 |
---|---|
[CKA] 10. kubectl top 명령어 사용 문제 | --sort-by | -l 옵션 사용 (0) | 2025.01.14 |
[CKA] 08. deployment 생성 | deployment scale out (0) | 2025.01.14 |
[CKA] 07. pod 생성 | kubectl apply -f | yaml로 pod 생성 | manifest로 pod 생성 (0) | 2025.01.14 |
[CKA] 06. kubectl create | kubectl delete | kubectl edit 명령어 사용 문제 (0) | 2025.01.11 |