如何手动卸载rancher?

问题描述 投票:0回答:5

我使用以下命令从本教程将 rancher 安装到现有的 kubernetes 集群中:

helm repo add rancher-latest https://releases.rancher.com/server-charts/latest
kubectl create namespace rancher
kubectl apply --validate=false -f https://github.com/jetstack/cert-manager/releases/download/v1.0.4/cert-manager.crds.yaml
helm repo add jetstack https://charts.jetstack.io
helm repo update
kubectl get pods --namespace cert-manager

helm install rancher rancher-latest/rancher \
  --namespace rancher \
  --set hostname=rancher.blabla.com
kubectl -n rancher rollout status deploy/rancher # wait
kubectl -n rancher get deploy rancher

卸载方法来自本页

./system-tools_linux-amd64 remove -c ~/.kube/config -n rancher

但是显示错误:

Are you sure you want to remove Rancher Management Plane in Namespace [rancher] [y/n]: y
INFO[0001] Removing Rancher management plane in namespace: [rancher] 
INFO[0001] Getting connection configuration             
INFO[0001] Removing Cattle deployment                   
INFO[0002] Removed Cattle deployment succuessfully      
INFO[0002] Removing ClusterRoleBindings                 
INFO[0003] Successfully removed ClusterRoleBindings     
INFO[0003] Removing ClusterRoles                        
INFO[0003] deleting cluster role [cluster-owner]..      
INFO[0003] deleting cluster role [create-ns]..          
INFO[0003] deleting cluster role [project-owner]..      
INFO[0003] deleting cluster role [project-owner-promoted].. 
INFO[0004] Successfully removed ClusterRoles            
INFO[0004] Removing Cattle Annotations, Finalizers and Labels 
INFO[0004] Checking API resource [bindings]             
INFO[0004] Checking API resource [componentstatuses]    
INFO[0004] Checking API resource [configmaps]           
WARN[0005] Can't build dynamic client for [configmaps]: the server could not find the requested resource
 
INFO[0005] Checking API resource [endpoints]            
WARN[0005] Can't build dynamic client for [endpoints]: the server could not find the requested resource
 
INFO[0005] Checking API resource [events]               
WARN[0005] Can't build dynamic client for [events]: the server could not find the requested resource
 
INFO[0005] Checking API resource [limitranges]          
WARN[0005] Can't build dynamic client for [limitranges]: the server could not find the requested resource
 
INFO[0005] Checking API resource [namespaces]           
WARN[0005] Can't build dynamic client for [namespaces]: the server could not find the requested resource
 
INFO[0005] Checking API resource [namespaces/finalize]  
INFO[0005] Checking API resource [namespaces/status]    
INFO[0005] Checking API resource [nodes]                
WARN[0006] Can't build dynamic client for [nodes]: the server could not find the requested resource
 
INFO[0006] Checking API resource [nodes/proxy]          
INFO[0006] Checking API resource [nodes/status]         
INFO[0006] Checking API resource [persistentvolumeclaims] 
WARN[0006] Can't build dynamic client for [persistentvolumeclaims]: the server could not find the requested resource
 
INFO[0006] Checking API resource [persistentvolumeclaims/status] 
INFO[0006] Checking API resource [persistentvolumes]    
WARN[0006] Can't build dynamic client for [persistentvolumes]: the server could not find the requested resource
 
INFO[0006] Checking API resource [persistentvolumes/status] 
INFO[0006] Checking API resource [pods]                 
WARN[0006] Can't build dynamic client for [pods]: the server could not find the requested resource
 
INFO[0006] Checking API resource [pods/attach]          
INFO[0006] Checking API resource [pods/binding]         
INFO[0006] Checking API resource [pods/eviction]        
INFO[0006] Checking API resource [pods/exec]            
INFO[0006] Checking API resource [pods/log]             
INFO[0006] Checking API resource [pods/portforward]     
INFO[0006] Checking API resource [pods/proxy]           
INFO[0006] Checking API resource [pods/status]          
INFO[0006] Checking API resource [podtemplates]         
WARN[0006] Can't build dynamic client for [podtemplates]: the server could not find the requested resource
 
INFO[0006] Checking API resource [replicationcontrollers] 
WARN[0007] Can't build dynamic client for [replicationcontrollers]: the server could not find the requested resource
 
INFO[0007] Checking API resource [replicationcontrollers/scale] 
INFO[0007] Checking API resource [replicationcontrollers/status] 
INFO[0007] Checking API resource [resourcequotas]       
WARN[0007] Can't build dynamic client for [resourcequotas]: the server could not find the requested resource
 
