找回密码
 注册
查看: 10|回复: 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=... & r9 I7 f  E9 R' {+ g; |1 m7 S
I1231 22:10:13.956939    4733 envvar.go:172] "Feature gate default state" feature="ClientsAllowCBOR" enabled=false2 L# \8 w! `" B  d) p# C* I
I1231 22:10:13.957052    4733 envvar.go:172] "Feature gate default state" feature="ClientsPreferCBOR" enabled=false
5 e: j" Y: f# _- `) V5 y+ b8 ?9 HI1231 22:10:13.957081    4733 envvar.go:172] "Feature gate default state" feature="InformerResourceVersion" enabled=false
4 L0 b9 ]# F5 E6 D, c0 EI1231 22:10:13.957105    4733 envvar.go:172] "Feature gate default state" feature="WatchListClient" enabled=false
$ L; X6 X! K- f( A- fI1231 22:10:13.958189    4733 reset.go:140] [reset] Loaded client set from kubeconfig file: /etc/kubernetes/admin.conf# M: u/ F, o" u1 F4 V. o" o+ G
[reset] Reading configuration from the "kubeadm-config" ConfigMap in namespace "kube-system"...3 R4 F9 k  X9 _0 s1 b
[reset] Use 'kubeadm init phase upload-config --config your-config.yaml' to re-upload it.
. i2 Z( ?( {7 A4 ~( A, @! }+ \I1231 22:10:13.987152    4733 kubeproxy.go:55] attempting to download the KubeProxyConfiguration from ConfigMap "kube-proxy"2 C) t2 _/ i5 K
I1231 22:10:13.996160    4733 kubelet.go:74] attempting to download the KubeletConfiguration from ConfigMap "kubelet-config"
7 A) r& [; M  ?0 XI1231 22:10:14.016090    4733 cert_rotation.go:140] Starting client certificate rotation controller# ]" n1 G# b& A0 o# Q
W1231 22:10:14.056437    4733 preflight.go:56] [reset] WARNING: Changes made to this host by 'kubeadm init' or 'kubeadm join' will be reverted.
" I6 X: D  d# z& W$ A* G[reset] Are you sure you want to proceed? [y/N]: y
/ z7 c& y1 J' K& j4 r[preflight] Running pre-flight checks
0 P) R- }7 N& m& ~I1231 22:10:17.885878    4733 removeetcdmember.go:60] [reset] Checking for etcd config! s+ h% s9 g  \1 v5 j% y
I1231 22:10:17.885933    4733 local.go:94] [etcd] creating etcd client that connects to etcd pods( f/ C9 a- s! b( t; f
I1231 22:10:17.885997    4733 etcd.go:215] retrieving etcd endpoints from "kubeadm.kubernetes.io/etcd.advertise-client-urls" annotation in etcd Pods
' O7 c8 N# h( N* {2 g0 S4 [: ^I1231 22:10:17.892577    4733 etcd.go:149] etcd endpoints read from pods: https://192.168.8.190:2379
: V- _% x, }) u4 C/ [I1231 22:10:17.926126    4733 etcd.go:274] etcd endpoints read from etcd: https://192.168.8.190:2379& C6 G* U( w8 b- K% C
I1231 22:10:17.926169    4733 etcd.go:167] update etcd endpoints: https://192.168.8.190:2379
& G5 v2 ~% h, \/ CI1231 22:10:17.950985    4733 local.go:110] [etcd] This is the only remaining etcd member in the etcd cluster, skip removing it
9 d3 o1 I6 r" @% T* D# @[reset] Deleted contents of the etcd data directory: /var/lib/etcd5 W/ ], r3 o7 J6 g3 ^6 N
I1231 22:10:17.951626    4733 cleanupnode.go:65] [reset] Getting init system
: ?( |) V: u' n# C8 O3 w[reset] Stopping the kubelet service) _! W/ r+ S) g
[reset] Unmounting mounted directories in "/var/lib/kubelet"* j' i, z( f5 r& t
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"
7 ^7 O$ S& E5 [( K7 H$ oI1231 22:10:18.005902    4733 cleanupnode.go:103] [reset] Removing Kubernetes-managed containers/ N# x5 \: R# v9 s' l1 l
I1231 22:10:18.019561    4733 runtime.go:142] Attempting to remove container b0d854b20b57b922423d50168d30e0885573087bef0b2bb13248e1d309784bac" [" W  B+ }- h( r+ Q$ r1 w
I1231 22:10:18.287443    4733 runtime.go:142] Attempting to remove container ef43a1e54c62f838232ddb82699aab7d12436cff1e68de564479ee9a02220d04  }4 Q& s: T1 ~0 f, [: {
I1231 22:10:18.544023    4733 runtime.go:142] Attempting to remove container c80c7ef23e4af24b2b714963419e5ae27a75ddf811f93bc4a96ee59229626dcb; y, p5 @; u$ y8 w7 v
I1231 22:10:18.801848    4733 runtime.go:142] Attempting to remove container 6818fca85e063f92a365c493cc1895656aced93722afc2046dcf4e1616451904
, X$ U/ O  T7 M$ t& F" qI1231 22:10:19.074257    4733 runtime.go:142] Attempting to remove container cae358d36a25db438f6470cfc82fb6a7e6931e9cf5de374540cf6cf2c7bc3190
7 G) c: ~  N. U2 U[reset] Deleting contents of directories: [/etc/kubernetes/manifests /var/lib/kubelet /etc/kubernetes/pki]7 b" i) [1 i" O
[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]5 Q5 B5 x: }: Z' w7 [  _1 Y
3 R. V% C3 F1 b
The reset process does not clean CNI configuration. To do so, you must remove /etc/cni/net.d, m7 R6 I% U$ P( |4 I* u) c
! F+ ]: l9 t& v  @
The reset process does not reset or clean up iptables rules or IPVS tables.& R8 s$ L( e9 o1 K8 ~% ~4 D
If you wish to reset iptables, you must do so manually by using the "iptables" command.7 f; q. {2 C. ?: Y9 ?- C6 K

1 @$ o2 w# y0 s7 P0 lIf your cluster was setup to utilize IPVS, run ipvsadm --clear (or similar)
2 V/ h+ ]% {; Rto reset your system's IPVS tables.9 P( d2 z# J6 g$ {0 n7 w6 x
2 O! i- c6 d- I4 z2 ^# f& M+ `$ h
The reset process does not clean your kubeconfig files and you must remove them manually.' N9 p" u4 r# D' i/ s0 y( b
Please, check the contents of the $HOME/.kube/config file.- m  w) C9 O2 _! d" z

& D% C; ~+ T! Y( m
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-12 00:32 , Processed in 0.012352 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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