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

클러스터에서 CSI 볼륨 그룹 스냅샷 지원 활성화

원문 보기 위키 갱신

클러스터에서 CSI 볼륨 그룹 스냅샷 지원 활성화 (Enable CSI Volume Group Snapshot Support)

CSI VolumeGroupSnapshot을 찍으려면 일반 CSI 스냅샷 지원 외에 세 가지가 더 필요해요:

  • VolumeGroupSnapshot CRD들.
  • snapshot-controller에서 켠 CSIVolumeGroupSnapshot feature gate.
  • Longhorn이 배포하는 csi-snapshotter에 켠 동일 feature gate.

Prerequisite(사전 요구 사항): 클러스터에 CSI 스냅샷 지원이 활성화되어 있어야 해요. Enable CSI Snapshot Support 문서를 참고하세요.

Warning: 스냅샷 중단 가능성 (Potential Snapshot Outage) 어떤 컴포넌트에서 CSIVolumeGroupSnapshot feature gate를 켜기 전에 VolumeGroupSnapshot CRD를 먼저 설치하세요. CRD가 없는 상태에서 feature gate를 켜면 csi-snapshotter 사이드카가 일반 볼륨 스냅샷 서비스를 중단해요. 사이드카 pod가 Running으로 보고되고 있어도 클러스터의 모든 VolumeSnapshot이 Pending 상태에서 멈춰요.

출처: 문서

본문

VolumeGroupSnapshot CRD 설치하기 (Install the VolumeGroupSnapshot CRDs)

이 CRD들은 external-snapshotter에 포함되어 배포돼요: groupsnapshot.storage.k8s.io API 그룹의 VolumeGroupSnapshotClass, VolumeGroupSnapshot, VolumeGroupSnapshotContent.

v1 API를 제공하도록 릴리스 v8.6.0 이상을 사용하세요. 아래 URL에서 <version>을 목표 릴리스(예: v8.6.0)로 바꾸고 적용하세요:

kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter//client/config/crd/groupsnapshot.storage.k8s.io_volumegroupsnapshotclasses.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter//client/config/crd/groupsnapshot.storage.k8s.io_volumegroupsnapshots.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter//client/config/crd/groupsnapshot.storage.k8s.io_volumegroupsnapshotcontents.yaml

snapshot-controller에서 feature gate 켜기 (Enable the Feature Gate on the snapshot-controller)

snapshot-controller는 CSIVolumeGroupSnapshot feature gate가 켜져 있을 때만 VolumeGroupSnapshot 객체를 처리해요. 컨트롤러 또한 external-snapshotter v8.6.0 이상이어야 해요.

snapshot-controller가 배포된 네임스페이스(기본값은 kube-system)에 맞춰 컨트롤러 인자에 feature gate를 추가하세요:

kubectl -n kube-system patch deploy snapshot-controller --type=json \
  -p='[{"op":"add","path":"/spec/template/spec/containers/0/args/-","value":"--feature-gates=CSIVolumeGroupSnapshot=true"}]'

Longhorn에서 VolumeGroupSnapshot 지원 켜기 (Enable VolumeGroupSnapshot Support in Longhorn)

Longhorn에서 VolumeGroupSnapshot 지원은 기본적으로 꺼져 있어요. 이걸 켜면 Longhorn이 배포하는 csi-snapshotter의 CSIVolumeGroupSnapshot feature gate가 활성화돼요.

  • Helm 설치인 경우: 차트 값 csi.volumeGroupSnapshotEnabled를 true로 설정하세요.

  • kubectl 설치인 경우: 배포 매니페스트의 longhorn-driver-deployer Deployment에서 CSI_VOLUME_GROUP_SNAPSHOT_ENABLED 환경 변수의 주석을 해제하세요:

- name: CSI_VOLUME_GROUP_SNAPSHOT_ENABLED
  value: "true"

Troubleshooting:: Longhorn 토글을 켰는데 VolumeGroupSnapshot CRD가 없으면(또는 v1으로 제공되지 않으면) Longhorn driver deployer가 누락된 CRD 이름을 밝히는 에러와 함께 실패해요. 다만 일반 볼륨별 스냅샷은 계속 동작해요. 복구하려면 CRD를 설치하거나(또는 토글을 끄고) 재배포하면 돼요.

더 알아보기 (Learn more)