INFO[0007] Checking API resource [resourcequotas/status] 
INFO[0007] Checking API resource [secrets]              
WARN[0007] Can't build dynamic client for [secrets]: the server could not find the requested resource
 
INFO[0007] Checking API resource [serviceaccounts]      
WARN[0007] Can't build dynamic client for [serviceaccounts]: the server could not find the requested resource
 
INFO[0007] Checking API resource [serviceaccounts/token] 
INFO[0007] Checking API resource [services]             
WARN[0008] Can't build dynamic client for [services]: the server could not find the requested resource
 
INFO[0008] Checking API resource [services/proxy]       
INFO[0008] Checking API resource [services/status]      
INFO[0008] Checking API resource [apiservices]          
WARN[0008] Can't build dynamic client for [apiservices]: the server could not find the requested resource
 
INFO[0008] Checking API resource [apiservices/status]   
INFO[0008] Checking API resource [controllerrevisions]  
WARN[0008] Can't build dynamic client for [controllerrevisions]: the server could not find the requested resource
 
INFO[0008] Checking API resource [daemonsets]           
WARN[0009] Can't build dynamic client for [daemonsets]: the server could not find the requested resource
 
INFO[0009] Checking API resource [daemonsets/status]    
INFO[0009] Checking API resource [deployments]          
WARN[0009] Can't build dynamic client for [deployments]: the server could not find the requested resource
 
INFO[0009] Checking API resource [deployments/scale]    
INFO[0009] Checking API resource [deployments/status]   
INFO[0009] Checking API resource [replicasets]          
WARN[0009] Can't build dynamic client for [replicasets]: the server could not find the requested resource
 
INFO[0009] Checking API resource [replicasets/scale]    
INFO[0009] Checking API resource [replicasets/status]   
INFO[0009] Checking API resource [statefulsets]         
WARN[0009] Can't build dynamic client for [statefulsets]: the server could not find the requested resource
 
INFO[0009] Checking API resource [statefulsets/scale]   
INFO[0009] Checking API resource [statefulsets/status]  
INFO[0009] Checking API resource [events]               
WARN[0010] Can't build dynamic client for [events]: the server could not find the requested resource
 
INFO[0010] Checking API resource [tokenreviews]         
INFO[0010] Checking API resource [localsubjectaccessreviews] 
INFO[0010] Checking API resource [selfsubjectaccessreviews] 
INFO[0010] Checking API resource [selfsubjectrulesreviews] 
INFO[0010] Checking API resource [subjectaccessreviews] 
INFO[0010] Checking API resource [horizontalpodautoscalers] 
WARN[0011] Can't build dynamic client for [horizontalpodautoscalers]: the server could not find the requested resource
 
INFO[0011] Checking API resource [horizontalpodautoscalers/status] 
INFO[0011] Checking API resource [jobs]                 
WARN[0011] Can't build dynamic client for [jobs]: the server could not find the requested resource
 
INFO[0011] Checking API resource [jobs/status]          
INFO[0011] Checking API resource [certificatesigningrequests] 
WARN[0011] Can't build dynamic client for [certificatesigningrequests]: the server could not find the requested resource
 
INFO[0011] Checking API resource [certificatesigningrequests/approval] 
INFO[0011] Checking API resource [certificatesigningrequests/status] 
INFO[0012] Checking API resource [ingressclasses]       
WARN[0012] Can't build dynamic client for [ingressclasses]: the server could not find the requested resource
 
INFO[0012] Checking API resource [ingresses]            
WARN[0012] Can't build dynamic client for [ingresses]: the server could not find the requested resource
 
INFO[0012] Checking API resource [ingresses/status]     
INFO[0012] Checking API resource [networkpolicies]      
WARN[0012] Can't build dynamic client for [networkpolicies]: the server could not find the requested resource
 
INFO[0013] Checking API resource [ingresses]            
WARN[0013] Can't build dynamic client for [ingresses]: the server could not find the requested resource
 
INFO[0013] Checking API resource [ingresses/status]     
INFO[0013] Checking API resource [poddisruptionbudgets] 
WARN[0013] Can't build dynamic client for [poddisruptionbudgets]: the server could not find the requested resource
 
INFO[0013] Checking API resource [poddisruptionbudgets/status] 
INFO[0013] Checking API resource [podsecuritypolicies]  
WARN[0013] Can't build dynamic client for [podsecuritypolicies]: the server could not find the requested resource
 
