기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.
SMB CSI 드라이버 작업
이 섹션의 절차에 따라 Kubernetes 클러스터의 스토리지에 Amazon S3 File Gateway에서 SMB 파일 공유를 사용하는 데 필요한 CSI 드라이버를 설치, 구성 또는 삭제합니다. 자세한 내용은의 GitHub에서 오픈 소스 SMB CSI 드라이버 설명서를 참조하세요https://github.com/kubernetes-csi/csi-driver-smb/blob/master/docs/install-csi-driver-master.md
참고
PersistentVolume
객체 또는 StorageClass
객체를 생성할 때 ReclaimPolicy
파라미터를 지정하여 객체가 삭제될 때 외부 스토리지에 어떤 일이 발생하는지 확인할 수 있습니다. SMB CSI 드라이버는 Retain
및 Recycle
옵션을 지원하지만 현재 Delete
옵션을 지원하지 않습니다.
드라이버 설치
Kubernetes SMB CSI 드라이버를 설치하려면:
-
Kubernetes 클러스터의
kubectl
에 액세스할 수 있는 명령줄 터미널에서 다음 명령을 실행합니다.curl -skSL https://raw.githubusercontent.com/kubernetes-csi/csi-driver-smb/master/deploy/install-driver.sh | bash -s master --
-
이전 명령이 완료될 때까지 기다린 다음 다음 명령을 사용하여 CSI 드라이버 포드가 실행 중인지 확인합니다.
kubectl -n kube-system get pod -o wide --watch -l app=csi-smb-controller
kubectl -n kube-system get pod -o wide --watch -l app=csi-smb-node
다음과 같이 출력됩니다
NAME READY STATUS RESTARTS AGE IP NODE csi-smb-controller-56bfddd689-dh5tk 4/4 Running 0 35s 10.240.0.19 k8s-agentpool-22533604-0 csi-smb-controller-56bfddd689-8pgr4 4/4 Running 0 35s 10.240.0.35 k8s-agentpool-22533604-1 csi-smb-node-cvgbs 3/3 Running 0 35s 10.240.0.35 k8s-agentpool-22533604-1 csi-smb-node-dr4s4 3/3 Running 0 35s 10.240.0.4 k8s-agentpool-22533604-0
SMB StorageClass 객체 생성
Kubernetes 클러스터에 대한 새 SMB StorageClass 객체를 생성하려면
-
다음 예제
storageclass.yaml
와 유사한 내용으로 라는 구성 파일을 생성합니다. 표시된ExampleValues
.--- apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name:
ExampleStorageClassName
provisioner: smb.csi.k8s.io parameters: source: "//gateway-dns-name-or-ip-address/example-share-name
" # if csi.storage.k8s.io/provisioner-secret is provided, will create a sub directory # with PV name under source csi.storage.k8s.io/provisioner-secret-name: "examplesmbcreds
" csi.storage.k8s.io/provisioner-secret-namespace: "examplenamespace
" csi.storage.k8s.io/node-stage-secret-name: "examplesmbcreds
" csi.storage.k8s.io/node-stage-secret-namespace: "examplenamespace
" volumeBindingMode: Immediate reclaimPolicy: Retain mountOptions: - dir_mode=0777 - file_mode=0777 - uid=1001 - gid=1001 -
kubectl
및에 액세스할 수 있는 명령줄 터미널에서 다음 명령을storageclass.yaml
실행합니다.kubectl apply -f storageclass.yaml
참고
이전 단계의
.yaml
구성 텍스트를 대부분의 타사 Kubernetes 관리 및 컨테이너화 플랫폼에 제공하여 StorageClass를 생성할 수도 있습니다. -
생성한 새 StorageClass를 사용하도록 Kubernetes 클러스터의 포드를 구성합니다. 자세한 내용은의 Kubernetes 온라인 설명서를 참조하세요https://kubernetes.io/docs/concepts/storage/
.
SMB PersistentVolume 및 PersistentVolumeClaim 객체 생성
새 SMB PersistentVolume 및 PersistentVolumeClaim 객체를 생성하려면
-
두 개의 구성 파일을 생성합니다. 이름이 인 1개와 이름이 인
persistentvolume.yaml
1개persistentvolumeclaim.yaml
. -
의 경우 다음 예와 유사한 콘텐츠를
persistentvolume.yaml
추가합니다. 표시된ExampleValues
.--- apiVersion: v1 kind: PersistentVolume metadata: name:
pv-smb-example-name
namespace:smb-example-namespace
# PersistentVolume and PersistentVolumeClaim must use the same namespace parameter spec: capacity: storage: 100Gi accessModes: - ReadWriteMany persistentVolumeReclaimPolicy: Retain mountOptions: - dir_mode=0777 - file_mode=0777 - vers=3.0 csi: driver: smb.csi.k8s.io readOnly: false volumeHandle:examplehandle
# make sure it's a unique id in the cluster volumeAttributes: source: "//gateway-dns-name-or-ip-address/example-share-name
" nodeStageSecretRef: name:example-smbcreds
namespace:smb-example-namespace
-
의 경우 다음 예와 유사한 콘텐츠를
persistentvolumeclaim.yaml
추가합니다. 표시된ExampleValues
.--- kind: PersistentVolumeClaim apiVersion: v1 metadata: name:
examplename-pvc-smb-static
namespace:smb-example-namespace
# PersistentVolume and PersistentVolumeClaim must use the same namespace parameter spec: accessModes: - ReadWriteMany resources: requests: storage: 10Gi volumeName:pv-smb-example-name
# make sure specfied volumeName matches the name of the PersistentVolume you created storageClassName: "" -
및 생성한
kubectl
두.yaml
파일에 모두 액세스할 수 있는 명령줄 터미널에서 다음 명령을 실행합니다.kubectl apply -f persistentvolume.yaml
kubectl apply -f persistentvolumeclaim.yaml
참고
이전 단계의
.yaml
구성 텍스트를 대부분의 타사 Kubernetes 관리 및 컨테이너화 플랫폼에 제공하여 PersistentVolume 및 PersistentVolumeClaim 객체를 생성할 수도 있습니다. -
생성한 새 PersistentVolumeClaim을 사용하도록 Kubernetes 클러스터의 포드를 구성합니다. 자세한 내용은의 Kubernetes 온라인 설명서를 참조하세요https://kubernetes.io/docs/concepts/storage/
.
드라이버 제거
Kubernetes SMB CSI 드라이버를 제거하려면:
-
Kubernetes 클러스터의
kubectl
에 액세스할 수 있는 명령줄 터미널에서 다음 명령을 실행합니다.curl -skSL https://raw.githubusercontent.com/kubernetes-csi/csi-driver-smb/master/deploy/uninstall-driver.sh | bash -s --