kubernetes
Kubernetes(K8S) Storage: Empty Dir - Centos7
새싹싹이
2023. 9. 14. 14:00
Empty Dir
임시 volume 으로 생명주기가 pod와 동일
동일 pod 내, 여러 개의 Container가 존재한다면 Empty Dir 공유 가능
pod가 있는 node 안에 volume의 name으로 존재
vi emptydp.yml
apiVersion: apps/v1
kind: Deployment
metadata:
name: host-dep
labels:
env: prod
spec:
replicas: 2
selector:
matchLabels:
host: anginx
template:
metadata:
name: temp-anginx
labels:
host: anginx
spec:
containers:
- name: n1
image: nginx
imagePullPolicy: Never
ports:
- containerPort: 80
volumeMounts:
- mountPath: /usr/share/nginx/html/
name: kang-vol
- name: a1
image: alpine
kubectl apply -f emptydp.yml
(watch -n 1 kubectl get rs, pods로 확인)
kubectl get pod -o wide (생성된 node 확인
node 1
find / -name kang-vol : yml로 생성한 Empty Dir 검색
하기의 경로 중 위에 것이 Empty Dir
<<참고>>
find / -user lp => user가 lp인 것을 찾아라