티스토리 뷰

CLOUD/Kubernetes

volume 필드 설명 정리

헐리 2021. 6. 28. 12:05
apiVersion: v1
kind: Pod
metadata:
  name: hostpath-pod
spec:
  containers:
  - name: hostpath-pod
    image: nginx
    volumeMounts:
    - mountPath: /hostpath
      name: hostpath-volume
  volumes:
  - name: hostpath-volume
    hostPath:
      path: /tmp/hostpath   # 해당 디렉토리가 존재해야 합니다.
      type: Directory

hostPath: 노드의 디스크에 볼륨을 생성하고, pod이 삭제 되더라도 볼륨에 있던 데이터는 유지 됨

volumeMounts.mountPath: 실행된 컨테이너 안에 마운트할 경로. (자동생성)

volumeMounts.name: 마운트할 볼륨 이름

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/10   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
글 보관함