MLOps/Doker & Kubernetes

Udemy CKA 강의 정리 188: Using PVCs in PODs

공부하는 무니 2023. 1. 23. 11:34
반응형

해당 내용은 Udemy의 Certified Kubernetes Administrator (CKA) with Practice Tests 강의를 공부한 내용입니다. 내용을 그대로 번역하기보다는, 제가 이해하기 쉬운 대로 수정한 부분들이 있습니다.

⚠️ 영어 독해가 많이 부족합니다. 틀린 내용이 있으면 알려주시면 감사하겠습니다.


PVC를 생성하면 다음과 같이 볼륨 섹션의 persistenceVolumeClaim 섹션 아래에 PVC 클레임 이름을 지정하여 POD 정의 파일에서 PVC를 사용합니다.

apiVersion: v1
kind: Pod
metadata:
  name: mypod
spec:
  containers:
    - name: myfrontend
      image: nginx
      volumeMounts:
      - mountPath: "/var/www/html"
        name: mypd
  volumes:
    - name: mypd
      persistentVolumeClaim:
        claimName: myclaim

ReplicaSet 또는 Deployment의 경우에도 마찬가지입니다. Deployment의 ReplicaSet 파드 템플릿 섹션에 위 코드를 추가하세요.

 

Reference URL: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#claims-as-volumes

반응형