본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

임시 볼륨

원문 보기 위키 갱신

임시 볼륨 (Temporary Volumes)

Kubernetes 파이프라인에서 파이프라인 수명 주기와 함께 생성·삭제되는 임시 볼륨을 설명하는 문서예요. 스텝 사이에 파일이나 폴더를 공유할 때 사용할 수 있어요.

출처: Drone CI Docs

본문

임시 마운트(temporary mounts)는 파이프라인이 시작되기 전에 만들어지고 파이프라인이 완료되면 사라지는 docker 볼륨이에요. 파이프라인 스텝들 사이에서 파일이나 폴더를 공유할 때 사용할 수 있어요.

kind: pipeline
type: kubernetes
name: default

steps:
- name: test
  image: golang
  volumes:
  - name: cache
    path: /go
  commands:
  - go get
  - go test

- name: build
  image: golang
  volumes:
  - name: cache
    path: /go
  commands:
  - go build

volumes:
- name: cache
  temp: {}

tmpfs를 사용하면 자주 읽고 쓰는 파일을 하드 드라이브 대신 메모리에 저장해 파이프라인 속도를 높일 수 있어요.

kind: pipeline
type: kubernetes
name: default

steps:
- name: test
  image: golang
  volumes:
  - name: cache
    path: /cache
  commands:
  - go get
  - go test

volumes:
- name: cache
  temp:
    medium: memory