- 积分
- 16844
在线时间 小时
最后登录1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?开始注册
x
kubernets先重置配置reset ; [& o: Z/ X" D. z) H
[root@k8s-master ~]# kubeadm reset --v=5 --cri-socket=unix:///var/run/cri-dockerd.sock
# i% T( F4 T' a! N: J5 uI0103 22:43:08.557654 83642 reset.go:126] [reset] Could not obtain a client set from the kubeconfig file: /etc/kubernetes/admin.conf/ C/ O: w; X' v
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.
|! f3 ]" q6 r5 ?[reset] Are you sure you want to proceed? [y/N]: Y
1 y5 k) m4 ~, F8 D[preflight] Running pre-flight checks- L$ z& Q' K0 f# b
I0103 22:43:13.735565 83642 removeetcdmember.go:60] [reset] Checking for etcd config
, q' J% ]8 O" y7 o! `& Z# KW0103 22:43:13.735621 83642 removeetcdmember.go:106] [reset] No kubeadm config, using etcd pod spec to get data directory
2 D1 }* _ l/ ?6 |( ?1 X2 j6 tI0103 22:43:13.735774 83642 cleanupnode.go:65] [reset] Getting init system% L; P& m: h2 n' o/ M
[reset] Stopping the kubelet service) ]) K. v7 B8 X3 S
[reset] Unmounting mounted directories in "/var/lib/kubelet"0 q; L [4 A9 `$ W+ n1 V) O) m
I0103 22:43:13.743121 83642 cleanupnode.go:103] [reset] Removing Kubernetes-managed containers
( y& G) d! t) {[reset] Deleting contents of directories: [/etc/kubernetes/manifests /var/lib/kubelet /etc/kubernetes/pki]/ J- J1 N1 e0 O& U: ?
[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]
9 e. S, m2 G) |
) l) v- j/ l& p9 P7 W! R) R7 h( CThe reset process does not clean CNI configuration. To do so, you must remove /etc/cni/net.d
" s+ G( c, v& F- O1 ^5 @; |8 l2 Q7 P+ s, b5 w+ s5 [8 G( s, Q
The reset process does not reset or clean up iptables rules or IPVS tables.
5 r2 ]- E" S: F0 o0 k J7 o, FIf you wish to reset iptables, you must do so manually by using the "iptables" command.) u2 C; d2 l& D' E
( r' n/ q1 |" c
If your cluster was setup to utilize IPVS, run ipvsadm --clear (or similar)$ ]% M' A+ ]3 b: ~6 {1 s# j
to reset your system's IPVS tables.
" |& }) h6 ]. x: T( J t
0 O7 W8 l3 {1 j8 sThe reset process does not clean your kubeconfig files and you must remove them manually.
1 E; e- @/ q8 T) uPlease, check the contents of the $HOME/.kube/config file.* ^! o& d- U% Q$ S3 a, Z
9 P$ d; m1 m% Q2 b! F# c重新通过文件初始化:
# R7 {- K3 b: F9 {; E* i
4 Z; @& ? Y# x: r) m[root@k8s-master ~]# kubeadm init --config=kubeadm-init-config.yaml --v=5 --ignore-preflight-errors=SystemVerification ! S; K3 s1 [4 c7 f1 K
I0104 08:21:57.040996 3326 initconfiguration.go:261] loading configuration from "kubeadm-init-config.yaml"% R8 }4 b! B( ^0 ]
I0104 08:21:57.044966 3326 kubelet.go:195] the value of KubeletConfiguration.cgroupDriver is empty; setting it to "systemd"" q2 d* q3 `7 V1 h2 a0 ^
[init] Using Kubernetes version: v1.31.01 J8 O3 r# i8 N8 n
[preflight] Running pre-flight checks
% n8 y" o/ B9 l8 LI0104 08:21:57.050536 3326 checks.go:561] validating Kubernetes and kubeadm version3 c$ v3 ?, ]9 A- y* `% W
I0104 08:21:57.050579 3326 checks.go:166] validating if the firewall is enabled and active
5 g- P2 V. }, F8 G! T1 nI0104 08:21:57.060446 3326 checks.go:201] validating availability of port 6443
1 Z/ p8 V6 E) ^. r3 N- }I0104 08:21:57.060692 3326 checks.go:201] validating availability of port 102590 J0 s6 E# [' W D( R) C( ?. y' d
I0104 08:21:57.060939 3326 checks.go:201] validating availability of port 10257+ p: t; I B. ?- v: G: T0 h
I0104 08:21:57.061025 3326 checks.go:278] validating the existence of file /etc/kubernetes/manifests/kube-apiserver.yaml
& B/ A7 s2 v! \I0104 08:21:57.061056 3326 checks.go:278] validating the existence of file /etc/kubernetes/manifests/kube-controller-manager.yaml
& `. x4 P, I# B: y' y! QI0104 08:21:57.061107 3326 checks.go:278] validating the existence of file /etc/kubernetes/manifests/kube-scheduler.yaml
* C( ?$ h9 c! K" I$ ?& cI0104 08:21:57.061147 3326 checks.go:278] validating the existence of file /etc/kubernetes/manifests/etcd.yaml
7 L7 I! S4 Q( B5 q+ ~8 EI0104 08:21:57.061183 3326 checks.go:428] validating if the connectivity type is via proxy or direct' N7 M. k" z9 x
I0104 08:21:57.061246 3326 checks.go:467] validating http connectivity to first IP address in the CIDR) i8 V! w1 Q1 h: f
I0104 08:21:57.061353 3326 checks.go:467] validating http connectivity to first IP address in the CIDR
( l/ x8 b" K: o' Y4 \4 i OI0104 08:21:57.061375 3326 checks.go:102] validating the container runtime
3 r- q, R8 r) h: GI0104 08:21:57.062389 3326 checks.go:637] validating whether swap is enabled or not; {8 l3 P+ [( ?9 {" Z
I0104 08:21:57.062579 3326 checks.go:368] validating the presence of executable crictl
" w7 D! g. v7 I0 W: K. K8 aI0104 08:21:57.062652 3326 checks.go:368] validating the presence of executable conntrack) n7 N& ?& Z, L( B$ H
I0104 08:21:57.062709 3326 checks.go:368] validating the presence of executable ip
! _) f4 z& _8 b9 l2 sI0104 08:21:57.062777 3326 checks.go:368] validating the presence of executable iptables
# ~8 H3 U- {" B) k, v7 p& d( w# P& OI0104 08:21:57.062850 3326 checks.go:368] validating the presence of executable mount
5 _: P6 w' B! t3 b1 @I0104 08:21:57.062979 3326 checks.go:368] validating the presence of executable nsenter4 W& f5 g- X; v' i
I0104 08:21:57.063051 3326 checks.go:368] validating the presence of executable ethtool
# `4 y- Z+ ?3 w: ZI0104 08:21:57.063123 3326 checks.go:368] validating the presence of executable tc
: n3 V1 F# R( ~I0104 08:21:57.063178 3326 checks.go:368] validating the presence of executable touch. o% s; Q v5 ?; i
I0104 08:21:57.063261 3326 checks.go:514] running all checks; X) O* m) \3 D( _/ b
[preflight] The system verification failed. Printing the output from the verification:- I4 H# S3 y0 p0 N: @4 u8 e
KERNEL_VERSION: 4.18.16x86-4.18-16
7 j2 u J7 a( o) U( m3 V) N& G* bOS: Linux
; w/ D8 l- F+ l1 t% @0 OCGROUPS_CPU: enabled
. P* w3 V* I- `& a& E/ @. ^CGROUPS_CPUACCT: enabled
; a8 I9 a- r# m) F) N3 E B$ u6 GCGROUPS_CPUSET: enabled) j) U7 h9 _5 O5 G6 c2 y+ z* t5 w5 l9 N
CGROUPS_DEVICES: enabled+ O, \' V; N) B
CGROUPS_FREEZER: enabled
H. k$ [# T0 K) kCGROUPS_MEMORY: enabled ~5 K+ V+ R) V. g" r
CGROUPS_PIDS: enabled D. k. M0 X6 P H+ v' n
CGROUPS_HUGETLB: enabled
5 Q7 K. P% k' z6 m0 k' KCGROUPS_BLKIO: enabled. j1 v1 _) ]% F
[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, D5 y: w# I& a5 } i$ J
I0104 08:21:57.069077 3326 checks.go:399] checking whether the given node name is valid and reachable using net.LookupHost; D, l: o; M1 b3 z. a
[WARNING Hostname]: hostname "node" could not be reached7 L) }1 c/ W& i% k9 V* d L
[WARNING Hostname]: hostname "node": lookup node on 202.106.0.20:53: no such host
$ V4 M# S4 Y/ f( [3 _0 gI0104 08:21:57.075047 3326 checks.go:603] validating kubelet version4 b9 m, J3 A) i
I0104 08:21:57.148436 3326 checks.go:128] validating if the "kubelet" service is enabled and active+ P( I5 Q3 h( d
I0104 08:21:57.159069 3326 checks.go:201] validating availability of port 10250
6 F6 j1 c: v. D- ^I0104 08:21:57.159163 3326 checks.go:327] validating the contents of file /proc/sys/net/ipv4/ip_forward9 r- g+ f$ H4 U8 L) F0 @
I0104 08:21:57.159232 3326 checks.go:201] validating availability of port 2379
; n, O2 V* B" g3 w9 E) \I0104 08:21:57.159292 3326 checks.go:201] validating availability of port 2380( h4 m1 Z4 A. Y7 h- Z
I0104 08:21:57.159451 3326 checks.go:241] validating the existence and emptiness of directory /var/lib/etcd
y/ a3 y7 Q3 \# f. I8 b9 r A[preflight] Pulling images required for setting up a Kubernetes cluster
. h: M( v0 c- i6 J5 H7 E, A: f[preflight] This might take a minute or two, depending on the speed of your internet connection
2 o" z9 S/ ^, o o0 j[preflight] You can also perform this action beforehand using 'kubeadm config images pull'0 s$ N9 K! h) H
I0104 08:21:57.162812 3326 checks.go:832] using image pull policy: IfNotPresent
* |* b9 x/ `1 w3 a1 sW0104 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.
5 @# `6 W6 N. x* h# G* r7 U2 SI0104 08:21:57.164932 3326 checks.go:871] pulling: registry.aliyuncs.com/google_containers/kube-apiserver:v1.31.0
5 h: q& f$ e% } q. f; uI0104 08:22:03.825498 3326 checks.go:871] pulling: registry.aliyuncs.com/google_containers/kube-controller-manager:v1.31.0
0 m0 a/ I l$ @- M/ v" Q1 cI0104 08:22:09.870677 3326 checks.go:871] pulling: registry.aliyuncs.com/google_containers/kube-scheduler:v1.31.0
2 n6 u9 a4 m- I% ?I0104 08:22:14.792245 3326 checks.go:871] pulling: registry.aliyuncs.com/google_containers/kube-proxy:v1.31.00 q& Z1 j' G0 h8 @
I0104 08:22:21.833498 3326 checks.go:871] pulling: registry.aliyuncs.com/google_containers/coredns:v1.11.33 ?4 J, Z4 k: {& G. `* u
I0104 08:22:26.694562 3326 checks.go:871] pulling: registry.aliyuncs.com/google_containers/pause:3.10
( `, t6 Y, O8 l/ bI0104 08:22:27.874314 3326 checks.go:871] pulling: registry.aliyuncs.com/google_containers/etcd:3.5.15-0
# u/ n x9 U E0 o, ?' e[certs] Using certificateDir folder "/etc/kubernetes/pki", E& _( l% v: g& m9 T
I0104 08:22:38.609775 3326 certs.go:112] creating a new certificate authority for ca
/ v& ?8 @7 I4 \' v! H[certs] Generating "ca" certificate and key. y/ h# z4 N+ Z) a
I0104 08:22:39.795060 3326 certs.go:473] validating certificate period for ca certificate" V9 B2 U R( ]
[certs] Generating "apiserver" certificate and key6 A- k& v2 r7 x
[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]
1 i6 g0 f1 g0 k[certs] Generating "apiserver-kubelet-client" certificate and key
2 t) h+ I, X7 Z3 R! }; s0 fI0104 08:22:40.424934 3326 certs.go:112] creating a new certificate authority for front-proxy-ca) d3 s1 a y& T
[certs] Generating "front-proxy-ca" certificate and key
; | X+ ~) g& J- nI0104 08:22:40.745566 3326 certs.go:473] validating certificate period for front-proxy-ca certificate5 D: S0 X$ H) h. G# W
[certs] Generating "front-proxy-client" certificate and key
8 L/ a+ `6 n+ EI0104 08:22:41.527532 3326 certs.go:112] creating a new certificate authority for etcd-ca
' b' U& t3 Z4 i& d" H7 Q[certs] Generating "etcd/ca" certificate and key! z& S% j% |: M x$ B
I0104 08:22:42.751929 3326 certs.go:473] validating certificate period for etcd/ca certificate' o' W$ ^1 L; u, ~
[certs] Generating "etcd/server" certificate and key, T( \' Q4 B$ |7 s" A& W1 ~; h1 N
[certs] etcd/server serving cert is signed for DNS names [localhost node] and IPs [1.2.3.4 127.0.0.1 ::1]
U$ m/ e! @. q$ p! L+ X ^[certs] Generating "etcd/peer" certificate and key
2 x6 G4 T. O H- s[certs] etcd/peer serving cert is signed for DNS names [localhost node] and IPs [1.2.3.4 127.0.0.1 ::1]
6 q& k8 w3 C& u6 I: o1 r[certs] Generating "etcd/healthcheck-client" certificate and key8 O$ Y& x6 K' l/ y/ x9 F, `
[certs] Generating "apiserver-etcd-client" certificate and key
- K5 o) b4 l9 z y `+ D. R3 @+ bI0104 08:22:45.579717 3326 certs.go:78] creating new public/private key files for signing service account users
. B5 D2 `6 Y& V7 _- r$ ~[certs] Generating "sa" key and public key
2 x3 l$ Y! _- G7 b g[kubeconfig] Using kubeconfig folder "/etc/kubernetes"% I, d, m2 w r* ~# ~
I0104 08:22:45.821509 3326 kubeconfig.go:111] creating kubeconfig file for admin.conf4 }8 S/ Y9 A8 z0 j
[kubeconfig] Writing "admin.conf" kubeconfig file
3 Y: Q9 k0 y& U9 C: G' r7 eI0104 08:22:46.146568 3326 kubeconfig.go:111] creating kubeconfig file for super-admin.conf a( M* _( w9 c
[kubeconfig] Writing "super-admin.conf" kubeconfig file
8 |* T* t: X. n7 S+ QI0104 08:22:46.913876 3326 kubeconfig.go:111] creating kubeconfig file for kubelet.conf
9 A& F7 H `' m$ Q. S[kubeconfig] Writing "kubelet.conf" kubeconfig file
/ r% {; {* |% `9 fI0104 08:22:47.189373 3326 kubeconfig.go:111] creating kubeconfig file for controller-manager.conf
! K: @* U, ]2 L3 t[kubeconfig] Writing "controller-manager.conf" kubeconfig file
% \0 s |0 \9 ]* uI0104 08:22:47.789782 3326 kubeconfig.go:111] creating kubeconfig file for scheduler.conf, `& Y* O0 G b$ ?* L3 M6 H( C9 g/ g
[kubeconfig] Writing "scheduler.conf" kubeconfig file
$ C" S. _: @# X% G% A& \' M[etcd] Creating static Pod manifest for local etcd in "/etc/kubernetes/manifests"$ _% S' z5 T. Q/ K- |9 f7 V
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"
6 ^0 V/ q* X* b0 o: F9 y! P) I: w6 U[control-plane] Using manifest folder "/etc/kubernetes/manifests"
. ^+ D, K& H" z! M+ _[control-plane] Creating static Pod manifest for "kube-apiserver"
) o- c. F9 k# R2 SI0104 08:22:48.176664 3326 manifests.go:103] [control-plane] getting StaticPodSpecs6 H( |9 x8 _1 a
I0104 08:22:48.177133 3326 certs.go:473] validating certificate period for CA certificate
0 E* @2 v5 |8 g0 }I0104 08:22:48.177225 3326 manifests.go:129] [control-plane] adding volume "ca-certs" for component "kube-apiserver"
$ u! \* T! |6 }; vI0104 08:22:48.177245 3326 manifests.go:129] [control-plane] adding volume "etc-pki-ca-trust" for component "kube-apiserver"
3 @- Y8 T8 `" v* l; c! {6 O9 f6 vI0104 08:22:48.177257 3326 manifests.go:129] [control-plane] adding volume "etc-pki-tls-certs" for component "kube-apiserver"
5 {0 A1 w" K% ~I0104 08:22:48.177270 3326 manifests.go:129] [control-plane] adding volume "k8s-certs" for component "kube-apiserver"% e4 K+ ]. e' W/ I! \7 d) Y
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"7 O9 r6 j8 Q( s6 L- E
[control-plane] Creating static Pod manifest for "kube-controller-manager"
M/ V* X) W3 `/ e$ [4 @$ O# BI0104 08:22:48.178653 3326 manifests.go:103] [control-plane] getting StaticPodSpecs
) i4 k: @; H+ W$ XI0104 08:22:48.178973 3326 manifests.go:129] [control-plane] adding volume "ca-certs" for component "kube-controller-manager"# R7 e7 R$ l ]+ G. b4 e% Z0 Z
I0104 08:22:48.178993 3326 manifests.go:129] [control-plane] adding volume "etc-pki-ca-trust" for component "kube-controller-manager"
; i" ]' o' s+ {: t- w4 sI0104 08:22:48.179005 3326 manifests.go:129] [control-plane] adding volume "etc-pki-tls-certs" for component "kube-controller-manager"# W& x+ L9 Y5 _/ m
I0104 08:22:48.179018 3326 manifests.go:129] [control-plane] adding volume "flexvolume-dir" for component "kube-controller-manager"
6 c% [' B+ W" p! o: o4 fI0104 08:22:48.179030 3326 manifests.go:129] [control-plane] adding volume "k8s-certs" for component "kube-controller-manager"
7 b$ z( X; v4 t) oI0104 08:22:48.179043 3326 manifests.go:129] [control-plane] adding volume "kubeconfig" for component "kube-controller-manager"8 h/ }3 p7 \: H+ L# R- [$ t
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"
/ i. N' e/ x* N8 @9 d[control-plane] Creating static Pod manifest for "kube-scheduler"
% _/ ]% ~2 A. Y8 ^I0104 08:22:48.180140 3326 manifests.go:103] [control-plane] getting StaticPodSpecs
. V2 V4 e" S- p% mI0104 08:22:48.180470 3326 manifests.go:129] [control-plane] adding volume "kubeconfig" for component "kube-scheduler"* b. ?( o7 B6 w; V/ S
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"; T7 i% A( q" [
I0104 08:22:48.181506 3326 kubelet.go:68] Stopping the kubelet4 y/ ?1 H; {# r( z9 c
I0104 08:22:48.194634 3326 flags.go:101] setting kubelet hostname-override to "node"! @6 `; A2 o3 D9 x. I) \
[kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env"
) w- d$ m' L8 a \. ]# o* [$ E[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"
2 m; c" Y: h' `; J% c) N1 W& B0 o[kubelet-start] Starting the kubelet1 g! S& {5 \, W( t* {3 c
[wait-control-plane] Waiting for the kubelet to boot up the control plane as static Pods from directory "/etc/kubernetes/manifests"
b w* X6 ?/ ][kubelet-check] Waiting for a healthy kubelet at http://127.0.0.1:10248/healthz. This can take up to 4m0s& M9 A7 ]) R: p- B4 E
[kubelet-check] The kubelet is healthy after 2.502312387s* Z0 L3 m: w9 f: q" n
[api-check] Waiting for a healthy API server. This can take up to 4m0s
, t5 _8 {( Q4 C A! \ ?1 X# L6 }, ^+ K$ R6 z. X$ y6 N
% G, u( Q" q* e
8 Z) G. Y. \8 K" o" Y! L3 Y" `9 ]( e% {* v- R+ _
0 l) d1 Y8 |+ R* h& V0 ^2 S* b( K3 b0 r4 \9 }
|
|