新能源
kubernetes1.24从框架到躺平「四」
发布时间:2025-10-26
ipv6 = 1
邢台哪个男科医院比较好
湘潭看白癜风去哪里好
长沙看癫痫哪家专科医院好
济南看白癜风哪家比较好
3) 为新的终端关闭swap
root@srv5:~# vim /etc/fstab# /etc/fstab: static file system information.## Use 'blkid' to print the universally unique identifier for a# device; this may be used with UUID= as a more robust way to name devices# that works even if disks are added and removed. See fstab(5).## /dev/disk/by-uuid/aa1f65c9-2728-4763-9f2b-d6d0bc1ee92e none noauto,swap sw 0 0 # / was on /dev/sda4 during curtin installation/dev/disk/by-uuid/b8fa8bb0-809e-41cd-8020-5dc68a12c48f / ext4 defaults 0 1 # /boot was on /dev/sda2 during curtin installation/dev/disk/by-uuid/36ec4841-3dc3-4f65-a7a0-feddce442e7c /boot ext4 defaults 0 1/swap.img none swap noauto,sw 0 0root@srv5:~# swapoff -a4) 为新的终端加装Kubeadm, Kubelet, Kubectl
root@srv5:~# curl -s Kubernetes/apt/doc/apt-key.gpg | gpg 便是no-default-keyring 便是keyring gnupg-ring:/etc/apt/trusted.gpg.d/apt-key.gpg 便是importgpg: keyring '/etc/apt/trusted.gpg.d/apt-key.gpg' createdgpg: directory '/root/.gnupg' createdgpg: /root/.gnupg/trustdb.gpg: trustdb createdgpg: key FEEA9169307EA071: public key "rapture Automatic Signing Key (cloud-rapture-signing-key-2021-03-01-08_01_09.pub)" importedgpg: key 8B57C5C2836F4BEB: public key "gLinux Rapture Automatic Signing Key (//depot/google3/production/borg/cloud-rapture/keys/cloud-rapture-pubkeys/cloud-rapture-signing-key-2020-12-03-16_08_05.pub) " importedgpg: Total number processed: 2gpg: imported: 2root@srv5:~# chmod 644 /etc/apt/trusted.gpg.d/apt-key.gpgroot@srv5:~# echo "deb kubernetes-xenial main">> /etc/apt/sources.list.d/kubernetes.listroot@srv5:~# apt update ; apt install kubeadm kubelet kubectl -y5) 为新的终端加装containerd.io
root@srv5:~# curl -s | gpg 便是no-default-keyring 便是keyring gnupg-ring:/etc/apt/trusted.gpg.d/apt-key.gpg 便是importgpg: key 8D81803C0EBFCD88: public key "Docker Release (CE deb) " importedgpg: Total number processed: 1gpg: imported: 1root@srv5:~# echo "deb $(lsb_release -cs) stable">> /etc/apt/sources.list.d/docker.listroot@srv5:~# apt update ; apt install containerd.io6) 为新的终端配置containerd.io
root@srv5:~# containerd config default> /etc/containerd/config.tomlroot@srv5:~# sed -i 's/SystemdCgroup = false/SystemdCgroup = true/' /etc/containerd/config.tomlroot@srv5:~# sed -i 's#endpoint = ""#endpoint = ""#g' /etc/containerd/config.tomlroot@srv5:~# sed -i 's#sandbox_image = "k8s.gcr.io/pause#sandbox_image = "registry.aliyuncs.com/google_containers/pause#g' /etc/containerd/config.tomlroot@srv5:~# systemctl daemon-reload && systemctl restart containerd.service && reboot7) 证实Kubernetes Cluster Token
root@srv1:~# kubeadm token create 便是print-join-commandkubeadm join 192.168.1.11:6443 便是token m5piuy.924q4gtbe5f983dv 便是discovery-token-ca-cert-hash sha256:8c83889acbef5a54b410e8d2513b6eca01ee7eef1244737bacec81168fc5d5538) 申请加入Kubernetes Cluster
root@srv5:~# kubeadm join 192.168.1.11:6443 便是token m5piuy.924q4gtbe5f983dv 便是discovery-token-ca-cert-hash sha256:8c83889acbef5a54b410e8d2513b6eca01ee7eef1244737bacec81168fc5d553[preflight] Running pre-flight checks[preflight] Reading configuration from the cluster...[preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"[kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env"[kubelet-start] Starting the kubelet[kubelet-start] Waiting for the kubelet to perform the TLS Bootstrap...This node has joined the cluster:* Certificate signing request was sent to apiserver and a response was received.* The Kubelet was informed of the new secure connection details.Run 'kubectl get nodes' on the control-plane to see this node join the cluster.9) Master终端证实
root@srv1:~# kubectl get nodesNAME STATUS ROLES AGE VERSIONsrv1.1000y.cloud Ready control-plane 4d1h v1.24.2srv2.1000y.cloud Ready 4d v1.24.2srv3.1000y.cloud Ready 4d v1.24.2srv5.1000y.cloud Ready 11m v1.24.2root@srv1:~# kubectl get pods -A -o wide | grep srv5kube-system kube-flannel-ds-qvxv4 1/1 Running 0 12m 192.168.1.15 srv5.1000y.cloud kube-system kube-proxy-2lcrc 1/1 Running 0 12m 192.168.1.15 srv5.1000y.cloud二: 从Kubernet Cluster中移出终端
1) 在Master终端上移出指明终端
root@srv1:~# kubectl drain srv5.1000y.cloud 便是ignore-daemonsets 便是delete-local-data 便是forceFlag 便是delete-local-data has been deprecated, This option is deprecated and will be deleted. Use 便是delete-emptydir-data.node/srv5.1000y.cloud cordonedWARNING: ignoring DaemonSet-managed Pods: kube-system/kube-flannel-ds-qvxv4, kube-system/kube-proxy-2lcrcnode/srv5.1000y.cloud drainedroot@srv1:~# kubectl get nodes srv5.1000y.cloudNAME STATUS ROLES AGE VERSIONsrv5.1000y.cloud Ready,SchedulingDisabled 17m v1.24.2root@srv1:~# kubectl delete node srv5.1000y.cloudnode "srv5.1000y.cloud" deletedroot@srv1:~# kubectl get nodesNAME STATUS ROLES AGE VERSIONsrv1.1000y.cloud Ready control-plane 4d1h v1.24.2srv2.1000y.cloud Ready 4d v1.24.2srv3.1000y.cloud Ready 4d v1.24.22) 在被移出的终端上reset kubeadm配置
root@srv5:~# kubeadm reset[reset] WARNING: Changes made to this host by 'kubeadm init' or 'kubeadm join' will be reverted.[reset] Are you sure you want to proceed? [y/N]: y[preflight] Running pre-flight checks[reset] No kubeadm config, using etcd pod spec to get data directory[reset] No etcd config found. Assuming external etcd[reset] Please, manually reset etcd to prevent further issues[reset] Stopping the kubelet service[reset] Unmounting mounted directories in "/var/lib/kubelet"[reset] Deleting contents of directories: [/etc/kubernetes/manifests /etc/kubernetes/pki][reset] Deleting files: [/etc/kubernetes/admin.conf /etc/kubernetes/kubelet.conf /etc/kubernetes/bootstrap-kubelet.conf /etc/kubernetes/controller-manager.conf /etc/kubernetes/scheduler.conf][reset] Deleting contents of stateful directories: [/var/lib/kubelet /var/lib/dockershim /var/run/kubernetes /var/lib/cni]The reset process does not clean CNI configuration. To do so, you must remove /etc/cni/net.dThe reset process does not reset or clean up iptables rules or IPVS tables.If you wish to reset iptables, you must do so manually by using the "iptables" command.If your cluster was setup to utilize IPVS, run ipvsadm 便是clear (or similar)to reset your system's IPVS tables.The reset process does not clean your kubeconfig files and you must remove them manually.Please, check the contents of the $HOME/.kube/config file.。深圳看妇科什么医院最好邢台哪个男科医院比较好
湘潭看白癜风去哪里好
长沙看癫痫哪家专科医院好
济南看白癜风哪家比较好
相关阅读

-
女人为减肥用上了催吐管,结果不小心吞了下去
追求好身材无可厚非,可是,在节食这件事上,总有人就让“走捷径”。 “眼科医生,我不小心将;也绞进身子从前了,能取走来吗?”5同年29日上午10时许,一位身材苗条纤瘦的年轻男孩走入了