|
|
kubernets先重置配置reset # ?* `- K* a$ l9 g( h1 ?
[root@k8s-master ~]# kubeadm reset --v=5 --cri-socket=unix:///var/run/cri-dockerd.sock
2 b! B2 W# q4 s5 d" _I0103 22:43:08.557654 83642 reset.go:126] [reset] Could not obtain a client set from the kubeconfig file: /etc/kubernetes/admin.conf
. `. L) [: o5 m. @( v0 AW0103 22:43:08.557782 83642 preflight.go:56] [reset] WARNING: Changes made to this host by 'kubeadm init' or 'kubeadm join' will be reverted.
2 j/ k1 s8 f: G! \[reset] Are you sure you want to proceed? [y/N]: Y) i6 n! I# S1 a5 o6 S
[preflight] Running pre-flight checks$ @9 J+ z5 c6 x; J+ `
I0103 22:43:13.735565 83642 removeetcdmember.go:60] [reset] Checking for etcd config
0 w7 l/ y1 ]' j; }W0103 22:43:13.735621 83642 removeetcdmember.go:106] [reset] No kubeadm config, using etcd pod spec to get data directory x9 A0 N! V2 W& K" j3 s0 A- n
I0103 22:43:13.735774 83642 cleanupnode.go:65] [reset] Getting init system
& u' l" x" L2 m0 s7 u[reset] Stopping the kubelet service3 `4 J( b/ F8 l( J6 e6 m2 [2 @
[reset] Unmounting mounted directories in "/var/lib/kubelet"3 t7 O- b6 m/ I, v# m; x" n: ]
I0103 22:43:13.743121 83642 cleanupnode.go:103] [reset] Removing Kubernetes-managed containers' s! O& F6 y; C! `
[reset] Deleting contents of directories: [/etc/kubernetes/manifests /var/lib/kubelet /etc/kubernetes/pki]4 ~+ f$ e6 I4 r( a( J/ A; s% y9 [1 f3 E
[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]
( J8 B* X! L- x5 G3 h3 W0 _: g. `7 g; _, x
The reset process does not clean CNI configuration. To do so, you must remove /etc/cni/net.d
2 b7 e7 V; c8 j7 S( F1 i9 b+ k9 \. r% n/ d+ i
The reset process does not reset or clean up iptables rules or IPVS tables./ _5 y3 K1 A+ Q. p
If you wish to reset iptables, you must do so manually by using the "iptables" command., G2 w6 V5 x, s" D8 k* Z
, U! g$ w& ^1 a, w. t6 R1 ?If your cluster was setup to utilize IPVS, run ipvsadm --clear (or similar)7 D2 I# d0 K, Z9 H+ e
to reset your system's IPVS tables.* g3 _; y: K( F! ?
" J6 P" }+ r4 g4 c# ~! r
The reset process does not clean your kubeconfig files and you must remove them manually.
' c5 e, E+ x" w* | u3 z: Y, |Please, check the contents of the $HOME/.kube/config file.5 _* Z* s1 v2 A) V: w) \% `
$ c! P; w# j( f' c4 m重新通过文件初始化: P. Q; f Z' I' p% f7 r5 H
$ {! q9 R" a, U3 o" G
[root@k8s-master ~]# kubeadm init --config=kubeadm-init-config.yaml --v=5 --ignore-preflight-errors=SystemVerification
- G* }; W7 t) II0104 08:21:57.040996 3326 initconfiguration.go:261] loading configuration from "kubeadm-init-config.yaml"
, ~; n, q; ]5 BI0104 08:21:57.044966 3326 kubelet.go:195] the value of KubeletConfiguration.cgroupDriver is empty; setting it to "systemd"
1 O% {6 h4 ?1 S9 L9 I[init] Using Kubernetes version: v1.31.0! f; u9 P: _* M2 v/ Y
[preflight] Running pre-flight checks
~% e7 m) f2 m' ?" EI0104 08:21:57.050536 3326 checks.go:561] validating Kubernetes and kubeadm version, H7 S2 ?2 R. w( E
I0104 08:21:57.050579 3326 checks.go:166] validating if the firewall is enabled and active$ A+ ]2 t( x! E& p9 O v
I0104 08:21:57.060446 3326 checks.go:201] validating availability of port 6443# P) v1 S: X% L! A4 [) |
I0104 08:21:57.060692 3326 checks.go:201] validating availability of port 10259
: s$ {" t p, e+ cI0104 08:21:57.060939 3326 checks.go:201] validating availability of port 10257
4 W1 }. o$ L' J9 x1 EI0104 08:21:57.061025 3326 checks.go:278] validating the existence of file /etc/kubernetes/manifests/kube-apiserver.yaml
" }- [: S: F/ s6 k2 S4 r c, wI0104 08:21:57.061056 3326 checks.go:278] validating the existence of file /etc/kubernetes/manifests/kube-controller-manager.yaml
C# R5 k8 m' V0 _/ ^5 GI0104 08:21:57.061107 3326 checks.go:278] validating the existence of file /etc/kubernetes/manifests/kube-scheduler.yaml
3 D. A7 I' I, NI0104 08:21:57.061147 3326 checks.go:278] validating the existence of file /etc/kubernetes/manifests/etcd.yaml T4 d: f9 M5 d: s' f4 u
I0104 08:21:57.061183 3326 checks.go:428] validating if the connectivity type is via proxy or direct0 f, n* t3 A. _& g2 W8 @
I0104 08:21:57.061246 3326 checks.go:467] validating http connectivity to first IP address in the CIDR
8 ^" B7 r5 K2 }% mI0104 08:21:57.061353 3326 checks.go:467] validating http connectivity to first IP address in the CIDR' a9 l0 V8 J2 @
I0104 08:21:57.061375 3326 checks.go:102] validating the container runtime
. I/ F; m+ `/ _1 r3 bI0104 08:21:57.062389 3326 checks.go:637] validating whether swap is enabled or not, C0 p! \4 j; @1 O8 \! f5 A& l9 \
I0104 08:21:57.062579 3326 checks.go:368] validating the presence of executable crictl
* G& D$ d! l$ o" t+ T4 k. c! ]- QI0104 08:21:57.062652 3326 checks.go:368] validating the presence of executable conntrack) ~; _# b' f# r$ G5 B: u! O& B( D
I0104 08:21:57.062709 3326 checks.go:368] validating the presence of executable ip6 d2 U5 n. ?! D5 s0 b/ S
I0104 08:21:57.062777 3326 checks.go:368] validating the presence of executable iptables( s- A' g& {: |
I0104 08:21:57.062850 3326 checks.go:368] validating the presence of executable mount) E% ^) X# |, V7 y
I0104 08:21:57.062979 3326 checks.go:368] validating the presence of executable nsenter. J9 a+ k0 c2 F) J& P% n2 {/ q
I0104 08:21:57.063051 3326 checks.go:368] validating the presence of executable ethtool
' [& B2 g0 s fI0104 08:21:57.063123 3326 checks.go:368] validating the presence of executable tc- k/ T9 t) t, }% x& {
I0104 08:21:57.063178 3326 checks.go:368] validating the presence of executable touch
' K5 ?( }) h& q1 g1 _4 WI0104 08:21:57.063261 3326 checks.go:514] running all checks X; v! f6 J8 y) `
[preflight] The system verification failed. Printing the output from the verification:4 m( Z/ @& r, R6 T. o
KERNEL_VERSION: 4.18.16x86-4.18-16
* }& y2 n5 i `+ MOS: Linux8 [5 z& x2 k- q8 f0 d
CGROUPS_CPU: enabled7 a7 g" M2 `7 ]# I6 N" w3 ^
CGROUPS_CPUACCT: enabled& G8 t1 o5 X- W
CGROUPS_CPUSET: enabled- V$ [; g( I( u0 R3 ^0 Y, g
CGROUPS_DEVICES: enabled
" o: G$ {1 o! ^- OCGROUPS_FREEZER: enabled
0 t* f9 v/ S a5 \, q7 J& n5 v: WCGROUPS_MEMORY: enabled
6 A, q. s, x8 M4 X, uCGROUPS_PIDS: enabled! @# H, }0 H2 w Q) A3 e, L, P! w
CGROUPS_HUGETLB: enabled
% j7 o0 v! E9 e7 Y# i& GCGROUPS_BLKIO: enabled
& w2 }. Y3 q) E, c# V' @ [WARNING SystemVerification]: failed to parse kernel config: unable to load kernel module: "configs", output: "modprobe: FATAL: Module configs not found.\n", err: exit status 1& K; V: v; y) e# R4 G' j
I0104 08:21:57.069077 3326 checks.go:399] checking whether the given node name is valid and reachable using net.LookupHost6 {2 A4 h4 @& A h! A
[WARNING Hostname]: hostname "node" could not be reached
6 H U7 y, D3 x5 {5 v g; N- j [WARNING Hostname]: hostname "node": lookup node on 202.106.0.20:53: no such host
) ]) q$ p" v+ J" k8 P6 U6 H( \I0104 08:21:57.075047 3326 checks.go:603] validating kubelet version' f* y; s: @8 B2 t* P; d9 C
I0104 08:21:57.148436 3326 checks.go:128] validating if the "kubelet" service is enabled and active
% d1 f" G2 W, v4 I4 `, n5 w7 r. _; }I0104 08:21:57.159069 3326 checks.go:201] validating availability of port 10250
) ]& f$ i4 y8 a6 X- {' PI0104 08:21:57.159163 3326 checks.go:327] validating the contents of file /proc/sys/net/ipv4/ip_forward7 I% B4 i+ U m- t" G" b% O1 ^: q# E/ ~
I0104 08:21:57.159232 3326 checks.go:201] validating availability of port 2379
- e6 M8 l' m1 B) O6 l; b0 q4 uI0104 08:21:57.159292 3326 checks.go:201] validating availability of port 23807 g0 C, x8 C. K5 `* O
I0104 08:21:57.159451 3326 checks.go:241] validating the existence and emptiness of directory /var/lib/etcd) k ], A. U0 G# e& C
[preflight] Pulling images required for setting up a Kubernetes cluster
9 S$ A$ z$ A4 v6 e[preflight] This might take a minute or two, depending on the speed of your internet connection w c- ]+ R$ j2 u
[preflight] You can also perform this action beforehand using 'kubeadm config images pull'8 \/ f+ Y3 T9 ^8 n/ U; r
I0104 08:21:57.162812 3326 checks.go:832] using image pull policy: IfNotPresent& h& g# G- d$ e3 B
W0104 08:21:57.163929 3326 checks.go:846] detected that the sandbox image "registry.k8s.io/pause:3.6" of the container runtime is inconsistent with that used by kubeadm.It is recommended to use "registry.aliyuncs.com/google_containers/pause:3.10" as the CRI sandbox image.' j% F# g/ `. @" s# R+ T1 M, n0 v {
I0104 08:21:57.164932 3326 checks.go:871] pulling: registry.aliyuncs.com/google_containers/kube-apiserver:v1.31.02 b; }. v/ R- R5 X! T
I0104 08:22:03.825498 3326 checks.go:871] pulling: registry.aliyuncs.com/google_containers/kube-controller-manager:v1.31.0
; x4 L& R0 k8 f/ f% ~7 k0 CI0104 08:22:09.870677 3326 checks.go:871] pulling: registry.aliyuncs.com/google_containers/kube-scheduler:v1.31.0* y: M5 E0 u& |9 R
I0104 08:22:14.792245 3326 checks.go:871] pulling: registry.aliyuncs.com/google_containers/kube-proxy:v1.31.0
: n9 g% R7 }. [" ?& RI0104 08:22:21.833498 3326 checks.go:871] pulling: registry.aliyuncs.com/google_containers/coredns:v1.11.3
) v7 K. S( q& ?: uI0104 08:22:26.694562 3326 checks.go:871] pulling: registry.aliyuncs.com/google_containers/pause:3.109 m$ _4 n! R! j# Z7 j2 D& E2 c P
I0104 08:22:27.874314 3326 checks.go:871] pulling: registry.aliyuncs.com/google_containers/etcd:3.5.15-0
0 @. O7 H1 u) A, W3 d/ q2 @[certs] Using certificateDir folder "/etc/kubernetes/pki"* }8 o5 o' \8 w N& P1 l
I0104 08:22:38.609775 3326 certs.go:112] creating a new certificate authority for ca
' @4 D6 X+ {5 R* f( c[certs] Generating "ca" certificate and key
6 x/ W' \" f; O/ m. w5 W9 u1 E) V; rI0104 08:22:39.795060 3326 certs.go:473] validating certificate period for ca certificate
1 P( q- a: L: E7 K[certs] Generating "apiserver" certificate and key
/ |2 j% {! y7 l[certs] apiserver serving cert is signed for DNS names [kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local node] and IPs [172.29.16.1 1.2.3.4]6 N3 T# \) `5 g. F2 u9 c7 C% Y! C7 M
[certs] Generating "apiserver-kubelet-client" certificate and key
9 m5 o1 j; b& @7 t/ s( T0 `. ^I0104 08:22:40.424934 3326 certs.go:112] creating a new certificate authority for front-proxy-ca
, P3 k* W. X1 D: A[certs] Generating "front-proxy-ca" certificate and key* F" t( W @' n2 e" n" `' ^6 Z
I0104 08:22:40.745566 3326 certs.go:473] validating certificate period for front-proxy-ca certificate
x i w0 {" V" Q4 ]3 B: f( |9 w, K[certs] Generating "front-proxy-client" certificate and key
0 }" I; U9 D9 xI0104 08:22:41.527532 3326 certs.go:112] creating a new certificate authority for etcd-ca& _- P, C2 `. h" l9 E2 u" K
[certs] Generating "etcd/ca" certificate and key
4 {; a' P2 u8 [: r0 F( II0104 08:22:42.751929 3326 certs.go:473] validating certificate period for etcd/ca certificate
& S2 ?( A. H+ V% y3 l[certs] Generating "etcd/server" certificate and key
5 D# g w0 l# s' o- a1 U' D[certs] etcd/server serving cert is signed for DNS names [localhost node] and IPs [1.2.3.4 127.0.0.1 ::1]' M* J* ~6 U; u% j
[certs] Generating "etcd/peer" certificate and key0 x: O% p0 f9 \% Z/ ~2 r1 ^
[certs] etcd/peer serving cert is signed for DNS names [localhost node] and IPs [1.2.3.4 127.0.0.1 ::1]
; B' ~, t+ V8 M3 u1 ~( r[certs] Generating "etcd/healthcheck-client" certificate and key
! |8 X* E, ~( i6 Q9 c+ H[certs] Generating "apiserver-etcd-client" certificate and key' x9 I% R/ u* g1 \& V& J
I0104 08:22:45.579717 3326 certs.go:78] creating new public/private key files for signing service account users
% B7 z, ?! }% n+ t[certs] Generating "sa" key and public key( i8 E1 O0 Y% c% w
[kubeconfig] Using kubeconfig folder "/etc/kubernetes"% b! g) e. \& A7 x! c
I0104 08:22:45.821509 3326 kubeconfig.go:111] creating kubeconfig file for admin.conf
+ s+ Z/ H! d- S3 K0 w" H[kubeconfig] Writing "admin.conf" kubeconfig file
: z4 J9 Z' X9 nI0104 08:22:46.146568 3326 kubeconfig.go:111] creating kubeconfig file for super-admin.conf
( a3 i3 b. V- T( J2 ^4 h[kubeconfig] Writing "super-admin.conf" kubeconfig file
( O# {' K% }( H6 K" H8 aI0104 08:22:46.913876 3326 kubeconfig.go:111] creating kubeconfig file for kubelet.conf/ {2 o1 A. {. i1 D# ^
[kubeconfig] Writing "kubelet.conf" kubeconfig file
( \# T2 Y- c; a2 X' kI0104 08:22:47.189373 3326 kubeconfig.go:111] creating kubeconfig file for controller-manager.conf
% o! \2 b: P- H$ j" p- `% O[kubeconfig] Writing "controller-manager.conf" kubeconfig file
) U$ c2 B9 V; A) X- LI0104 08:22:47.789782 3326 kubeconfig.go:111] creating kubeconfig file for scheduler.conf
) }6 R ]% R7 V; b[kubeconfig] Writing "scheduler.conf" kubeconfig file
8 K( Z2 }. A. g: f7 o: l2 Y[etcd] Creating static Pod manifest for local etcd in "/etc/kubernetes/manifests"; u K% t8 B$ m3 X$ r. ?
I0104 08:22:48.176199 3326 local.go:65] [etcd] wrote Static Pod manifest for a local etcd member to "/etc/kubernetes/manifests/etcd.yaml": D' m, m8 k: A8 d8 @* J
[control-plane] Using manifest folder "/etc/kubernetes/manifests"
; T1 p5 P$ b8 I' t+ U0 L' S. C- N[control-plane] Creating static Pod manifest for "kube-apiserver"5 X! {1 k2 T8 ]3 e# H: j
I0104 08:22:48.176664 3326 manifests.go:103] [control-plane] getting StaticPodSpecs
9 ?" R5 g# [4 U! ~I0104 08:22:48.177133 3326 certs.go:473] validating certificate period for CA certificate
6 z! ^7 ^- w/ H- H. ZI0104 08:22:48.177225 3326 manifests.go:129] [control-plane] adding volume "ca-certs" for component "kube-apiserver"6 s% k1 s" `3 P5 j# y
I0104 08:22:48.177245 3326 manifests.go:129] [control-plane] adding volume "etc-pki-ca-trust" for component "kube-apiserver"
9 G( E2 q* u" c- q0 \+ wI0104 08:22:48.177257 3326 manifests.go:129] [control-plane] adding volume "etc-pki-tls-certs" for component "kube-apiserver"
& i; a) @* f; a8 eI0104 08:22:48.177270 3326 manifests.go:129] [control-plane] adding volume "k8s-certs" for component "kube-apiserver"' `- x6 J3 ?1 U* z# g1 M0 m/ @- ~
I0104 08:22:48.178627 3326 manifests.go:158] [control-plane] wrote static Pod manifest for component "kube-apiserver" to "/etc/kubernetes/manifests/kube-apiserver.yaml" e. W. f$ i! l7 N
[control-plane] Creating static Pod manifest for "kube-controller-manager"' [8 K! r$ q: b5 h9 q/ s/ x! P$ M
I0104 08:22:48.178653 3326 manifests.go:103] [control-plane] getting StaticPodSpecs
, I% o0 a: m# XI0104 08:22:48.178973 3326 manifests.go:129] [control-plane] adding volume "ca-certs" for component "kube-controller-manager"# j: K& a8 k/ R% f/ Z8 v
I0104 08:22:48.178993 3326 manifests.go:129] [control-plane] adding volume "etc-pki-ca-trust" for component "kube-controller-manager"
$ F6 P3 D# U4 q8 R! {' II0104 08:22:48.179005 3326 manifests.go:129] [control-plane] adding volume "etc-pki-tls-certs" for component "kube-controller-manager"
) B A/ s' m; E% o1 JI0104 08:22:48.179018 3326 manifests.go:129] [control-plane] adding volume "flexvolume-dir" for component "kube-controller-manager"
8 I" K6 |% }( e7 [, i* |I0104 08:22:48.179030 3326 manifests.go:129] [control-plane] adding volume "k8s-certs" for component "kube-controller-manager"
+ s/ I& ?9 V b7 A5 [! k+ G4 a" ?I0104 08:22:48.179043 3326 manifests.go:129] [control-plane] adding volume "kubeconfig" for component "kube-controller-manager"( n. S/ u+ x! C( }+ U& ]
I0104 08:22:48.180113 3326 manifests.go:158] [control-plane] wrote static Pod manifest for component "kube-controller-manager" to "/etc/kubernetes/manifests/kube-controller-manager.yaml"
; T6 }8 \# {7 n% `7 _- J, _2 W[control-plane] Creating static Pod manifest for "kube-scheduler"
6 |4 ?& I* h. D9 c* T9 EI0104 08:22:48.180140 3326 manifests.go:103] [control-plane] getting StaticPodSpecs
8 K7 R- ]0 c2 T% D. H- e9 ~I0104 08:22:48.180470 3326 manifests.go:129] [control-plane] adding volume "kubeconfig" for component "kube-scheduler"
- y' _7 y4 Y( _, A( ], F A7 J. ZI0104 08:22:48.181362 3326 manifests.go:158] [control-plane] wrote static Pod manifest for component "kube-scheduler" to "/etc/kubernetes/manifests/kube-scheduler.yaml"& P) ]0 Z, T% s
I0104 08:22:48.181506 3326 kubelet.go:68] Stopping the kubelet( S/ o; H( g G: e; x4 X3 O5 g3 ?
I0104 08:22:48.194634 3326 flags.go:101] setting kubelet hostname-override to "node"3 `5 J! E5 [2 a, C
[kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env"
, t6 |) ~( W. r( k[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"
* h( D/ @. ?' o[kubelet-start] Starting the kubelet- o& l6 D$ W& E
[wait-control-plane] Waiting for the kubelet to boot up the control plane as static Pods from directory "/etc/kubernetes/manifests"4 K' i/ e" ?% U& F
[kubelet-check] Waiting for a healthy kubelet at http://127.0.0.1:10248/healthz. This can take up to 4m0s- [' e# @" z1 ?
[kubelet-check] The kubelet is healthy after 2.502312387s
2 K- m0 V' X- q; B! E5 L[api-check] Waiting for a healthy API server. This can take up to 4m0s$ A, z% q5 [6 H; O
3 L3 k' D1 l6 b
9 X0 f8 ?7 o3 `# k2 g
! h( U T5 Q$ j
/ l& `* C7 ~# w
/ r% Q$ l' ~$ r ` c* }+ Y5 \" x5 O- }" }, C4 }: }% O
|
|