[K8S] emptyDir 볼륨 사용하는 Pod 생성

조회 792 · 댓글 0
후아빠작성자2022년 12월 12일
우선 일반적인 Pod 생성 커맨드를 사용하여 YAML을 만든다.


kubectl run redis-storage --image=redis:alpine --dry-run=client -o yaml


그리고 나서 spec 아래에 volumes, container 아래에 volumeMounts를 작성한다.


apiVersion: v1

kind: Pod
metadata:
creationTimestamp: null
labels:
run: redis-storage
name: redis-storage
spec:
containers:
- image: redis:alpine
name: redis-storage
volumeMounts:
- mountPath: /data/redis
name: temp-volume
volumes:
- name: temp-volume
emptyDir: {}

로그인 후 답글을 남길 수 있습니다.