INFO[0014] Checking API resource [clusterrolebindings]  
WARN[0014] Can't build dynamic client for [clusterrolebindings]: the server could not find the requested resource
 
INFO[0014] Checking API resource [clusterroles]         
WARN[0014] Can't build dynamic client for [clusterroles]: the server could not find the requested resource
 
INFO[0014] Checking API resource [rolebindings]         
WARN[0014] Can't build dynamic client for [rolebindings]: the server could not find the requested resource
 
INFO[0014] Checking API resource [roles]                
WARN[0014] Can't build dynamic client for [roles]: the server could not find the requested resource
 
INFO[0015] Checking API resource [csidrivers]           
WARN[0015] Can't build dynamic client for [csidrivers]: the server could not find the requested resource
 
INFO[0015] Checking API resource [csinodes]             
WARN[0015] Can't build dynamic client for [csinodes]: the server could not find the requested resource
 
INFO[0015] Checking API resource [storageclasses]       
WARN[0015] Can't build dynamic client for [storageclasses]: the server could not find the requested resource
 
INFO[0015] Checking API resource [volumeattachments]    
WARN[0016] Can't build dynamic client for [volumeattachments]: the server could not find the requested resource
 
INFO[0016] Checking API resource [volumeattachments/status] 
INFO[0016] Checking API resource [mutatingwebhookconfigurations] 
WARN[0016] Can't build dynamic client for [mutatingwebhookconfigurations]: the server could not find the requested resource
 
INFO[0016] Checking API resource [validatingwebhookconfigurations] 
WARN[0016] Can't build dynamic client for [validatingwebhookconfigurations]: the server could not find the requested resource
 
INFO[0016] Checking API resource [customresourcedefinitions] 
WARN[0017] Can't build dynamic client for [customresourcedefinitions]: the server could not find the requested resource
 
INFO[0017] Checking API resource [customresourcedefinitions/status] 
INFO[0017] Checking API resource [priorityclasses]      
WARN[0017] Can't build dynamic client for [priorityclasses]: the server could not find the requested resource
 
INFO[0017] Checking API resource [leases]               
WARN[0017] Can't build dynamic client for [leases]: the server could not find the requested resource
 
INFO[0018] Checking API resource [runtimeclasses]       
WARN[0018] Can't build dynamic client for [runtimeclasses]: the server could not find the requested resource
 
INFO[0018] Checking API resource [endpointslices]       
WARN[0018] Can't build dynamic client for [endpointslices]: the server could not find the requested resource
 
INFO[0018] Checking API resource [flowschemas]          
WARN[0019] Can't build dynamic client for [flowschemas]: the server could not find the requested resource
 
INFO[0019] Checking API resource [flowschemas/status]   
INFO[0019] Checking API resource [prioritylevelconfigurations] 
WARN[0019] Can't build dynamic client for [prioritylevelconfigurations]: the server could not find the requested resource
 
INFO[0019] Checking API resource [prioritylevelconfigurations/status] 
INFO[0019] Checking API resource [perconaxtradbclusterbackups] 
WARN[0019] Can't build dynamic client for [perconaxtradbclusterbackups]: the server could not find the requested resource
 
INFO[0019] Checking API resource [perconaxtradbclusterbackups/status] 
INFO[0019] Checking API resource [perconaxtradbclusterrestores] 
WARN[0020] Can't build dynamic client for [perconaxtradbclusterrestores]: the server could not find the requested resource
 
INFO[0020] Checking API resource [perconaxtradbclusterrestores/status] 
INFO[0020] Checking API resource [perconaxtradbclusters] 
WARN[0020] Can't build dynamic client for [perconaxtradbclusters]: the server could not find the requested resource
 
INFO[0020] Checking API resource [perconaxtradbclusters/status] 
INFO[0020] Checking API resource [challenges]           
WARN[0020] Can't build dynamic client for [challenges]: the server could not find the requested resource
 
INFO[0020] Checking API resource [challenges/status]    
INFO[0020] Checking API resource [orders]               
WARN[0020] Can't build dynamic client for [orders]: the server could not find the requested resource
 
INFO[0020] Checking API resource [orders/status]        
INFO[0021] Checking API resource [clusterrepos]         
WARN[0021] Can't build dynamic client for [clusterrepos]: the server could not find the requested resource
 
INFO[0021] Checking API resource [clusterrepos/status]  
INFO[0021] Checking API resource [apps]                 
WARN[0021] Can't build dynamic client for [apps]: the server could not find the requested resource
 
