해결된 질문
작성
·
428
1
[root@k8s-master ssl]# kubectl get storageclasses.storage.k8s.io -n longhorn-system longhorn
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
longhorn (default) driver.longhorn.io Delete Immediate true 119s
[root@k8s-master ssl]# kubectl delete storageclasses.storage.k8s.io -n longhorn-system longhorn
warning: deleting cluster-scoped resources, not scoped to the provided namespace
storageclass.storage.k8s.io "longhorn" deleted
[root@k8s-master ssl]# cat <<EOF | kubectl create -f -
> kind: StorageClass
> apiVersion: storage.k8s.io/v1
> metadata:
> name: longhorn
> provisioner: driver.longhorn.io
> allowVolumeExpansion: true
> parameters:
> numberOfReplicas: "2"
> staleReplicaTimeout: "2880"
> fromBackup: ""
> EOF
Error from server (AlreadyExists): error when creating "STDIN": storageclasses.storage.k8s.io "longhorn" already exists
[root@k8s-master ssl]#
어떤 부분을 확인해봐야 할까요?
답변 2
1
좀 믿을 수 없는 history네요;;
삭제됐다고 응답이 떴는데,
그럼 다시 kubectl get stroageclass 를 해보면 조회가 되나요?
삭제시에 -n은 필요없습니다.
[root@k8s-master containerd]# kubectl get storageclasses.storage.k8s.io -n longhorn-system longhorn
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
longhorn (default) driver.longhorn.io Delete Immediate true 79m
[root@k8s-master containerd]# kubectl delete storageclasses.storage.k8s.io longhorn-system longhorn
storageclass.storage.k8s.io "longhorn" deleted
Error from server (NotFound): storageclasses.storage.k8s.io "longhorn-system" not found
[root@k8s-master containerd]# kubectl delete storageclasses.storage.k8s.io longhorn
storageclass.storage.k8s.io "longhorn" deleted
[root@k8s-master containerd]# kubectl get storageclasses.storage.k8s.io -n longhorn-system longhorn
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
longhorn (default) driver.longhorn.io Delete Immediate true 4s
[root@k8s-master containerd]#
네 그렇군요.
storageclass는 longhorn 이 계속 생성하고 있다고 보시면 되고요.
해당 storageclass는 삭제하지 마시고 apply 명령으로 수정하시면 됩니다.
아래 제 가이드에 storageclass 생성 내용은 apply를 사용해서 수정하는 내용입니다.
0
넵 답변 고맙습니다.
[root@k8s-master containerd]# kubectl get storageclasses.storage.k8s.io -n longhorn-system longhorn
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
longhorn (default) driver.longhorn.io Delete Immediate true 79m
[root@k8s-master containerd]#
이렇게 조회가 되고 있습니다.