找回密码
 注册
查看: 12|回复: 0

kubeadm reset 清理安装的kubernetes环境 实际操作命令

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2024-12-31 22:12:02 | 显示全部楼层 |阅读模式
[root@k8s-master ~]# kubeadm reset --v=5 --cri-socket=unix:///var/run/cri-dockerd.sock  --ignore-preflight-errors=...
% u0 `& ^5 d6 Y9 T* Z& Y; |I1231 22:10:13.956939    4733 envvar.go:172] "Feature gate default state" feature="ClientsAllowCBOR" enabled=false
$ k3 s. ?8 Y$ S- W# }' II1231 22:10:13.957052    4733 envvar.go:172] "Feature gate default state" feature="ClientsPreferCBOR" enabled=false
- u  _) K# d0 NI1231 22:10:13.957081    4733 envvar.go:172] "Feature gate default state" feature="InformerResourceVersion" enabled=false* z6 Z7 i5 Q% X5 O5 ^* U
I1231 22:10:13.957105    4733 envvar.go:172] "Feature gate default state" feature="WatchListClient" enabled=false
2 B8 n0 m1 _; R6 [' f8 mI1231 22:10:13.958189    4733 reset.go:140] [reset] Loaded client set from kubeconfig file: /etc/kubernetes/admin.conf
/ O; }" r. i- J7 x# i* |" O! a& C[reset] Reading configuration from the "kubeadm-config" ConfigMap in namespace "kube-system"...1 x7 M7 [2 i' i, t, O
[reset] Use 'kubeadm init phase upload-config --config your-config.yaml' to re-upload it.. z( u6 m1 ?- ?
I1231 22:10:13.987152    4733 kubeproxy.go:55] attempting to download the KubeProxyConfiguration from ConfigMap "kube-proxy", }7 s- @: P3 C# Z( Y% b4 |
I1231 22:10:13.996160    4733 kubelet.go:74] attempting to download the KubeletConfiguration from ConfigMap "kubelet-config"0 \8 |) C2 W. `( w, R  X& A
I1231 22:10:14.016090    4733 cert_rotation.go:140] Starting client certificate rotation controller
; v- k" m; J1 C2 j0 _7 ZW1231 22:10:14.056437    4733 preflight.go:56] [reset] WARNING: Changes made to this host by 'kubeadm init' or 'kubeadm join' will be reverted.! K9 i+ Y" S$ \) _9 a0 l
[reset] Are you sure you want to proceed? [y/N]: y6 Y/ f" z8 A4 F; S' k4 t1 ?
[preflight] Running pre-flight checks3 W* u/ `- c) r: G, N; _
I1231 22:10:17.885878    4733 removeetcdmember.go:60] [reset] Checking for etcd config2 l$ d) w; ]6 T4 l) b
I1231 22:10:17.885933    4733 local.go:94] [etcd] creating etcd client that connects to etcd pods0 Q" f, e; M2 ]; t/ j8 A$ K
I1231 22:10:17.885997    4733 etcd.go:215] retrieving etcd endpoints from "kubeadm.kubernetes.io/etcd.advertise-client-urls" annotation in etcd Pods
9 _$ W( A& ?8 W9 B5 W( sI1231 22:10:17.892577    4733 etcd.go:149] etcd endpoints read from pods: https://192.168.8.190:2379) Y$ z/ a+ w/ X7 o! e" |
I1231 22:10:17.926126    4733 etcd.go:274] etcd endpoints read from etcd: https://192.168.8.190:23799 O7 V  s# m" p. B
I1231 22:10:17.926169    4733 etcd.go:167] update etcd endpoints: https://192.168.8.190:2379- {! R; k. ]6 S7 l3 l, E
I1231 22:10:17.950985    4733 local.go:110] [etcd] This is the only remaining etcd member in the etcd cluster, skip removing it
- O$ u# z0 v7 X, z" |[reset] Deleted contents of the etcd data directory: /var/lib/etcd% y- X6 B% ~3 i! r+ o5 g9 _4 p
I1231 22:10:17.951626    4733 cleanupnode.go:65] [reset] Getting init system
: p6 c7 \5 w6 `. c( b/ U[reset] Stopping the kubelet service
, C: K9 h" h( ~% C3 @* x0 ?& X[reset] Unmounting mounted directories in "/var/lib/kubelet"
; h6 \8 a1 V/ w* [' {- Q/ I/ ]I1231 22:10:18.002240    4733 unmount_linux.go:72] [reset] Unmounting "/var/lib/kubelet/pods/79a6bb09-1c6b-4b62-90ae-6baafcc5ff78/volumes/kubernetes.io~projected/kube-api-access-2gnmv"$ r: @, P+ U# o- t0 F& K
I1231 22:10:18.005902    4733 cleanupnode.go:103] [reset] Removing Kubernetes-managed containers1 Q6 {% p9 {/ C1 L% G  o
I1231 22:10:18.019561    4733 runtime.go:142] Attempting to remove container b0d854b20b57b922423d50168d30e0885573087bef0b2bb13248e1d309784bac
4 ]. X( H- t$ vI1231 22:10:18.287443    4733 runtime.go:142] Attempting to remove container ef43a1e54c62f838232ddb82699aab7d12436cff1e68de564479ee9a02220d04
' D# V* i, ]1 ^2 r1 j3 gI1231 22:10:18.544023    4733 runtime.go:142] Attempting to remove container c80c7ef23e4af24b2b714963419e5ae27a75ddf811f93bc4a96ee59229626dcb6 D5 j" b) {. H6 J9 [1 k
I1231 22:10:18.801848    4733 runtime.go:142] Attempting to remove container 6818fca85e063f92a365c493cc1895656aced93722afc2046dcf4e1616451904& X0 b/ R6 R$ |) {
I1231 22:10:19.074257    4733 runtime.go:142] Attempting to remove container cae358d36a25db438f6470cfc82fb6a7e6931e9cf5de374540cf6cf2c7bc31907 |/ _+ X* @2 |5 O# \: }
[reset] Deleting contents of directories: [/etc/kubernetes/manifests /var/lib/kubelet /etc/kubernetes/pki]
- o  m( b- H8 v0 \[reset] Deleting files: [/etc/kubernetes/admin.conf /etc/kubernetes/super-admin.conf /etc/kubernetes/kubelet.conf /etc/kubernetes/bootstrap-kubelet.conf /etc/kubernetes/controller-manager.conf /etc/kubernetes/scheduler.conf]) `8 V# j: K- w9 \
; ~! i- }& M  ^' ^# X; D1 D- T
The reset process does not clean CNI configuration. To do so, you must remove /etc/cni/net.d0 \  M7 [8 g' U! H% k
" z1 C' v# k4 q$ P
The reset process does not reset or clean up iptables rules or IPVS tables.0 y& U, S. |0 ~8 n+ J
If you wish to reset iptables, you must do so manually by using the "iptables" command.
  Q7 l" T; S: K, B/ B
, L* A% t+ X7 s/ p6 B! WIf your cluster was setup to utilize IPVS, run ipvsadm --clear (or similar)
$ r3 l: M. e& {# j. Kto reset your system's IPVS tables.
5 }4 Y+ d6 ^2 I* N6 p" c( H2 p9 v2 u8 p
$ }7 }, j+ h. ]$ G6 vThe reset process does not clean your kubeconfig files and you must remove them manually.
- D. }  s' Q/ Y5 \" O* U. p$ V8 ~Please, check the contents of the $HOME/.kube/config file.
# p- C) i6 Y+ M0 W7 _0 V; Q9 k  I5 |# l/ S
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 01:34 , Processed in 0.016564 second(s), 21 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表