INFO[0021] Checking API resource [apps/status]          
INFO[0021] Checking API resource [operations]           
WARN[0021] Can't build dynamic client for [operations]: the server could not find the requested resource
 
INFO[0021] Checking API resource [operations/status]    
INFO[0022] Checking API resource [clusterissuers]       
WARN[0022] Can't build dynamic client for [clusterissuers]: the server could not find the requested resource
 
INFO[0022] Checking API resource [clusterissuers/status] 
INFO[0022] Checking API resource [certificaterequests]  
WARN[0022] Can't build dynamic client for [certificaterequests]: the server could not find the requested resource
 
INFO[0022] Checking API resource [certificaterequests/status] 
INFO[0022] Checking API resource [certificates]         
WARN[0022] Can't build dynamic client for [certificates]: the server could not find the requested resource
 
INFO[0022] Checking API resource [certificates/status]  
INFO[0022] Checking API resource [issuers]              
WARN[0022] Can't build dynamic client for [issuers]: the server could not find the requested resource
 
INFO[0022] Checking API resource [issuers/status]       
INFO[0023] Checking API resource [gitjobs]              
WARN[0023] Can't build dynamic client for [gitjobs]: the server could not find the requested resource
 
INFO[0023] Checking API resource [gitjobs/status]       
INFO[0023] Checking API resource [prometheusrules]      
WARN[0023] Can't build dynamic client for [prometheusrules]: the server could not find the requested resource
 
INFO[0023] Checking API resource [thanosrulers]         
WARN[0024] Can't build dynamic client for [thanosrulers]: the server could not find the requested resource
 
INFO[0024] Checking API resource [alertmanagers]        
WARN[0024] Can't build dynamic client for [alertmanagers]: the server could not find the requested resource
 
INFO[0024] Checking API resource [podmonitors]          
WARN[0024] Can't build dynamic client for [podmonitors]: the server could not find the requested resource
 
INFO[0024] Checking API resource [probes]               
WARN[0024] Can't build dynamic client for [probes]: the server could not find the requested resource
 
INFO[0024] Checking API resource [servicemonitors]      
WARN[0024] Can't build dynamic client for [servicemonitors]: the server could not find the requested resource
 
INFO[0024] Checking API resource [prometheuses]         
WARN[0025] Can't build dynamic client for [prometheuses]: the server could not find the requested resource
 
INFO[0025] Checking API resource [projects]             
WARN[0025] Can't build dynamic client for [projects]: the server could not find the requested resource
 
INFO[0025] Checking API resource [projects/status]      
INFO[0025] Checking API resource [roletemplates]        
WARN[0025] Can't build dynamic client for [roletemplates]: the server could not find the requested resource
 
INFO[0025] Checking API resource [roletemplates/status] 
INFO[0025] Checking API resource [clusters]             
WARN[0025] Can't build dynamic client for [clusters]: the server could not find the requested resource
 
INFO[0025] Checking API resource [clusters/status]      
INFO[0025] Checking API resource [roletemplatebindings] 
WARN[0026] Can't build dynamic client for [roletemplatebindings]: the server could not find the requested resource
 
INFO[0026] Checking API resource [roletemplatebindings/status] 
INFO[0026] Checking API resource [clusters]             
WARN[0026] Can't build dynamic client for [clusters]: the server could not find the requested resource
 
INFO[0026] Checking API resource [clusters/status]      
INFO[0026] Checking API resource [gitrepos]             
WARN[0026] Can't build dynamic client for [gitrepos]: the server could not find the requested resource
 
INFO[0026] Checking API resource [gitrepos/status]      
INFO[0026] Checking API resource [bundles]              
WARN[0026] Can't build dynamic client for [bundles]: the server could not find the requested resource
 
INFO[0026] Checking API resource [bundles/status]       
INFO[0026] Checking API resource [clusterregistrations] 
WARN[0027] Can't build dynamic client for [clusterregistrations]: the server could not find the requested resource
 
INFO[0027] Checking API resource [clusterregistrations/status] 
INFO[0027] Checking API resource [clusterregistrationtokens] 
WARN[0027] Can't build dynamic client for [clusterregistrationtokens]: the server could not find the requested resource
 
INFO[0027] Checking API resource [clusterregistrationtokens/status] 
INFO[0027] Checking API resource [bundledeployments]    
WARN[0027] Can't build dynamic client for [bundledeployments]: the server could not find the requested resource
 
INFO[0027] Checking API resource [bundledeployments/status] 
INFO[0027] Checking API resource [gitreporestrictions]  
WARN[0027] Can't build dynamic client for [gitreporestrictions]: the server could not find the requested resource
 
