|
|
kubernets先重置配置reset
y2 o. K; N7 x) ^1 w[root@k8s-master ~]# kubeadm reset --v=5 --cri-socket=unix:///var/run/cri-dockerd.sock + J3 k x- {6 v0 L/ l2 z, w9 v
I0103 22:43:08.557654 83642 reset.go:126] [reset] Could not obtain a client set from the kubeconfig file: /etc/kubernetes/admin.conf
. |5 T0 Y3 x' y( ~# \+ ?W0103 22:43:08.557782 83642 preflight.go:56] [reset] WARNING: Changes made to this host by 'kubeadm init' or 'kubeadm join' will be reverted.4 h& ?4 C( ^+ H( ~
[reset] Are you sure you want to proceed? [y/N]: Y
' q- e/ [; g3 y0 ^; Z[preflight] Running pre-flight checks
3 T5 B7 G6 l+ X4 D" n. y: B2 AI0103 22:43:13.735565 83642 removeetcdmember.go:60] [reset] Checking for etcd config* G; x( G0 h- h) G4 D- \
W0103 22:43:13.735621 83642 removeetcdmember.go:106] [reset] No kubeadm config, using etcd pod spec to get data directory
- _0 P# s) U/ c7 j j) }+ kI0103 22:43:13.735774 83642 cleanupnode.go:65] [reset] Getting init system1 U7 T7 x1 s8 m* s3 f) |+ S
[reset] Stopping the kubelet service+ E; W: ~3 Z' a% S# f9 |6 Q
[reset] Unmounting mounted directories in "/var/lib/kubelet"* Y3 G4 f. ]$ K' {
I0103 22:43:13.743121 83642 cleanupnode.go:103] [reset] Removing Kubernetes-managed containers
4 ~) F; I u: j4 ?- F[reset] Deleting contents of directories: [/etc/kubernetes/manifests /var/lib/kubelet /etc/kubernetes/pki]& r2 U' J8 N, m& y+ y
[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]
% G* q# \9 c- A. W9 u7 g
" `9 O* F& ~( o5 D0 uThe reset process does not clean CNI configuration. To do so, you must remove /etc/cni/net.d
3 \( V0 h' I, `0 I# k7 g: [3 j) h" u% k
The reset process does not reset or clean up iptables rules or IPVS tables.7 T9 G: V$ A9 B- U$ e5 S
If you wish to reset iptables, you must do so manually by using the "iptables" command.
0 X5 ?$ y" ]5 j: K* s3 Z A
0 Z3 Q) i% O6 S9 T MIf your cluster was setup to utilize IPVS, run ipvsadm --clear (or similar)
. m; u( [& c x5 m: Pto reset your system's IPVS tables.
" M, e0 A% o4 d* X8 l* V( e
" Z8 b3 c6 O0 jThe reset process does not clean your kubeconfig files and you must remove them manually.1 v @7 x2 p1 N) ]. m, Z5 E
Please, check the contents of the $HOME/.kube/config file.
3 W' _1 Q0 s( O6 y! o) B7 m ?" d. ~" [* y* P
重新通过文件初始化:
/ n& `' r' c6 i9 M- q, r
5 x; l: k# N2 P5 z[root@k8s-master ~]# kubeadm init --config=kubeadm-init-config.yaml --v=5 --ignore-preflight-errors=SystemVerification
4 G8 ]1 s! j3 f: sI0104 08:21:57.040996 3326 initconfiguration.go:261] loading configuration from "kubeadm-init-config.yaml"
% J3 t( x% `" D4 [I0104 08:21:57.044966 3326 kubelet.go:195] the value of KubeletConfiguration.cgroupDriver is empty; setting it to "systemd"
( V5 Y5 z" `% \, O[init] Using Kubernetes version: v1.31.0/ u* u+ ^8 }$ W: Y6 `: T
[preflight] Running pre-flight checks# ^* \1 r6 }5 N* t4 I6 n0 v
I0104 08:21:57.050536 3326 checks.go:561] validating Kubernetes and kubeadm version, Q4 e3 ~5 V4 j% [
I0104 08:21:57.050579 3326 checks.go:166] validating if the firewall is enabled and active
2 G; a0 {( A$ X+ {) _" t+ V$ lI0104 08:21:57.060446 3326 checks.go:201] validating availability of port 6443
: u6 n9 X! r3 c4 G5 T+ l1 L* l0 SI0104 08:21:57.060692 3326 checks.go:201] validating availability of port 10259
# o$ G- O% j5 p) @7 X- wI0104 08:21:57.060939 3326 checks.go:201] validating availability of port 10257+ W* ~4 C! I9 |! o' n0 Q; m4 g4 ?
I0104 08:21:57.061025 3326 checks.go:278] validating the existence of file /etc/kubernetes/manifests/kube-apiserver.yaml
3 k, l7 [5 Z" \8 i& n: JI0104 08:21:57.061056 3326 checks.go:278] validating the existence of file /etc/kubernetes/manifests/kube-controller-manager.yaml# E. r8 R( C# k; s
I0104 08:21:57.061107 3326 checks.go:278] validating the existence of file /etc/kubernetes/manifests/kube-scheduler.yaml
3 R0 j" @7 k: YI0104 08:21:57.061147 3326 checks.go:278] validating the existence of file /etc/kubernetes/manifests/etcd.yaml
/ Y0 X1 h! k3 b% pI0104 08:21:57.061183 3326 checks.go:428] validating if the connectivity type is via proxy or direct
, g3 Z# x4 Q1 l6 }7 AI0104 08:21:57.061246 3326 checks.go:467] validating http connectivity to first IP address in the CIDR
. r0 ?" ~1 X3 t4 D6 Y' Y) nI0104 08:21:57.061353 3326 checks.go:467] validating http connectivity to first IP address in the CIDR
/ W/ ~. m$ X% A8 [I0104 08:21:57.061375 3326 checks.go:102] validating the container runtime
; o3 K2 X1 ], \I0104 08:21:57.062389 3326 checks.go:637] validating whether swap is enabled or not
( s v1 B3 ?1 Q1 iI0104 08:21:57.062579 3326 checks.go:368] validating the presence of executable crictl
2 b9 F$ Q8 o& R, W; t. WI0104 08:21:57.062652 3326 checks.go:368] validating the presence of executable conntrack. b+ L: y' g: R- e, M
I0104 08:21:57.062709 3326 checks.go:368] validating the presence of executable ip
9 Y9 h# ~* ]% s. V n4 j, pI0104 08:21:57.062777 3326 checks.go:368] validating the presence of executable iptables
; x) C: z! J) {+ R! gI0104 08:21:57.062850 3326 checks.go:368] validating the presence of executable mount
1 j# p' O) x* C7 ~I0104 08:21:57.062979 3326 checks.go:368] validating the presence of executable nsenter0 i6 x) }, f/ Y, |, S+ _
I0104 08:21:57.063051 3326 checks.go:368] validating the presence of executable ethtool
9 {" R, j4 O7 Y7 C6 n6 W# d/ f7 m2 rI0104 08:21:57.063123 3326 checks.go:368] validating the presence of executable tc/ P5 P- x1 i5 C8 \0 T
I0104 08:21:57.063178 3326 checks.go:368] validating the presence of executable touch
7 h9 o( C- q0 L0 }" `I0104 08:21:57.063261 3326 checks.go:514] running all checks
2 |. w! A2 A7 q* X- N2 e[preflight] The system verification failed. Printing the output from the verification:1 ?( L. E d% c5 H% ?
KERNEL_VERSION: 4.18.16x86-4.18-16
8 d6 M2 v, x0 v; c' q/ \" cOS: Linux9 ?3 F$ N* D5 b
CGROUPS_CPU: enabled& G3 }$ u- c5 V& m+ {
CGROUPS_CPUACCT: enabled# k7 R$ E4 c7 t C$ v9 j3 [/ _
CGROUPS_CPUSET: enabled
' t! j5 ?; v: G9 d* bCGROUPS_DEVICES: enabled0 x5 g1 a$ u4 {* V$ f1 R
CGROUPS_FREEZER: enabled- d# _! i0 l8 A- P
CGROUPS_MEMORY: enabled* R5 {, i; `# j
CGROUPS_PIDS: enabled ^( K3 I" O; U8 ~5 Y% L
CGROUPS_HUGETLB: enabled8 W* B3 Z1 x+ s* W2 S
CGROUPS_BLKIO: enabled
: ~- w* m/ z1 ~% R [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( q" T% i8 ^) c+ I: v/ R
I0104 08:21:57.069077 3326 checks.go:399] checking whether the given node name is valid and reachable using net.LookupHost E9 X+ E* o. H; M3 O. `' \, V. h$ [
[WARNING Hostname]: hostname "node" could not be reached7 |4 |! E# K( d3 S
[WARNING Hostname]: hostname "node": lookup node on 202.106.0.20:53: no such host
( w- k+ T$ K% ZI0104 08:21:57.075047 3326 checks.go:603] validating kubelet version
K9 u* ~$ p; G- p; z) xI0104 08:21:57.148436 3326 checks.go:128] validating if the "kubelet" service is enabled and active1 S' P$ P9 ?+ V2 J+ \/ ?: n
I0104 08:21:57.159069 3326 checks.go:201] validating availability of port 10250
+ V& g( p# t: m- C0 e# [7 @" GI0104 08:21:57.159163 3326 checks.go:327] validating the contents of file /proc/sys/net/ipv4/ip_forward
- Y( [& m; A7 m) HI0104 08:21:57.159232 3326 checks.go:201] validating availability of port 2379
: `" N* e t" ]: cI0104 08:21:57.159292 3326 checks.go:201] validating availability of port 23809 G; O2 t& [* [$ |$ ~6 [4 L5 }* q- W
I0104 08:21:57.159451 3326 checks.go:241] validating the existence and emptiness of directory /var/lib/etcd
9 t8 o3 t8 C6 {$ U[preflight] Pulling images required for setting up a Kubernetes cluster5 d# T8 H) k5 k! N8 P
[preflight] This might take a minute or two, depending on the speed of your internet connection/ |9 Y$ p9 n5 J: H# o8 F9 n; j
[preflight] You can also perform this action beforehand using 'kubeadm config images pull'
3 R4 d* ^" R7 U: v3 }I0104 08:21:57.162812 3326 checks.go:832] using image pull policy: IfNotPresent: l9 |# O+ v+ [9 Z+ I7 |
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.' c. p9 k+ k2 j% h
I0104 08:21:57.164932 3326 checks.go:871] pulling: registry.aliyuncs.com/google_containers/kube-apiserver:v1.31.0
4 k" V7 y K' X" }5 J f! YI0104 08:22:03.825498 3326 checks.go:871] pulling: registry.aliyuncs.com/google_containers/kube-controller-manager:v1.31.0* S0 l. S% a& `2 b
I0104 08:22:09.870677 3326 checks.go:871] pulling: registry.aliyuncs.com/google_containers/kube-scheduler:v1.31.0, Q! I% ~8 W: p6 y/ d! H8 w8 a
I0104 08:22:14.792245 3326 checks.go:871] pulling: registry.aliyuncs.com/google_containers/kube-proxy:v1.31.0
3 V$ _5 E5 J& |5 K% ~I0104 08:22:21.833498 3326 checks.go:871] pulling: registry.aliyuncs.com/google_containers/coredns:v1.11.3+ b9 Q, {9 E- }6 N) ]6 f, ^$ J+ S
I0104 08:22:26.694562 3326 checks.go:871] pulling: registry.aliyuncs.com/google_containers/pause:3.10 d6 s) x8 i; Z1 {
I0104 08:22:27.874314 3326 checks.go:871] pulling: registry.aliyuncs.com/google_containers/etcd:3.5.15-0
# A$ s# A" _6 d* i2 h* m# V[certs] Using certificateDir folder "/etc/kubernetes/pki"
3 u' [3 p) `6 ?* w. AI0104 08:22:38.609775 3326 certs.go:112] creating a new certificate authority for ca7 F( J: F. w% M' I+ ?4 E) I6 z
[certs] Generating "ca" certificate and key4 g/ H, { ]+ f. @5 O
I0104 08:22:39.795060 3326 certs.go:473] validating certificate period for ca certificate
: Y2 ?: k4 J1 r1 s[certs] Generating "apiserver" certificate and key
! a4 @) F# b# R[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]. K. }; X7 x P B7 D* J! M$ U
[certs] Generating "apiserver-kubelet-client" certificate and key
& I9 J9 t0 x* j; _I0104 08:22:40.424934 3326 certs.go:112] creating a new certificate authority for front-proxy-ca
: E8 }! ~& O4 u* z[certs] Generating "front-proxy-ca" certificate and key
8 v; E" f& _& m; F; p( P% DI0104 08:22:40.745566 3326 certs.go:473] validating certificate period for front-proxy-ca certificate) s) Q6 Q: x+ Y
[certs] Generating "front-proxy-client" certificate and key* C4 a9 N* v9 Q: M- s6 @* f) Z
I0104 08:22:41.527532 3326 certs.go:112] creating a new certificate authority for etcd-ca( k6 f2 A2 F& M" u3 _2 e) u+ @
[certs] Generating "etcd/ca" certificate and key
* C+ G/ ]! ]; ^" G2 z7 [% ]% YI0104 08:22:42.751929 3326 certs.go:473] validating certificate period for etcd/ca certificate% b1 B& ]- y& `+ c) x
[certs] Generating "etcd/server" certificate and key
7 W; y6 u3 b# i, Q& T+ `[certs] etcd/server serving cert is signed for DNS names [localhost node] and IPs [1.2.3.4 127.0.0.1 ::1]- A! W9 v$ Y* S2 \$ n+ R# L! D2 M
[certs] Generating "etcd/peer" certificate and key' r8 M' U9 M1 a; _9 }" G
[certs] etcd/peer serving cert is signed for DNS names [localhost node] and IPs [1.2.3.4 127.0.0.1 ::1]# c. ^. a2 I0 [; V$ b# \
[certs] Generating "etcd/healthcheck-client" certificate and key
4 C9 f9 [: e" Q. W$ ~# T6 b+ X: z[certs] Generating "apiserver-etcd-client" certificate and key
+ J9 J) J/ ^' |! N) d1 U6 ^I0104 08:22:45.579717 3326 certs.go:78] creating new public/private key files for signing service account users8 B0 p# j2 j3 C: w: O' y
[certs] Generating "sa" key and public key2 U* M Q1 c1 g5 J; A: ^& B8 U( U
[kubeconfig] Using kubeconfig folder "/etc/kubernetes"8 ?& Y$ Z+ I( B. R5 J
I0104 08:22:45.821509 3326 kubeconfig.go:111] creating kubeconfig file for admin.conf
4 f9 I- X5 p0 p. S[kubeconfig] Writing "admin.conf" kubeconfig file
* q5 A- P* z; e. [2 F) o# TI0104 08:22:46.146568 3326 kubeconfig.go:111] creating kubeconfig file for super-admin.conf
; S8 a! H+ |; l. I9 i[kubeconfig] Writing "super-admin.conf" kubeconfig file
7 Q9 u' l4 y3 [( UI0104 08:22:46.913876 3326 kubeconfig.go:111] creating kubeconfig file for kubelet.conf
6 Y8 d1 }5 s9 L) f! H[kubeconfig] Writing "kubelet.conf" kubeconfig file
0 j, i+ y: p+ ?* `/ CI0104 08:22:47.189373 3326 kubeconfig.go:111] creating kubeconfig file for controller-manager.conf# f+ x2 d! _# p4 l
[kubeconfig] Writing "controller-manager.conf" kubeconfig file
) E0 a8 D/ Z: y1 YI0104 08:22:47.789782 3326 kubeconfig.go:111] creating kubeconfig file for scheduler.conf
% W+ n. `6 a; q% B. m[kubeconfig] Writing "scheduler.conf" kubeconfig file
9 |8 N, k/ d. Y z; N9 C[etcd] Creating static Pod manifest for local etcd in "/etc/kubernetes/manifests"* D7 G& T, M; ~- _! @# B& \% Y
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"5 C0 P5 e$ A3 g8 Z. W
[control-plane] Using manifest folder "/etc/kubernetes/manifests"
4 ^4 `) ^6 f! L' }1 e, E[control-plane] Creating static Pod manifest for "kube-apiserver"0 H" h* |* @' n0 e3 Y. @$ ~+ ^
I0104 08:22:48.176664 3326 manifests.go:103] [control-plane] getting StaticPodSpecs7 q S) ]- H% Y E' r+ e
I0104 08:22:48.177133 3326 certs.go:473] validating certificate period for CA certificate
Y% U8 b- A* |: `I0104 08:22:48.177225 3326 manifests.go:129] [control-plane] adding volume "ca-certs" for component "kube-apiserver"$ Q9 O' H8 z7 x* L
I0104 08:22:48.177245 3326 manifests.go:129] [control-plane] adding volume "etc-pki-ca-trust" for component "kube-apiserver"
2 |+ a7 L0 { F1 z2 e( l9 AI0104 08:22:48.177257 3326 manifests.go:129] [control-plane] adding volume "etc-pki-tls-certs" for component "kube-apiserver" v+ A0 N- I3 ]! C, b
I0104 08:22:48.177270 3326 manifests.go:129] [control-plane] adding volume "k8s-certs" for component "kube-apiserver"
3 m0 f5 ^" z- 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"
5 a, \7 x2 p0 G[control-plane] Creating static Pod manifest for "kube-controller-manager"1 _! b+ @; J6 O! ^7 M( V
I0104 08:22:48.178653 3326 manifests.go:103] [control-plane] getting StaticPodSpecs! v2 A, H" y& s* u9 v0 R1 J
I0104 08:22:48.178973 3326 manifests.go:129] [control-plane] adding volume "ca-certs" for component "kube-controller-manager"- z" A; P8 m( m' q
I0104 08:22:48.178993 3326 manifests.go:129] [control-plane] adding volume "etc-pki-ca-trust" for component "kube-controller-manager"+ {8 q, d2 |/ a3 }2 v
I0104 08:22:48.179005 3326 manifests.go:129] [control-plane] adding volume "etc-pki-tls-certs" for component "kube-controller-manager"
$ L& R' P% T2 }! m9 X: D" _I0104 08:22:48.179018 3326 manifests.go:129] [control-plane] adding volume "flexvolume-dir" for component "kube-controller-manager"
: l3 P! [: P- Z6 x7 I6 ZI0104 08:22:48.179030 3326 manifests.go:129] [control-plane] adding volume "k8s-certs" for component "kube-controller-manager": b) `* C+ J8 N# A
I0104 08:22:48.179043 3326 manifests.go:129] [control-plane] adding volume "kubeconfig" for component "kube-controller-manager"
1 K2 g% w% Q4 j5 o7 _, \ ZI0104 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"
: H7 Z4 L' C. ~[control-plane] Creating static Pod manifest for "kube-scheduler"
o. n$ \4 Q2 ]' @7 h: w6 CI0104 08:22:48.180140 3326 manifests.go:103] [control-plane] getting StaticPodSpecs
1 q+ W# n, j1 x/ wI0104 08:22:48.180470 3326 manifests.go:129] [control-plane] adding volume "kubeconfig" for component "kube-scheduler"
! h. |1 V, R; j) t0 PI0104 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", ?' X" T) s/ Y# a9 J z+ X
I0104 08:22:48.181506 3326 kubelet.go:68] Stopping the kubelet/ j/ k6 N; T0 g+ q0 p5 s
I0104 08:22:48.194634 3326 flags.go:101] setting kubelet hostname-override to "node"
k4 N7 d: p4 L1 f[kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env"
( Z# q' D3 b+ ]3 G5 Y[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml". T% D" A- c9 {7 P, f) c* l/ M
[kubelet-start] Starting the kubelet
4 H. `' s8 w. _- @5 \[wait-control-plane] Waiting for the kubelet to boot up the control plane as static Pods from directory "/etc/kubernetes/manifests"/ }6 T$ s7 Q S6 V" t/ J$ S9 C
[kubelet-check] Waiting for a healthy kubelet at http://127.0.0.1:10248/healthz. This can take up to 4m0s
7 b+ S9 ^( @# O/ X8 e& W& b7 q[kubelet-check] The kubelet is healthy after 2.502312387s3 U7 ]; Y" u l+ D/ |4 t# U5 N* b
[api-check] Waiting for a healthy API server. This can take up to 4m0s# f3 Z: C4 ?# c( S: P, I& `
- N! u4 c4 i8 j6 m& ^9 n
' |: y4 e& V7 D: b5 u& s# l1 E
1 J3 V; r9 e4 j G0 N i$ [. r
9 D W1 @! g) j- |0 M# L) w% A
h3 t3 l3 H4 b/ Q9 j
$ q$ u7 ^( J, b0 V! f |
|