|
|
kubernets先重置配置reset
! ^) W6 s& g# @+ t) E5 }[root@k8s-master ~]# kubeadm reset --v=5 --cri-socket=unix:///var/run/cri-dockerd.sock 5 Y' d% b5 x4 z; x& R% M, H
I0103 22:43:08.557654 83642 reset.go:126] [reset] Could not obtain a client set from the kubeconfig file: /etc/kubernetes/admin.conf
& [! |( b& I, E6 J" H2 M/ UW0103 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 ]- H3 V3 f g" O B6 F& C[reset] Are you sure you want to proceed? [y/N]: Y7 ?5 Z9 U8 L9 `/ ^. R2 t5 p9 f
[preflight] Running pre-flight checks
# q& n) d- g% r' u, _I0103 22:43:13.735565 83642 removeetcdmember.go:60] [reset] Checking for etcd config
* ^$ w: p3 i! {/ F$ D2 PW0103 22:43:13.735621 83642 removeetcdmember.go:106] [reset] No kubeadm config, using etcd pod spec to get data directory
9 q$ v$ ?+ n" b: O* e0 _! [! J/ {5 zI0103 22:43:13.735774 83642 cleanupnode.go:65] [reset] Getting init system
8 o3 B8 r3 i* b[reset] Stopping the kubelet service7 E" k2 m% w4 b" Z! a$ w1 {
[reset] Unmounting mounted directories in "/var/lib/kubelet"
" y; ` G: }- [- o$ `" ZI0103 22:43:13.743121 83642 cleanupnode.go:103] [reset] Removing Kubernetes-managed containers
2 A$ }! ^5 m1 s2 }' R/ E8 q, m/ ~[reset] Deleting contents of directories: [/etc/kubernetes/manifests /var/lib/kubelet /etc/kubernetes/pki]6 T# L' Y: j3 V* r: X3 U; d* s2 [
[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]
7 i# S4 W1 y' v$ L# K, R2 z2 E! A" A4 ?. X8 s2 q
The reset process does not clean CNI configuration. To do so, you must remove /etc/cni/net.d
( l7 }9 C n, N% c# G' w
, W. p( e2 G* V8 a1 W; CThe reset process does not reset or clean up iptables rules or IPVS tables.
a' q, o9 i) S" S4 |If you wish to reset iptables, you must do so manually by using the "iptables" command.9 U$ s" s4 ~4 A( X
. h0 A* O S5 R1 b' NIf your cluster was setup to utilize IPVS, run ipvsadm --clear (or similar)! e, ]% k2 E* p6 u5 ^' H
to reset your system's IPVS tables.+ d9 ]6 n: T- Q# {
+ F8 v( {' n+ ~/ x ^! rThe reset process does not clean your kubeconfig files and you must remove them manually.4 G! P {; t" n5 M* z" E' F- f
Please, check the contents of the $HOME/.kube/config file.8 Z- d: ~; Q# D4 A' I
) d, ~/ x4 |' G. |0 |重新通过文件初始化:
+ J) t* b# X" Z5 v, w1 m- {1 E6 X: L7 k& t) c
[root@k8s-master ~]# kubeadm init --config=kubeadm-init-config.yaml --v=5 --ignore-preflight-errors=SystemVerification
, k9 D; U% L2 q2 U9 |& g$ z* II0104 08:21:57.040996 3326 initconfiguration.go:261] loading configuration from "kubeadm-init-config.yaml"
; g4 v( k$ K+ J! ~4 d- MI0104 08:21:57.044966 3326 kubelet.go:195] the value of KubeletConfiguration.cgroupDriver is empty; setting it to "systemd"
: Q& J6 V$ |+ B" X! W& e1 G[init] Using Kubernetes version: v1.31.0
1 ~( ^0 \' ~6 k1 c0 C, y; ][preflight] Running pre-flight checks) U p$ A% s& s4 L2 `% z9 O
I0104 08:21:57.050536 3326 checks.go:561] validating Kubernetes and kubeadm version
- b4 y& i! x# c. W2 E- s* A/ FI0104 08:21:57.050579 3326 checks.go:166] validating if the firewall is enabled and active, F8 H! H) C% _# W/ ?# J
I0104 08:21:57.060446 3326 checks.go:201] validating availability of port 6443
5 V" g6 J, v# N' b NI0104 08:21:57.060692 3326 checks.go:201] validating availability of port 10259
2 @' F/ b6 ]4 w$ ZI0104 08:21:57.060939 3326 checks.go:201] validating availability of port 10257
) u2 P4 w/ Y! hI0104 08:21:57.061025 3326 checks.go:278] validating the existence of file /etc/kubernetes/manifests/kube-apiserver.yaml1 t5 j! M5 z5 M& r
I0104 08:21:57.061056 3326 checks.go:278] validating the existence of file /etc/kubernetes/manifests/kube-controller-manager.yaml
3 @$ q( g/ Y. n- MI0104 08:21:57.061107 3326 checks.go:278] validating the existence of file /etc/kubernetes/manifests/kube-scheduler.yaml+ T6 m! n! J. B4 C8 a1 j' `
I0104 08:21:57.061147 3326 checks.go:278] validating the existence of file /etc/kubernetes/manifests/etcd.yaml5 l% I P9 B! \9 b' b7 b* w
I0104 08:21:57.061183 3326 checks.go:428] validating if the connectivity type is via proxy or direct
- g9 U( r% o# h: q0 JI0104 08:21:57.061246 3326 checks.go:467] validating http connectivity to first IP address in the CIDR
/ X+ c: K# A. z3 O4 N, SI0104 08:21:57.061353 3326 checks.go:467] validating http connectivity to first IP address in the CIDR- w$ h6 U2 U/ c2 i$ E3 x" G
I0104 08:21:57.061375 3326 checks.go:102] validating the container runtime# h: j O$ m, V' k5 D
I0104 08:21:57.062389 3326 checks.go:637] validating whether swap is enabled or not
% c. u2 e0 d$ E3 N, AI0104 08:21:57.062579 3326 checks.go:368] validating the presence of executable crictl
: M& [& @$ F! b- x8 i! DI0104 08:21:57.062652 3326 checks.go:368] validating the presence of executable conntrack
# o6 b* k9 C) `# z+ ^3 Y1 zI0104 08:21:57.062709 3326 checks.go:368] validating the presence of executable ip" A1 K2 X+ Q3 j8 o, Z
I0104 08:21:57.062777 3326 checks.go:368] validating the presence of executable iptables0 A, q$ @" l, D T+ w
I0104 08:21:57.062850 3326 checks.go:368] validating the presence of executable mount
7 s7 ]' `; m. N: U9 e0 ]0 NI0104 08:21:57.062979 3326 checks.go:368] validating the presence of executable nsenter, ~# j+ @9 I% @# o$ p
I0104 08:21:57.063051 3326 checks.go:368] validating the presence of executable ethtool
2 ~( Q. n* J1 ~! `# fI0104 08:21:57.063123 3326 checks.go:368] validating the presence of executable tc9 S" v- @8 m1 h6 f
I0104 08:21:57.063178 3326 checks.go:368] validating the presence of executable touch
: e( ?, a2 x* n- w2 X% x" d: J8 H6 RI0104 08:21:57.063261 3326 checks.go:514] running all checks5 H4 n7 v3 I6 D4 l c6 o
[preflight] The system verification failed. Printing the output from the verification:! U! o( j; ] f
KERNEL_VERSION: 4.18.16x86-4.18-16
: x9 z0 p( P1 @ J0 d/ p+ M1 L! JOS: Linux
6 A7 J- z! F/ L `CGROUPS_CPU: enabled
# n e0 Y* w3 UCGROUPS_CPUACCT: enabled. h5 W5 i( W* Y7 q; {
CGROUPS_CPUSET: enabled9 F* b' l, p! w. N0 M
CGROUPS_DEVICES: enabled8 j6 E' b( b, }$ O# W3 c
CGROUPS_FREEZER: enabled& \" {! c! S6 A6 v: u# }
CGROUPS_MEMORY: enabled0 b: j: _* u+ ^/ h
CGROUPS_PIDS: enabled
- y9 D- i9 T5 o0 @* m; C6 H2 U& qCGROUPS_HUGETLB: enabled
: z% d: L1 E; h( B% w- ?/ E& xCGROUPS_BLKIO: enabled
) z& X7 Y8 W. ?3 c4 x [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; d1 h$ m3 B( Q. X3 v
I0104 08:21:57.069077 3326 checks.go:399] checking whether the given node name is valid and reachable using net.LookupHost) H$ l0 Y9 t. A& z6 s1 M3 y H
[WARNING Hostname]: hostname "node" could not be reached2 @3 m8 I7 q" \7 Z" j0 @: x
[WARNING Hostname]: hostname "node": lookup node on 202.106.0.20:53: no such host
9 f4 B+ `% b: D5 ?: iI0104 08:21:57.075047 3326 checks.go:603] validating kubelet version
1 j+ q' X g$ A. \3 iI0104 08:21:57.148436 3326 checks.go:128] validating if the "kubelet" service is enabled and active# t4 G$ [/ ?: R: n3 n& D% o! l
I0104 08:21:57.159069 3326 checks.go:201] validating availability of port 10250
- L5 ]: p" Q3 Y7 _! R! @5 rI0104 08:21:57.159163 3326 checks.go:327] validating the contents of file /proc/sys/net/ipv4/ip_forward
$ @3 b4 y6 X( l% ]I0104 08:21:57.159232 3326 checks.go:201] validating availability of port 2379
0 q- V* a p2 g" cI0104 08:21:57.159292 3326 checks.go:201] validating availability of port 2380
- k& u2 I5 c& `3 d: E4 j+ ~6 sI0104 08:21:57.159451 3326 checks.go:241] validating the existence and emptiness of directory /var/lib/etcd
/ ]$ R8 _/ D* l* b0 o" l1 L[preflight] Pulling images required for setting up a Kubernetes cluster
4 k7 ^0 v& A4 I3 h/ R' X; q+ M" Z[preflight] This might take a minute or two, depending on the speed of your internet connection' T1 A8 a1 C- j8 L6 L, J5 u
[preflight] You can also perform this action beforehand using 'kubeadm config images pull'
+ C# o7 g2 v! F# _7 i: g/ |/ nI0104 08:21:57.162812 3326 checks.go:832] using image pull policy: IfNotPresent
. S, }0 t1 e0 J) ]$ g; w/ z9 TW0104 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./ O5 X0 y" d7 Y! d' O
I0104 08:21:57.164932 3326 checks.go:871] pulling: registry.aliyuncs.com/google_containers/kube-apiserver:v1.31.0
0 ?- U0 I# i+ QI0104 08:22:03.825498 3326 checks.go:871] pulling: registry.aliyuncs.com/google_containers/kube-controller-manager:v1.31.06 ?& k7 n: m3 M1 H* I, P; @
I0104 08:22:09.870677 3326 checks.go:871] pulling: registry.aliyuncs.com/google_containers/kube-scheduler:v1.31.0
4 e! q* Q) ^, @I0104 08:22:14.792245 3326 checks.go:871] pulling: registry.aliyuncs.com/google_containers/kube-proxy:v1.31.0
6 i9 t2 p% I3 }6 k2 Q' H3 I0 f1 mI0104 08:22:21.833498 3326 checks.go:871] pulling: registry.aliyuncs.com/google_containers/coredns:v1.11.3# I# Y9 T5 I; s5 K+ _! R
I0104 08:22:26.694562 3326 checks.go:871] pulling: registry.aliyuncs.com/google_containers/pause:3.10
J3 B9 w, N5 a) _1 w* U% uI0104 08:22:27.874314 3326 checks.go:871] pulling: registry.aliyuncs.com/google_containers/etcd:3.5.15-0
" q0 T# p! g+ Z- [[certs] Using certificateDir folder "/etc/kubernetes/pki"
, r* K6 k! }2 D" @3 C& j2 Z1 j) oI0104 08:22:38.609775 3326 certs.go:112] creating a new certificate authority for ca3 _" U1 @, Q: h- _2 c
[certs] Generating "ca" certificate and key: n' ?0 y: v5 I6 Q- G
I0104 08:22:39.795060 3326 certs.go:473] validating certificate period for ca certificate
9 E) ]" o3 }. _9 `" D& @0 L) }$ @[certs] Generating "apiserver" certificate and key# A! a2 G2 L3 c9 x h4 q
[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]
' J# B+ a) b4 [* |: f[certs] Generating "apiserver-kubelet-client" certificate and key2 Q& e: Y7 w7 x- m1 |( E& e
I0104 08:22:40.424934 3326 certs.go:112] creating a new certificate authority for front-proxy-ca
" M7 A3 e5 l/ {6 P1 [" t3 b/ i3 }[certs] Generating "front-proxy-ca" certificate and key
" }# {. |4 D' _, s6 |I0104 08:22:40.745566 3326 certs.go:473] validating certificate period for front-proxy-ca certificate+ e2 J$ n: J1 D
[certs] Generating "front-proxy-client" certificate and key9 W4 h3 G' w' P, B
I0104 08:22:41.527532 3326 certs.go:112] creating a new certificate authority for etcd-ca) ]% T) U, y( u- G2 `% @
[certs] Generating "etcd/ca" certificate and key
' V) n- |9 \7 |4 s, E8 v& x- ]I0104 08:22:42.751929 3326 certs.go:473] validating certificate period for etcd/ca certificate% n! W: V) B2 N' @
[certs] Generating "etcd/server" certificate and key* ~6 o( N8 u8 Y0 ~; T; A
[certs] etcd/server serving cert is signed for DNS names [localhost node] and IPs [1.2.3.4 127.0.0.1 ::1]( Q8 I, l& r7 b0 l" y2 k
[certs] Generating "etcd/peer" certificate and key/ {) e: H' Z5 _2 T
[certs] etcd/peer serving cert is signed for DNS names [localhost node] and IPs [1.2.3.4 127.0.0.1 ::1]
5 m$ t Q8 u3 j7 \9 v3 t[certs] Generating "etcd/healthcheck-client" certificate and key
' X- n4 M" r* U7 L[certs] Generating "apiserver-etcd-client" certificate and key
( h% \1 ^% L1 d8 g8 MI0104 08:22:45.579717 3326 certs.go:78] creating new public/private key files for signing service account users
4 m) T/ U6 ^0 i2 s9 v- S# F[certs] Generating "sa" key and public key2 m5 Z! F3 l; x) E, k! S: w
[kubeconfig] Using kubeconfig folder "/etc/kubernetes"
. g; s# t; n% _# U- t# Y( @I0104 08:22:45.821509 3326 kubeconfig.go:111] creating kubeconfig file for admin.conf
/ d$ a5 c8 b% A- W4 K1 e[kubeconfig] Writing "admin.conf" kubeconfig file6 F( G" |7 q5 o* n, `' O
I0104 08:22:46.146568 3326 kubeconfig.go:111] creating kubeconfig file for super-admin.conf
- `4 x" _8 h% c, C8 H6 h) L( l[kubeconfig] Writing "super-admin.conf" kubeconfig file
/ [. X) n3 `. N. G- o8 H6 j2 uI0104 08:22:46.913876 3326 kubeconfig.go:111] creating kubeconfig file for kubelet.conf
. Z/ F. l1 y9 v& N/ N2 K9 Z[kubeconfig] Writing "kubelet.conf" kubeconfig file
" l! W7 Z# [" }: x$ I9 UI0104 08:22:47.189373 3326 kubeconfig.go:111] creating kubeconfig file for controller-manager.conf
" N6 {6 I- P6 G8 u/ w[kubeconfig] Writing "controller-manager.conf" kubeconfig file
6 z3 S. c; e6 o# M0 I* i9 P) zI0104 08:22:47.789782 3326 kubeconfig.go:111] creating kubeconfig file for scheduler.conf
4 t* w2 l2 ~. e4 i; W[kubeconfig] Writing "scheduler.conf" kubeconfig file4 x- C1 i! V: ~+ D8 T7 V# z8 @
[etcd] Creating static Pod manifest for local etcd in "/etc/kubernetes/manifests"
3 i* F* |& J& E. j( I) zI0104 08:22:48.176199 3326 local.go:65] [etcd] wrote Static Pod manifest for a local etcd member to "/etc/kubernetes/manifests/etcd.yaml"
8 Q% @" k" \, f; U4 w( {/ {[control-plane] Using manifest folder "/etc/kubernetes/manifests"
# Q2 n5 P( W4 r. W* Q5 m! Q" }. m[control-plane] Creating static Pod manifest for "kube-apiserver"8 |& R& b ~& D0 `
I0104 08:22:48.176664 3326 manifests.go:103] [control-plane] getting StaticPodSpecs
4 p. u5 W! t! M5 h( }" UI0104 08:22:48.177133 3326 certs.go:473] validating certificate period for CA certificate
7 B) e, }6 c2 W# M6 k# II0104 08:22:48.177225 3326 manifests.go:129] [control-plane] adding volume "ca-certs" for component "kube-apiserver"
7 N! j4 x* V4 J( A+ LI0104 08:22:48.177245 3326 manifests.go:129] [control-plane] adding volume "etc-pki-ca-trust" for component "kube-apiserver"
, v7 W: k0 G) h* [& l% a4 v# BI0104 08:22:48.177257 3326 manifests.go:129] [control-plane] adding volume "etc-pki-tls-certs" for component "kube-apiserver"! Z9 i9 s" k, x- C9 B
I0104 08:22:48.177270 3326 manifests.go:129] [control-plane] adding volume "k8s-certs" for component "kube-apiserver"
9 Q2 g8 `, F3 d7 xI0104 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"5 [0 C; e' L, t- y ^
[control-plane] Creating static Pod manifest for "kube-controller-manager"
1 Q. L& V- I/ x- JI0104 08:22:48.178653 3326 manifests.go:103] [control-plane] getting StaticPodSpecs" p ?! Z6 T4 e/ Z/ O: B
I0104 08:22:48.178973 3326 manifests.go:129] [control-plane] adding volume "ca-certs" for component "kube-controller-manager" f$ Y: u' f9 ~; U
I0104 08:22:48.178993 3326 manifests.go:129] [control-plane] adding volume "etc-pki-ca-trust" for component "kube-controller-manager"
0 t% t( C, d0 EI0104 08:22:48.179005 3326 manifests.go:129] [control-plane] adding volume "etc-pki-tls-certs" for component "kube-controller-manager"9 T& I+ {2 T2 Y2 E. v
I0104 08:22:48.179018 3326 manifests.go:129] [control-plane] adding volume "flexvolume-dir" for component "kube-controller-manager"8 [0 _ ~9 E5 c: L4 h- N
I0104 08:22:48.179030 3326 manifests.go:129] [control-plane] adding volume "k8s-certs" for component "kube-controller-manager"
, \. |. Z& v+ D' Z, F: gI0104 08:22:48.179043 3326 manifests.go:129] [control-plane] adding volume "kubeconfig" for component "kube-controller-manager"- I. H/ q% L* f! h- u Z6 e
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"
/ ~$ n' I8 U, ]5 [1 ? {[control-plane] Creating static Pod manifest for "kube-scheduler". g$ ~# ~" k4 T2 i) f/ g7 T
I0104 08:22:48.180140 3326 manifests.go:103] [control-plane] getting StaticPodSpecs
$ ^* t4 ?6 x# c+ x! Q+ s4 J# ]I0104 08:22:48.180470 3326 manifests.go:129] [control-plane] adding volume "kubeconfig" for component "kube-scheduler") S! F+ ]$ o- y$ m
I0104 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", T: e4 S7 o1 n6 c! ]
I0104 08:22:48.181506 3326 kubelet.go:68] Stopping the kubelet
% Z! {( L! v3 I2 ?' d1 R) \I0104 08:22:48.194634 3326 flags.go:101] setting kubelet hostname-override to "node"5 Z$ V7 v9 a' K" E, i3 W$ v% |) W* _
[kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env"
. e- @+ R2 T9 ]4 p, }; v) t# Z' Q[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"' y; h% s$ u/ {8 k; {
[kubelet-start] Starting the kubelet
* O U9 t2 j) ~9 _[wait-control-plane] Waiting for the kubelet to boot up the control plane as static Pods from directory "/etc/kubernetes/manifests") p, f% f( ]3 k4 t. M( i, k
[kubelet-check] Waiting for a healthy kubelet at http://127.0.0.1:10248/healthz. This can take up to 4m0s, F! u; m# Q8 w& S
[kubelet-check] The kubelet is healthy after 2.502312387s& v( V; X+ V% n" g+ ?
[api-check] Waiting for a healthy API server. This can take up to 4m0s
& Q* t7 D4 `% F7 X, a* I
" I5 J4 p: e4 O) @' d
( V" ?! E" b, M9 ^
+ Z" R* `3 c, {; \# Q3 A( h* R6 }# u, m& ^( q
( b h- `6 P8 I3 x) F
7 R+ n! q0 g0 m) E6 n5 ^# d |
|