INFO[0027] Checking API resource [gitreporestrictions/status] 
INFO[0027] Checking API resource [contents]             
WARN[0028] Can't build dynamic client for [contents]: the server could not find the requested resource
 
INFO[0028] Checking API resource [clustergroups]        
WARN[0028] Can't build dynamic client for [clustergroups]: the server could not find the requested resource
 
INFO[0028] Checking API resource [clustergroups/status] 
INFO[0028] Checking API resource [bundlenamespacemappings] 
WARN[0028] Can't build dynamic client for [bundlenamespacemappings]: the server could not find the requested resource
 
INFO[0028] Checking API resource [bundlenamespacemappings/status] 
INFO[0028] Checking API resource [clusters]             
WARN[0028] Can't build dynamic client for [clusters]: the server could not find the requested resource
 
INFO[0028] Checking API resource [clusters/status]      
INFO[0028] Checking API resource [roles]                
WARN[0029] Can't build dynamic client for [roles]: the server could not find the requested resource
 
INFO[0029] Checking API resource [roles/status]         
INFO[0029] Checking API resource [roles/scale]          
INFO[0029] Checking API resource [replicasettemplates]  
WARN[0029] Can't build dynamic client for [replicasettemplates]: the server could not find the requested resource
 
INFO[0029] Checking API resource [replicasettemplates/status] 
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
        panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x148dedc]

goroutine 1 [running]:
github.com/rancher/system-tools/vendor/github.com/urfave/cli.HandleAction.func1(0xc000f3da30)
        /go/src/github.com/rancher/system-tools/vendor/github.com/urfave/cli/app.go:472 +0x278
panic(0x1681e40, 0x2adb0e0)
        /usr/local/go/src/runtime/panic.go:513 +0x1b9
github.com/rancher/system-tools/remove.getGroupAPIResourceList(0xc000198140, 0x0, 0x0, 0x0, 0x0, 0xc000e47580, 0x17, 0xc000ea7ac0, 0x1, 0x1, ...)
        /go/src/github.com/rancher/system-tools/remove/remove.go:425 +0x9c
github.com/rancher/system-tools/remove.removeCattleAnnotationsFinalizersLabels(0xc000198140, 0x0, 0x0)
        /go/src/github.com/rancher/system-tools/remove/remove.go:476 +0x1b2
github.com/rancher/system-tools/remove.DoRemoveRancher.func4(0x0, 0x0)
        /go/src/github.com/rancher/system-tools/remove/remove.go:93 +0x2a
github.com/rancher/system-tools/utils.RetryWithCount(0xc000f3d400, 0x3, 0x0, 0x0)
        /go/src/github.com/rancher/system-tools/utils/utils.go:53 +0x61
github.com/rancher/system-tools/remove.DoRemoveRancher(0xc000198140, 0x0, 0x0)
        /go/src/github.com/rancher/system-tools/remove/remove.go:92 +0x373
reflect.Value.call(0x15fa8e0, 0x1995388, 0x13, 0x18df3cc, 0x4, 0xc0007a59d0, 0x1, 0x1, 0xc00067c080, 0xc000af43b0, ...)
        /usr/local/go/src/reflect/value.go:447 +0x449
reflect.Value.Call(0x15fa8e0, 0x1995388, 0x13, 0xc0007a59d0, 0x1, 0x1, 0x5, 0x4, 0xc000686b40)
        /usr/local/go/src/reflect/value.go:308 +0xa4
github.com/rancher/system-tools/vendor/github.com/urfave/cli.HandleAction(0x15fa8e0, 0x1995388, 0xc000198140, 0x0, 0x0)
        /go/src/github.com/rancher/system-tools/vendor/github.com/urfave/cli/app.go:481 +0x1fb
github.com/rancher/system-tools/vendor/github.com/urfave/cli.Command.Run(0x18e1d91, 0x6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1911f67, 0x2a, 0x0, ...)
        /go/src/github.com/rancher/system-tools/vendor/github.com/urfave/cli/command.go:186 +0x8f6
github.com/rancher/system-tools/vendor/github.com/urfave/cli.(*App).Run(0xc0003a6d80, 0xc0000381e0, 0x6, 0x6, 0x0, 0x0)
        /go/src/github.com/rancher/system-tools/vendor/github.com/urfave/cli/app.go:235 +0x52e
main.main()
        /go/src/github.com/rancher/system-tools/main.go:84 +0x5c3

