Once you create a PVC use it in a POD definition file by specifying the PVC Claim name under persistentVolumeClaim section in the volumes section like this:
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
The same is true for ReplicaSets or Deployments. Add this to the pod template section of a Deployment on ReplicaSet.
'Computer Science > Kubernetes(CKA) 자격증 준비' 카테고리의 다른 글
Kubernetes 정리 190: Solution - Persistent Volumes and Persistent Volume Claims (0) | 2023.03.07 |
---|---|
Kubernetes 정리 189: Practice Test - Persistent Volumes and Persistent Volume Claims (0) | 2023.03.07 |
Kubernetes 정리 187: Persistent Volume Claims (0) | 2023.03.07 |
Kubernetes 정리 186: Persistent Volumes (0) | 2023.03.06 |
Kubernetes 정리 167: Practice Test - Image Security (0) | 2023.03.03 |