본문 바로가기

DevOps/오픈소스

Vagrant 스냅샷(snapshot) 찍는법

Vagrant 스냅샷(snapshot) 찍기

vagrant로 만든 쿠버네티스 환경에서 공부를 하다가 초기화 할 일이 자주 생겨서 쿠버네티스 초기상태로 vagrant 스냅샷을 찍어보았다.

 

 

 vagrant 스냅샷 생성 

# vagrant snapshot save {VM이름} {스냅샷이름}
$ vagrant snapshot save k-control k-control1

vagrant snapshot save 명령어를 이용하여 스냅샷을 생성한다. 헬름 설치, 파드 생성등이 되지 않은 최초 쿠버네티스 환경으로 스냅샷을 생성하였다.

 

 

 

vagrant 스냅샷 list 확인

# 스냅샷 리스트 확인 
$ vagrant snapshot list

 

 

vagrant 스냅샷  적용 

현재는 helm 설치가 되어있고 repo가 등록된 상태이다.

 

# vagrant snapshot restore {VM이름} {스냅샷이름}
$ vagrant snapshot restore k-control k-control1

vagrant snapshot restore 명령어를 이용하여  헬름 설치, 파드 생성등이 되지 않은 최초 쿠버네티스 환경으로 적용해준다.

 

다시 VM에 접속해 확인해 보면 helm이 설치되기 전 최초 환경으로 돌아와있다.