최신판 |
당신의 편집 |
1번째 줄: |
1번째 줄: |
| ==개요== | | ==개요== |
| {{소문자}}
| |
| ;kubectl CRD 삭제 | | ;kubectl CRD 삭제 |
| ;kubectl CRD 재귀 삭제 | | ;kubectl CRD 재귀 삭제 |
| ;kubectl CRD 캐스케이드 삭제 | | ;kubectl CRD 캐스케이드 삭제 |
|
| |
|
| | ==방법 1: 수동 == |
| * 삭제대상 CRD 목록 조회 | | * 삭제대상 CRD 목록 조회 |
| <syntaxhighlight lang='console'> | | <syntaxhighlight lang='console'> |
| $ kubectl get crds -oname | grep cluster.x-k8s.io | sed 's|.*/||' | | $ kubectl get crd | grep cluster.x-k8s.io |
| addonproviders.operator.cluster.x-k8s.io | | addonproviders.operator.cluster.x-k8s.io 2024-02-22T16:35:14Z |
| bootstrapproviders.operator.cluster.x-k8s.io | | bootstrapproviders.operator.cluster.x-k8s.io 2024-02-22T16:35:14Z |
| clusterclasses.cluster.x-k8s.io | | clusterclasses.cluster.x-k8s.io 2024-02-22T16:35:43Z |
| ... | | ... |
| machinepools.cluster.x-k8s.io | | machinepools.cluster.x-k8s.io 2024-02-22T16:35:43Z |
| machines.cluster.x-k8s.io
| | machines.cluster.x-k8s.io 2024-02-22T16:35:43Z |
| machinesets.cluster.x-k8s.io
| | machinesets.cluster.x-k8s.io 2024-02-22T16:35:43Z |
| </syntaxhighlight>
| |
| * 삭제대상 CRD 인스턴스 목록 조회
| |
| <syntaxhighlight lang='console'>
| |
| $ kubectl get crds -oname | grep cluster.x-k8s.io | sed 's|^.*/||' | xargs -n1 kubectl get -A -o custom-columns=":metadata.namespace,:kind,:metadata.name" | xargs -n3 echo
| |
| capi-kubeadm-bootstrap-system BootstrapProvider kubeadm
| |
| capi-kubeadm-control-plane-system ControlPlaneProvider kubeadm
| |
| capi-system CoreProvider cluster-api
| |
| docker-infrastructure-system InfrastructureProvider docker
| |
| </syntaxhighlight>
| |
| | |
| ==방법 1: 인스턴스 자동 삭제==
| |
| * CRD 삭제 명령어 생성
| |
| <syntaxhighlight lang='console'>
| |
| $ kubectl get crds -oname | grep cluster.x-k8s.io | sed 's|.*/||' | xargs -n1 echo kubectl delete crd --cascade=foreground
| |
| kubectl delete crd --cascade=foreground addonproviders.operator.cluster.x-k8s.io
| |
| kubectl delete crd --cascade=foreground bootstrapproviders.operator.cluster.x-k8s.io
| |
| kubectl delete crd --cascade=foreground clusterclasses.cluster.x-k8s.io
| |
| ...
| |
| kubectl delete crd --cascade=foreground machinepools.cluster.x-k8s.io
| |
| kubectl delete crd --cascade=foreground machines.cluster.x-k8s.io
| |
| kubectl delete crd --cascade=foreground machinesets.cluster.x-k8s.io
| |
| </syntaxhighlight>
| |
| * CRD 삭제 명령어 실행
| |
| <syntaxhighlight lang='console'>
| |
| $ kubectl delete crd --cascade=foreground addonproviders.operator.cluster.x-k8s.io
| |
| customresourcedefinition.apiextensions.k8s.io "addonproviders.operator.cluster.x-k8s.io" deleted
| |
| ...
| |
| $ kubectl delete crd --cascade=foreground machinepools.cluster.x-k8s.io
| |
| customresourcedefinition.apiextensions.k8s.io "machinepools.cluster.x-k8s.io" deleted
| |
| $ kubectl delete crd --cascade=foreground machinesets.cluster.x-k8s.io
| |
| customresourcedefinition.apiextensions.k8s.io "machinesets.cluster.x-k8s.io" deleted
| |
| </syntaxhighlight>
| |
| | |
| ==방법 2: 인스턴스 수동 삭제==
| |
| * CRD 인스턴스 삭제 명령어 생성
| |
| <syntaxhighlight lang='console'>
| |
| $ kubectl get crds -oname | grep cluster.x-k8s.io | sed 's|^.*/||' | xargs -n1 kubectl get -A -o custom-columns=":metadata.namespace,:kind,:metadata.name" | xargs -n3 echo kubectl delete -n
| |
| kubectl delete -n capi-kubeadm-bootstrap-system BootstrapProvider kubeadm
| |
| kubectl delete -n capi-kubeadm-control-plane-system ControlPlaneProvider kubeadm
| |
| kubectl delete -n capi-system CoreProvider cluster-api
| |
| kubectl delete -n docker-infrastructure-system InfrastructureProvider docker
| |
| </syntaxhighlight>
| |
| * CRD 인스턴스 삭제 명령어 실행
| |
| <syntaxhighlight lang='console'>
| |
| $ kubectl delete -n capi-kubeadm-bootstrap-system BootstrapProvider kubeadm
| |
| bootstrapprovider.operator.cluster.x-k8s.io "kubeadm" deleted
| |
| $ kubectl delete -n capi-kubeadm-control-plane-system ControlPlaneProvider kubeadm
| |
| controlplaneprovider.operator.cluster.x-k8s.io "kubeadm" deleted
| |
| $ kubectl delete -n capi-system CoreProvider cluster-api
| |
| coreprovider.operator.cluster.x-k8s.io "cluster-api" deleted
| |
| $ kubectl delete -n docker-infrastructure-system InfrastructureProvider docker
| |
| infrastructureprovider.operator.cluster.x-k8s.io "docker" deleted
| |
| </syntaxhighlight>
| |
| * CRD 삭제 명령어 생성
| |
| <syntaxhighlight lang='console'>
| |
| $ kubectl get crds -oname | grep cluster.x-k8s.io | sed 's|.*/||' | xargs -n1 echo kubectl delete crd
| |
| kubectl delete crd addonproviders.operator.cluster.x-k8s.io
| |
| kubectl delete crd bootstrapproviders.operator.cluster.x-k8s.io
| |
| kubectl delete crd clusterclasses.cluster.x-k8s.io
| |
| ...
| |
| kubectl delete crd machinepools.cluster.x-k8s.io
| |
| kubectl delete crd machines.cluster.x-k8s.io
| |
| kubectl delete crd machinesets.cluster.x-k8s.io
| |
| </syntaxhighlight>
| |
| * CRD 삭제 명령어 실행
| |
| <syntaxhighlight lang='console'>
| |
| $ kubectl delete crd addonproviders.operator.cluster.x-k8s.io
| |
| customresourcedefinition.apiextensions.k8s.io "addonproviders.operator.cluster.x-k8s.io" deleted
| |
| ...
| |
| $ kubectl delete crd machinepools.cluster.x-k8s.io
| |
| customresourcedefinition.apiextensions.k8s.io "machinepools.cluster.x-k8s.io" deleted
| |
| $ kubectl delete crd machinesets.cluster.x-k8s.io
| |
| customresourcedefinition.apiextensions.k8s.io "machinesets.cluster.x-k8s.io" deleted
| |
| </syntaxhighlight> | | </syntaxhighlight> |
|
| |
|