如何手动卸载?

kubernetes kubernetes-helm rancher
5个回答
3
投票

删除 rancher 安装其所有组件的cattle-system命名空间。 kubectl 删除 ns 牛系统


2
投票

系统工具删除 --kubeconfig --namespace

我能够使用此命令删除 rancher 部署:

system-tools 删除 --kubeconfig /etc/rancher/k3s/k3s.yaml --namespace 牛系统


2
投票

据我了解,手动卸载是一项艰巨的任务,如果在 RKE2 集群中,很可能会导致集群损坏。因此,我提供了针对这种情况删除 Rancher 的详细信息。

我使用 2.6 HA RKE2 Rancher 文档来安装 Rancher,发现了一个证书问题,需要我从 RKE2 集群中删除 Rancher。我使用的是 Windows (PowerShell),最终能够删除 Rancher。首先,我必须从 github 上的Rancher/system-tools 存储库下载 exe。关于如何使用系统工具的说明需要稍微修改一下才能获得所需的结果。另请注意,步骤之一是将较长的文件名重命名为 system-tools.exe,因此,如果您不更改它,则需要提供该文件的名称来代替下面的 system-tools命令。

不起作用

./system-tools remove -c ~/.kube/config -n cattle-system

所以我对 .kube 目录做了

cd
并运行了这个...

做了工作

./system-tools remove config -n cattle-system

config
是保存集群详细信息的文件 (kubeconfig) 的名称。我的字面意思是 config(无扩展名)。


以下内容来自当前存储库上的 README.MD...

系统工具 Rancher 2.0运维工具包。

命令 消除 用途:

系统工具删除[命令选项] [参数...] 选项:

--kubeconfig 值,-c 值:kubeconfig 绝对路径 [$KUBECONFIG] --namespacecattle-system, -ncattle-system: rancher 2.x 部署命名空间。默认是cattle-system(默认:“cattle-system”) --force:跳过交互式删除确认并立即删除 Rancher 部署。 system-tools remove 命令用于删除 Rancher 2.x 管理平面部署。它通过以下步骤进行操作:

删除 Rancher 部署。 删除 Rancher 标记的 ClusterRole 和 ClusterRoleBindings。 从管理平面集群上的所有资源中删除标签、注释和终结器。 删除机器、集群、项目和用户 CRD 以及相应的命名空间。 删除在 management.cattle.io API 组下创建的所有资源。 删除 Rancher 2.x 创建的所有 CRD。 删除Rancher部署命名空间,默认为cattle-system。 日志 用途:

系统工具日志 [命令选项] [参数...] 选项:

--kubeconfig 值,-c 值:托管集群 kubeconfig [$KUBECONFIG] --输出值,-o 值:集群日志 tarball(默认值:“cluster-logs.tar”) --node value, -n value: 获取单个节点的日志 system-tools logs 命令用于拉取 RKE 在集群节点上部署的 Kubernetes 组件的 Docker 容器日志。

该命令的工作原理是在托管集群上部署 DaemonSet,该集群使用 Rancher 节点代理映像来挂载 RKE 日志目录,并压缩每个节点上的日志并将其流式传输到运行系统工具的主机。拉取日志后,DaemonSet 将自动删除。

还可以使用 --node 选项从特定节点提取日志。

统计数据 用途:

system-tools stats [命令选项] [参数...] 选项:

--kubeconfig 值,-c 值:托管集群 kubeconfig [$KUBECONFIG] --node value, -n value: 显示单个节点的统计信息 --stats-command value,-s value:在服务器上运行的替代命令(默认值:“/usr/bin/sar -u -r -F 1 1”) system-tools stats 命令用于从 Rancher 管理的 Kubernetes 集群节点中提取实时统计信息。默认是提取 CPU、内存和磁盘使用统计信息。

该命令的工作原理是在托管集群上部署 DaemonSet,该集群使用 Rancher 节点代理来运行用于在每个节点上执行 stats 命令的 pod。统计数据每 5 秒实时显示一次。该工具将持续运行,直到用户使用 ctrl+c 中断其执行,这将触发清理命令并删除统计数据 DaemonSet。

还可以使用 --node 选项监视单个节点,或使用 --stats-command 选项运行另一个统计命令。


1
投票
helm uninstall rancher --namespace cattle-system

应该完成这项工作


0
投票

你可能需要这个,我使用这个脚本有效地卸载了rancher。 https://github.com/rancher/rancher-cleanup

© www.soinside.com 2019 - 2024. All rights reserved.