找回密码
 注册
查看: 9|回复: 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=...
, A6 A1 _% n% f0 JI1231 22:10:13.956939    4733 envvar.go:172] "Feature gate default state" feature="ClientsAllowCBOR" enabled=false
( E! F7 _! c  C% |! @! X( p; DI1231 22:10:13.957052    4733 envvar.go:172] "Feature gate default state" feature="ClientsPreferCBOR" enabled=false0 V  q4 e. j) K3 j
I1231 22:10:13.957081    4733 envvar.go:172] "Feature gate default state" feature="InformerResourceVersion" enabled=false
) g+ |$ `+ E( k4 yI1231 22:10:13.957105    4733 envvar.go:172] "Feature gate default state" feature="WatchListClient" enabled=false* t+ W9 `/ x& {( f
I1231 22:10:13.958189    4733 reset.go:140] [reset] Loaded client set from kubeconfig file: /etc/kubernetes/admin.conf  I) E( c* x9 k; l5 s, U
[reset] Reading configuration from the "kubeadm-config" ConfigMap in namespace "kube-system"...5 O" m6 D9 d7 b- _% q( D) T/ a7 }
[reset] Use 'kubeadm init phase upload-config --config your-config.yaml' to re-upload it.
& J" L8 i/ b2 c  R/ hI1231 22:10:13.987152    4733 kubeproxy.go:55] attempting to download the KubeProxyConfiguration from ConfigMap "kube-proxy"0 d" i8 b! N5 H6 v# y) j' b
I1231 22:10:13.996160    4733 kubelet.go:74] attempting to download the KubeletConfiguration from ConfigMap "kubelet-config"$ X# h* S# x' Y. e) U# j
I1231 22:10:14.016090    4733 cert_rotation.go:140] Starting client certificate rotation controller8 L5 O9 _1 I* P9 N# w* w2 G/ ]
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.
2 N, c1 F% a6 s4 P/ ^: w9 A0 U$ O[reset] Are you sure you want to proceed? [y/N]: y
' v/ R( {; e4 t[preflight] Running pre-flight checks0 k( W/ r  }' ~" S; u
I1231 22:10:17.885878    4733 removeetcdmember.go:60] [reset] Checking for etcd config) }, o6 u) {% L3 o$ G
I1231 22:10:17.885933    4733 local.go:94] [etcd] creating etcd client that connects to etcd pods2 {  ]1 ~/ i9 _1 r3 \
I1231 22:10:17.885997    4733 etcd.go:215] retrieving etcd endpoints from "kubeadm.kubernetes.io/etcd.advertise-client-urls" annotation in etcd Pods
- ]0 {5 c  \  a6 {6 g: q1 e1 v* c# GI1231 22:10:17.892577    4733 etcd.go:149] etcd endpoints read from pods: https://192.168.8.190:23796 t+ u! N8 q$ d
I1231 22:10:17.926126    4733 etcd.go:274] etcd endpoints read from etcd: https://192.168.8.190:2379
4 _: E+ Q; E1 p$ x4 j5 j) v8 GI1231 22:10:17.926169    4733 etcd.go:167] update etcd endpoints: https://192.168.8.190:2379
/ m& o+ j* k6 Z8 W" PI1231 22:10:17.950985    4733 local.go:110] [etcd] This is the only remaining etcd member in the etcd cluster, skip removing it
8 O+ d' p& N( B: s# n[reset] Deleted contents of the etcd data directory: /var/lib/etcd
5 H2 A- L  A9 ZI1231 22:10:17.951626    4733 cleanupnode.go:65] [reset] Getting init system' O$ I  w% K* h: f4 v5 i& A# M
[reset] Stopping the kubelet service7 H- x1 _  h8 l' ~: j* m- d5 g
[reset] Unmounting mounted directories in "/var/lib/kubelet"; Z0 f: x: K+ X- W, Z, L0 r0 }
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"
* g' L0 ]4 W7 v) u( b' x5 \4 bI1231 22:10:18.005902    4733 cleanupnode.go:103] [reset] Removing Kubernetes-managed containers
" P5 `/ X7 S" j. I3 l' _7 O- b! ^9 rI1231 22:10:18.019561    4733 runtime.go:142] Attempting to remove container b0d854b20b57b922423d50168d30e0885573087bef0b2bb13248e1d309784bac
, P3 \0 r* p% H2 ]" s( s5 |5 zI1231 22:10:18.287443    4733 runtime.go:142] Attempting to remove container ef43a1e54c62f838232ddb82699aab7d12436cff1e68de564479ee9a02220d04
. ?$ }! ?4 x, ]3 W2 AI1231 22:10:18.544023    4733 runtime.go:142] Attempting to remove container c80c7ef23e4af24b2b714963419e5ae27a75ddf811f93bc4a96ee59229626dcb
7 j) h4 H0 C8 f5 L5 C0 D3 vI1231 22:10:18.801848    4733 runtime.go:142] Attempting to remove container 6818fca85e063f92a365c493cc1895656aced93722afc2046dcf4e1616451904
4 G3 h2 r* l" L3 qI1231 22:10:19.074257    4733 runtime.go:142] Attempting to remove container cae358d36a25db438f6470cfc82fb6a7e6931e9cf5de374540cf6cf2c7bc3190
& l# C  Y. y3 c* M- D[reset] Deleting contents of directories: [/etc/kubernetes/manifests /var/lib/kubelet /etc/kubernetes/pki], D7 x" E% P& D# D0 ?& W0 q- j
[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]2 \% Q5 y, v% b. t

  L0 t/ J$ w8 ?; \The reset process does not clean CNI configuration. To do so, you must remove /etc/cni/net.d) T* P: P% q  `( b1 f8 {
/ @9 S! m; I( Q) l
The reset process does not reset or clean up iptables rules or IPVS tables.- n! o: R. Y: r
If you wish to reset iptables, you must do so manually by using the "iptables" command.7 d1 u0 @( P. |) @, [
! r; ]- _- F! B( T
If your cluster was setup to utilize IPVS, run ipvsadm --clear (or similar)% U4 A' o5 k) H
to reset your system's IPVS tables.
8 x+ j! a# @/ m+ V  \! r& `7 }+ K0 I4 ]% ^) R6 `
The reset process does not clean your kubeconfig files and you must remove them manually.+ i, A( {% c/ Z/ j. i8 j1 }  n
Please, check the contents of the $HOME/.kube/config file.' y; F+ L6 b: w) ?( ~

3 J( X2 Q! h" E! u
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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