"쿠버네티스 Volume"의 두 판 사이의 차이

 
(사용자 2명의 중간 판 20개는 보이지 않습니다)
3번째 줄: 3번째 줄:
;쿠버네티스 볼륨, 볼륨
;쿠버네티스 볼륨, 볼륨
* 데이터를 담는 디렉토리
* 데이터를 담는 디렉토리
* Pod 내 컨테이너들이 접근가능함
* Pod 내 컨테이너들이 접근가능하다.
* pod에 소속되는 동안 유지됨
* pod에 소속되는 동안 유지된다.
* pod 내에서 구동되는 컨테이너들보다 오래 유지되며, 그 데이터는 컨테이너가 재시작되더라도 계속 보존됨
* pod 내에서 구동되는 컨테이너들보다 오래 유지되며, 그 데이터는 컨테이너가 재시작되더라도 계속 보존된다.
 
[[File:module_03_pods.svg|700px]]


==볼륨 유형 예시==
==볼륨 유형 예시==
* emptyDir ★
* [[k8s volumes configMap|configMap]], secret ★★
* hostPath ★
* [[k8s volumes persistentVolumeClaim|persistentVolumeClaim]] ★★
* [[emptyDir]]
* [[hostPath]]
* local
* local
* gitRepo
* fc (fiber channel), iscsi, nfs ★
* fc (fiber channel), iscsi, nfs ★
* secret ★★
* rbd, cephfs, glusterfs
* persistentVolumeClaim ★★
* cephfs, glusterfs
* awsElasticBlockStore, azureDisk, azureFile, gcePersistentDisk, portworxVolume, vsphereVolume
* awsElasticBlockStore, azureDisk, azureFile, gcePersistentDisk, portworxVolume, vsphereVolume
==yaml 블럭 예시==
<syntaxhighlight lang='yaml'>
volumes:
- name: vol-emtpy
  emptyDir: {}
- name: vol-config
  configMap:
    name: my-config
- name: vol-data
  persistentVolumeClaim:
    claimName: my-pvc
- name: vol-host
  hostPath:
    path: /any/path/it/will/be/replaced
</syntaxhighlight>


==두 컨테이너간 볼륨 공유==
==두 컨테이너간 볼륨 공유==
{{소스헤더|two-container-pod.yaml<ref>https://github.com/kubernetes/website/blob/master/content/en/examples/pods/two-container-pod.yaml</ref>}}
{{소스헤더|two-container-pod.yaml<ref>https://github.com/kubernetes/website/blob/master/content/en/examples/pods/two-container-pod.yaml</ref>}}
<source lang='yaml'>
<syntaxhighlight lang='yaml' line highlight='20'>
apiVersion: v1
apiVersion: v1
kind: Pod
kind: Pod
43번째 줄: 60번째 줄:
   - name: shared-data
   - name: shared-data
     emptyDir: {}
     emptyDir: {}
</source>
</syntaxhighlight>


==같이 보기==
==같이 보기==
{{z컬럼3|
* [[볼륨]]
* [[볼륨]]
* [[쿠버네티스 PV]]
* [[k8s PV]]
* [[쿠버네티스 PVC]]
* [[k8s PVC]]
* [[쿠버네티스 용어]]
* [[k8s 용어]]
* [[k8s volumes]]
* [[k8s volumes configMap]]
* [[K8s volumes persistentVolumeClaim]]
}}


==참고==
==참고==
* https://kubernetes.io/docs/concepts/storage/volumes/
* https://kubernetes.io/docs/concepts/storage/volumes/


[[분류: Kubernetes]]
[[분류:K8s 볼륨]]

2024년 2월 22일 (목) 14:27 기준 최신판

1 개요[ | ]

Kubernetes Volume, Volume
쿠버네티스 볼륨, 볼륨
  • 데이터를 담는 디렉토리
  • Pod 내 컨테이너들이 접근가능하다.
  • pod에 소속되는 동안 유지된다.
  • pod 내에서 구동되는 컨테이너들보다 오래 유지되며, 그 데이터는 컨테이너가 재시작되더라도 계속 보존된다.

Module 03 pods.svg

2 볼륨 유형 예시[ | ]

  • configMap, secret ★★
  • persistentVolumeClaim ★★
  • emptyDir
  • hostPath
  • local
  • fc (fiber channel), iscsi, nfs ★
  • rbd, cephfs, glusterfs
  • awsElasticBlockStore, azureDisk, azureFile, gcePersistentDisk, portworxVolume, vsphereVolume

3 yaml 블럭 예시[ | ]

volumes:
- name: vol-emtpy
  emptyDir: {}
- name: vol-config
  configMap:
    name: my-config
- name: vol-data
  persistentVolumeClaim:
    claimName: my-pvc
- name: vol-host
  hostPath:
    path: /any/path/it/will/be/replaced

4 두 컨테이너간 볼륨 공유[ | ]

two-container-pod.yaml[1]
apiVersion: v1
kind: Pod
metadata:
  name: two-containers
spec:
  restartPolicy: Never
  containers:
  - name: nginx-container
    image: nginx
    volumeMounts:
    - name: shared-data
      mountPath: /usr/share/nginx/html
  - name: debian-container
    image: debian
    volumeMounts:
    - name: shared-data
      mountPath: /pod-data
    command: ["/bin/sh"]
    args: ["-c", "echo Hello from the debian container > /pod-data/index.html"]
  volumes:
  - name: shared-data
    emptyDir: {}

5 같이 보기[ | ]

6 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}