当前位置: 首页 > news >正文

安装K8s集群

文章首发于我的博客 :https://blog.liuzijian.com/post/9aa6d426-a01c-05b0-6f7a-5da4343f0f9e.html

因阿里云加速服务调整,镜像加速服务自2024年7月起不再支持,拉取镜像,下载网络插件等操作,需要科学上网访问DockerHub。

安装全过程均使用ROOT权限。

1.安装前准备工作

这里采用3台CentOS虚拟机进行集群安装,安装前需要环境准备:

  1. 使用虚拟机VMware新建一个NAT类型网络(一般都会默认自带,只进行设置即可),我的起名叫VMnet8,设置VMnet8的子网IP为192.168.228.0,子网掩码为255.255.255.0,网关地址为192.168.228.2,起止IP地址范围192.168.228.3-192.168.228.254,并勾选"将主机虚拟适配器连接到此网络"为物理机分配IP地址,一般会分配192.168.228.1给物理机。

  2. VMware安装3台Linux虚拟机,可以安装一台,然后完整克隆,这里我采用的安装镜像版本是CentOS-7-x86_64-Minimal-2009,安装完成后,设置网络为VMnet8,将IP获取方式由DHCP修改为静态,并将IP地址分别设置为192.168.228.131192.168.228.132192.168.228.133,再分别设置网关,子网掩码,DNS,MAC地址,并保证MAC地址互相不重复。

系统下载地址 https://mirrors.aliyun.com/centos/7/isos/x86_64/

2.安装docker

K8s是个容器编排工具,需要容器环境,每台机器都要安装docker环境。

2.1 修改机器的yum源

我使用的版本无法从官方镜像源下载软件包,所以替换为阿里云的yum源

打开配置文件

vi /etc/yum.repos.d/CentOS-Base.repo

复制粘贴以下内容进去

[base]
name=CentOS-$releasever - Base
baseurl=https://mirrors.aliyun.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7[updates]
name=CentOS-$releasever - Updates
baseurl=https://mirrors.aliyun.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7[extras]
name=CentOS-$releasever - Extras
baseurl=https://mirrors.aliyun.com/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7[centosplus]
name=CentOS-$releasever - Plus
baseurl=https://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7

刷新yum

yum clean all

2.2 安装yum-utils

yum install -y yum-utils

2.3 添加docker的yum源

执行命令,添加docker的阿里云yum加速地址

sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

2.4 安装docker

执行安装命令,安装docker的三个组件

yum install -y   docker-ce-20.10.7    docker-ce-cli-20.10.7    containerd.io-1.4.6

2.5 设置docker

立即启动docker,并设置开机启动

systemctl enable docker --now

打印docker信息,确定安装和启动完成

docker info

2.6 设置docker镜像加速

登录阿里云容器镜像服务https://cr.console.aliyun.com/cn-shanghai/instances/mirrors,并获取自己的加速地址。

sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{"registry-mirrors": ["https://***************.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker

3.安装K8s集群

3.1 安装条件

  • 兼容的Linux发行版(Ubuntu,CentOS等等)
  • 机器需要2GB内存,CPU2核及以上
  • 集群中机器网络彼此互通
  • 集群中不可有重复的主机名
  • 集群中不可有重复的MAC地址

3.2 安装规划

主节点一台机器,从节点两台机器

  • 主节点master

    主机名:k8s131, IP:192.168.228.131

  • 从节点node

    主机名:k8s132, IP:192.168.228.132
    主机名:k8s133, IP:192.168.228.133

3.3 安装前设置

三台机器都要进行设置。

1.设置主机名

在对应IP地址的机器上分别设置主机名为k8s131k8s132k8s133

hostnamectl set-hostname xxx

执行后,检查是否都设置好了

hostname

会话exit退出后重连shell,就会看到shell的计算机名已经变成了自己设置的计算机名root@k8s131

Last login: Thu Nov 21 17:47:02 2024 from 192.168.228.1
[root@k8s133 ~]# 

2.关闭交换分区

使用free -m命令,可以查看交换分区情况,安装K8s前,需要关闭交换分区,且永久关闭

[root@localhost ~]# free -mtotal        used        free      shared  buff/cache   available
Mem:           1819         309        1166           9         342        1360
Swap:          2047           0        2047

执行命令,永久关闭交换分区(将Swap设置为 0 0 0)

swapoff -a  
sed -ri 's/.*swap.*/#&/' /etc/fstab

3.禁用,并永久禁用SELinux

sudo setenforce 0
sudo sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config

4.设置允许iptables检查桥接流量

将IPV6流量桥接到IPV4网卡上,是K8s官方要求的做法

cat <<EOF | sudo tee /etc/modules-load.d/k8s.conf
br_netfilter
EOFcat <<EOF | sudo tee /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EOFsudo sysctl --system

5.关闭防火墙

CentOS7默认打开防火墙firewalld,3台都需要关闭firewalld

systemctl stop firewalld
systemctl disable firewalld

3.4 安装K8s组件

1.安装kubelet、kubeadm、kubectl

首先添加k8s软件包的yum源到三台机器

cat <<EOF | sudo tee /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=http://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=0
repo_gpgcheck=0
gpgkey=http://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpghttp://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
exclude=kubelet kubeadm kubectl
EOF

三台机器依次执行安装命令

sudo yum install -y kubelet-1.20.9 kubeadm-1.20.9 kubectl-1.20.9 --disableexcludes=kubernetes

三台机器都启动kubelet,并设置开机启动

sudo systemctl enable --now kubelet

不停执行systemctl status kubelet会发现服务一直处于闪断状态,因为kubelet一直在等待

在这里插入图片描述

3.5 初始化主节点

使用kubeadm引导集群,初始化主节点。

1.首先所有机器都要先下载需要的镜像

docker pull registry.k8s.io/kube-apiserver:v1.20.9
docker pull registry.k8s.io/kube-proxy:v1.20.9
docker pull registry.k8s.io/kube-controller-manager:v1.20.9
docker pull registry.k8s.io/kube-scheduler:v1.20.9
docker pull registry.k8s.io/coredns:1.7.0
docker pull registry.k8s.io/etcd:3.4.13-0
docker pull registry.k8s.io/pause:3.2

下载完成后docker images验证

在这里插入图片描述

2.设置主节点域名映射

3台机器都必须添加master节点(又叫集群的入口节点)的域名映射,IP按实际情况修改。

echo "192.168.228.131  cluster-endpoint" >> /etc/hosts

3.初始化主节点

主节点所在机器上执行命令,初始化主节点

参数解释

  • --service-cidr, --pod-network-cidr 两项设置的网络范围不能重叠,也不能同服务器所在网络范围重叠。
  • --apiserver-advertise-address改成自己主节点的IP。
  • --control-plane-endpoint改为自己设置的主节点域名。

命令

kubeadm init \
--image-repository registry.k8s.io \
--apiserver-advertise-address=192.168.228.131 \
--control-plane-endpoint=cluster-endpoint \
--kubernetes-version=v1.20.9 \
--service-cidr=10.96.0.0/16 \
--pod-network-cidr=192.168.23.0/24 

等待初始化完成后,终端输出提示成功,说明初始化完成。输出的内容需要复制保存备用。

[root@k8s131 ~]# kubeadm init \
> --image-repository registry.k8s.io \
> --apiserver-advertise-address=192.168.228.131 \
> --control-plane-endpoint=cluster-endpoint \
> --kubernetes-version=v1.20.9 \
> --service-cidr=10.96.0.0/16 \
> --pod-network-cidr=192.168.23.0/24 
[init] Using Kubernetes version: v1.20.9
[preflight] Running pre-flight checks[WARNING Firewalld]: firewalld is active, please ensure ports [6443 10250] are open or your cluster may not function correctly[WARNING IsDockerSystemdCheck]: detected "cgroupfs" as the Docker cgroup driver. The recommended driver is "systemd". Please follow the guide at https://kubernetes.io/docs/setup/cri/[WARNING SystemVerification]: this Docker version is not on the list of validated versions: 20.10.7. Latest validated version: 19.03
[preflight] Pulling images required for setting up a Kubernetes cluster
[preflight] This might take a minute or two, depending on the speed of your internet connection
[preflight] You can also perform this action in beforehand using 'kubeadm config images pull'
[certs] Using certificateDir folder "/etc/kubernetes/pki"
[certs] Generating "ca" certificate and key
[certs] Generating "apiserver" certificate and key
[certs] apiserver serving cert is signed for DNS names [cluster-endpoint k8s131 kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local] and IPs [10.96.0.1 192.168.228.131]
[certs] Generating "apiserver-kubelet-client" certificate and key
[certs] Generating "front-proxy-ca" certificate and key
[certs] Generating "front-proxy-client" certificate and key
[certs] Generating "etcd/ca" certificate and key
[certs] Generating "etcd/server" certificate and key
[certs] etcd/server serving cert is signed for DNS names [k8s131 localhost] and IPs [192.168.228.131 127.0.0.1 ::1]
[certs] Generating "etcd/peer" certificate and key
[certs] etcd/peer serving cert is signed for DNS names [k8s131 localhost] and IPs [192.168.228.131 127.0.0.1 ::1]
[certs] Generating "etcd/healthcheck-client" certificate and key
[certs] Generating "apiserver-etcd-client" certificate and key
[certs] Generating "sa" key and public key
[kubeconfig] Using kubeconfig folder "/etc/kubernetes"
[kubeconfig] Writing "admin.conf" kubeconfig file
[kubeconfig] Writing "kubelet.conf" kubeconfig file
[kubeconfig] Writing "controller-manager.conf" kubeconfig file
[kubeconfig] Writing "scheduler.conf" kubeconfig file
[kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env"
[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"
[kubelet-start] Starting the kubelet
[control-plane] Using manifest folder "/etc/kubernetes/manifests"
[control-plane] Creating static Pod manifest for "kube-apiserver"
[control-plane] Creating static Pod manifest for "kube-controller-manager"
[control-plane] Creating static Pod manifest for "kube-scheduler"
[etcd] Creating static Pod manifest for local etcd in "/etc/kubernetes/manifests"
[wait-control-plane] Waiting for the kubelet to boot up the control plane as static Pods from directory "/etc/kubernetes/manifests". This can take up to 4m0s
[apiclient] All control plane components are healthy after 14.007116 seconds
[upload-config] Storing the configuration used in ConfigMap "kubeadm-config" in the "kube-system" Namespace
[kubelet] Creating a ConfigMap "kubelet-config-1.20" in namespace kube-system with the configuration for the kubelets in the cluster
[upload-certs] Skipping phase. Please see --upload-certs
[mark-control-plane] Marking the node k8s131 as control-plane by adding the labels "node-role.kubernetes.io/master=''" and "node-role.kubernetes.io/control-plane='' (deprecated)"
[mark-control-plane] Marking the node k8s131 as control-plane by adding the taints [node-role.kubernetes.io/master:NoSchedule]
[bootstrap-token] Using token: 4qn4kj.52saric9a3vqnk1w
[bootstrap-token] Configuring bootstrap tokens, cluster-info ConfigMap, RBAC Roles
[bootstrap-token] configured RBAC rules to allow Node Bootstrap tokens to get nodes
[bootstrap-token] configured RBAC rules to allow Node Bootstrap tokens to post CSRs in order for nodes to get long term certificate credentials
[bootstrap-token] configured RBAC rules to allow the csrapprover controller automatically approve CSRs from a Node Bootstrap Token
[bootstrap-token] configured RBAC rules to allow certificate rotation for all node client certificates in the cluster
[bootstrap-token] Creating the "cluster-info" ConfigMap in the "kube-public" namespace
[kubelet-finalize] Updating "/etc/kubernetes/kubelet.conf" to point to a rotatable kubelet client certificate and key
[addons] Applied essential addon: CoreDNS
[addons] Applied essential addon: kube-proxyYour Kubernetes control-plane has initialized successfully!To start using your cluster, you need to run the following as a regular user:mkdir -p $HOME/.kubesudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/configsudo chown $(id -u):$(id -g) $HOME/.kube/configAlternatively, if you are the root user, you can run:export KUBECONFIG=/etc/kubernetes/admin.confYou should now deploy a pod network to the cluster.
Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:https://kubernetes.io/docs/concepts/cluster-administration/addons/You can now join any number of control-plane nodes by copying certificate authorities
and service account keys on each node and then running the following as root:kubeadm join cluster-endpoint:6443 --token 4qn4kj.52saric9a3vqnk1w \--discovery-token-ca-cert-hash sha256:7f12181600006aeb62fb38bcb82582809a9ad1911e49065f1fd13f9c68c95774 \--control-plane Then you can join any number of worker nodes by running the following on each as root:kubeadm join cluster-endpoint:6443 --token 4qn4kj.52saric9a3vqnk1w \--discovery-token-ca-cert-hash sha256:7f12181600006aeb62fb38bcb82582809a9ad1911e49065f1fd13f9c68c95774 

4.配置文件目录

按照上述的输出提示“To start using your cluster, you need to run the following as a regular user” 还需要需要在主节点执行下面的命令

  mkdir -p $HOME/.kubesudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/configsudo chown $(id -u):$(id -g) $HOME/.kube/config

5.部署网络插件

按照上述的输出提示 You should now deploy a pod network to the cluster. Run “kubectl apply -f [podnetwork].yaml”,接下来还需要部署一个pod网络插件到master节点上。

输入命令kubectl get nodes -A,测试下主节点状态,返回NotReady是因为还没有部署网络插件。

[root@k8s131 ~]# kubectl get nodes -A
NAME     STATUS     ROLES                  AGE    VERSION
k8s131   NotReady   control-plane,master   5h5m   v1.20.9

k8s支持多种网络插件,例如calico,安装前要先将它的编排文件下载到本地目录

curl https://docs.projectcalico.org/v3.20/manifests/calico.yaml -O  

配置文件中找到以下内容

# - name: CALICO_IPV4POOL_CIDR
#   value: "192.168.0.0/16"

将默认的192.168.0.0/16修改为--pod-network-cidr=指定的地址192.168.23.0/24,并解除注释

- name: CALICO_IPV4POOL_CIDRvalue: "192.168.23.0/24"

在主节点执行命令,部署网络插件calico,部署过程需要联网下载镜像

kubectl apply -f calico.yaml
[root@k8s131 opt]# kubectl apply -f calico.yaml 
configmap/calico-config created
customresourcedefinition.apiextensions.k8s.io/bgpconfigurations.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/bgppeers.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/blockaffinities.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/clusterinformations.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/felixconfigurations.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/globalnetworkpolicies.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/globalnetworksets.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/hostendpoints.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/ipamblocks.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/ipamconfigs.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/ipamhandles.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/ippools.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/kubecontrollersconfigurations.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/networkpolicies.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/networksets.crd.projectcalico.org created
clusterrole.rbac.authorization.k8s.io/calico-kube-controllers created
clusterrolebinding.rbac.authorization.k8s.io/calico-kube-controllers created
clusterrole.rbac.authorization.k8s.io/calico-node created
clusterrolebinding.rbac.authorization.k8s.io/calico-node created
daemonset.apps/calico-node created
serviceaccount/calico-node created
deployment.apps/calico-kube-controllers created
serviceaccount/calico-kube-controllers created
poddisruptionbudget.policy/calico-kube-controllers created

输入kubectl get pods -A查看网络插件pod部署情况

状态为ContainerCreatingInit说明正在下载部署

[root@k8s131 opt]# kubectl get pods -A
NAMESPACE     NAME                                       READY   STATUS              RESTARTS   AGE
kube-system   calico-kube-controllers-577f77cb5c-wpxh7   0/1     ContainerCreating   0          21m
kube-system   calico-node-7wb4z                          0/1     Init:2/3            0          9m3s
kube-system   coredns-76c6f6bbc9-4q5f9                   0/1     ContainerCreating   0          5h41m
kube-system   coredns-76c6f6bbc9-nkdcl                   0/1     ContainerCreating   0          5h41m
kube-system   etcd-k8s131                                1/1     Running             1          5h41m
kube-system   kube-apiserver-k8s131                      1/1     Running             1          5h41m
kube-system   kube-controller-manager-k8s131             1/1     Running             1          5h41m
kube-system   kube-proxy-nt5jf                           1/1     Running             1          5h41m
kube-system   kube-scheduler-k8s131                      1/1     Running             1          5h41m

完成后状态均为Running

[root@k8s131 opt]# kubectl get pods -A
NAMESPACE     NAME                                       READY   STATUS    RESTARTS   AGE
kube-system   calico-kube-controllers-577f77cb5c-wpxh7   1/1     Running   0          24m
kube-system   calico-node-7wb4z                          1/1     Running   0          12m
kube-system   coredns-76c6f6bbc9-4q5f9                   1/1     Running   0          5h44m
kube-system   coredns-76c6f6bbc9-nkdcl                   1/1     Running   0          5h44m
kube-system   etcd-k8s131                                1/1     Running   1          5h45m
kube-system   kube-apiserver-k8s131                      1/1     Running   1          5h45m
kube-system   kube-controller-manager-k8s131             1/1     Running   1          5h45m
kube-system   kube-proxy-nt5jf                           1/1     Running   1          5h44m
kube-system   kube-scheduler-k8s131                      1/1     Running   1          5h45m

再次输入命令kubectl get nodes -A测试主节点状态,已经变为Ready,准备就绪,网络插件到此部署完成。

[root@k8s131 opt]# kubectl get nodes -A
NAME     STATUS   ROLES                  AGE     VERSION
k8s131   Ready    control-plane,master   5h53m   v1.20.9

主节点至此初始化完成。

3.6 从节点加入集群

从节点加入集群的命令,在初始化主节点命令输出的内容中就有,在之前复制的输出内容中找到Then you can join any number of worker nodes by running the following on each as root:,并找到它下面的一行命令在每个从节点执行,该命令24小时内有效

kubeadm join cluster-endpoint:6443 --token 4qn4kj.52saric9a3vqnk1w \--discovery-token-ca-cert-hash sha256:7f12181600006aeb62fb38bcb82582809a9ad1911e49065f1fd13f9c68c95774 

如果令牌忘记了,或者超过了24小时,在master节点上执行下面的命令,生成新的令牌

 kubeadm token create --print-join-command

在两个从节点执行这个命令,执行后,以下提示,说明加入成功

[root@k8s132 ~]# kubeadm join cluster-endpoint:6443 --token bjme49.uhg7ubgjn2m16b76     --discovery-token-ca-cert-hash sha256:7f12181600006aeb62fb38bcb82582809a9ad1911e49065f1fd13f9c68c95774
[preflight] Running pre-flight checks[WARNING IsDockerSystemdCheck]: detected "cgroupfs" as the Docker cgroup driver. The recommended driver is "systemd". Please follow the guide at https://kubernetes.io/docs/setup/cri/[WARNING SystemVerification]: this Docker version is not on the list of validated versions: 20.10.7. Latest validated version: 19.03[WARNING Hostname]: hostname "k8s132" could not be reached[WARNING Hostname]: hostname "k8s132": lookup k8s132 on 192.168.228.2:53: server misbehaving
[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.

回到主节点执行命令kubectl get nodes -A,查看节点状态,可以看到两个从节点了,但是状态是NotReady,此时执行kubectl get pods -A查看pods状态,发现是因为从节点的网络插件未初始化成功完成导致,此时需要耐心等待网络插件加载完成,以我的经验来说加载网络插件需要下载很久。

管理集群要靠主节点,kubectl命令只能在主节点执行

[root@k8s131 ~]# kubectl get nodes -A
NAME     STATUS     ROLES                  AGE     VERSION
k8s131   Ready      control-plane,master   2d23h   v1.20.9
k8s132   NotReady   <none>                 6m49s   v1.20.9
k8s133   NotReady   <none>                 6m41s   v1.20.9
[root@k8s131 ~]# kubectl get pods -A
NAMESPACE     NAME                                       READY   STATUS                  RESTARTS   AGE
kube-system   calico-kube-controllers-577f77cb5c-wpxh7   1/1     Running                 1          2d18h
kube-system   calico-node-7wb4z                          1/1     Running                 1          2d18h
kube-system   calico-node-plcdp                          0/1     Init:ImagePullBackOff   0          8m22s
kube-system   calico-node-zwmrg                          0/1     Init:ImagePullBackOff   0          8m30s
kube-system   coredns-76c6f6bbc9-4q5f9                   1/1     Running                 1          2d23h
kube-system   coredns-76c6f6bbc9-nkdcl                   1/1     Running                 1          2d23h
kube-system   etcd-k8s131                                1/1     Running                 2          2d23h
kube-system   kube-apiserver-k8s131                      1/1     Running                 2          2d23h
kube-system   kube-controller-manager-k8s131             1/1     Running                 2          2d23h
kube-system   kube-proxy-flrq9                           1/1     Running                 0          8m22s
kube-system   kube-proxy-nt5jf                           1/1     Running                 2          2d23h
kube-system   kube-proxy-tcrjv                           1/1     Running                 0          8m30s
kube-system   kube-scheduler-k8s131                      1/1     Running                 2          2d23h

等到kubectl get pods -A全部变为Running,再次测试kubectl get nodes -A

[root@k8s131 ~]# kubectl get nodes -A
NAME     STATUS   ROLES                  AGE   VERSION
k8s131   Ready    control-plane,master   3d    v1.20.9
k8s132   Ready    <none>                 23m   v1.20.9
k8s133   Ready    <none>                 22m   v1.20.9

所有节点状态都是Ready,至此,两个从节点加入了K8s集群并进入就绪状态,整个K8s集群安装完成!

相关文章:

安装K8s集群

文章首发于我的博客 &#xff1a;https://blog.liuzijian.com/post/9aa6d426-a01c-05b0-6f7a-5da4343f0f9e.html 因阿里云加速服务调整&#xff0c;镜像加速服务自2024年7月起不再支持&#xff0c;拉取镜像&#xff0c;下载网络插件等操作&#xff0c;需要科学上网访问DockerHu…...

【数据科学导论】第一二章·大数据与数据表示与存储

&#x1f308; 个人主页&#xff1a;十二月的猫-CSDN博客 &#x1f525; 系列专栏&#xff1a; &#x1f3c0;数据处理与分析_十二月的猫的博客-CSDN博客 &#x1f4aa;&#x1f3fb; 十二月的寒冬阻挡不了春天的脚步&#xff0c;十二点的黑夜遮蔽不住黎明的曙光 目录 1. 前言…...

LabVIEW数字式气压计自动检定系统

开发了一个基于LabVIEW开发的数字式气压计自动检定系统。在自动化检定PTB220和PTB210系列数字气压计&#xff0c;通过优化硬件组成和软件设计&#xff0c;实现高效率和高准确度的检定工作&#xff0c;有效降低人力成本并提升操作准确性。 项目背景 随着自动气象站的广泛部署&a…...

按行分割文本函数(C++)

文本分割函数SplitText2Line解析 以下是对SplitText2Line函数的详细介绍&#xff1a; void SplitText2Line(s8* strText, std::vector<std::string>& vecStrLines) {// 1. 清空存储结果的向量vecStrLines.clear();// 2. 打印原始文本信息&#xff08;用于调试目的&…...

要查询 `user` 表中 `we_chat_subscribe` 和 `we_chat_union_id` 列不为空的用户数量

文章目录 1、we_chat_subscribe2、we_chat_union_id 1、we_chat_subscribe 要查询 user 表中 we_chat_subscribe 列不为空的用户数量&#xff0c;你可以使用以下 SQL 查询语句&#xff1a; SELECT COUNT(*) FROM user WHERE we_chat_subscribe IS NOT NULL;解释&#xff1a; …...

【C语言程序设计——选择结构程序设计】预测你的身高(头歌实践教学平台习题)【合集】

目录&#x1f60b; 任务描述 相关知识 1、输入数值 2、选择结构语句 3、计算结果并输出 编程要求 测试说明 通关代码 测试结果 任务描述 本关任务&#xff1a;编写一个程序&#xff0c;该程序需输入个人数据&#xff0c;进而预测其成年后的身高。 相关知识 为了完成本…...

使用Excel制作通达信自定义外部数据,安排!!!

Excel相信大家电脑上都有这个工具&#xff0c;相比敲编程代码&#xff0c;用这个去做自定义数据对大多数人&#xff0c;应该是比较友好的。自定义数据分为外部序列数据&#xff0c;看了一下内容理解起来比较多&#xff0c;分两期给大家介绍。为了照顾电脑基础薄弱的朋友&#x…...

阿里云镜像服务使用指南

阿里云容器镜像服务ACR&#xff08;Alibaba Cloud Container Registry&#xff09;是面向容器镜像、Helm Chart等符合OCI标准云原生制品安全托管及高效分发平台。ACR企业版支持全球同步加速、大规模和大镜像分发加速、多代码源构建加速等全链路加速能力&#xff0c;与容器服务A…...

adb无法连接到安卓设备【解决方案】报错:adb server version (40) doesn‘t match this client (41);

下载老版本Platformtools​​​​​​​​​​​​​​https://dl.google.com/android/repository/platform-tools_r28.0.2-windows.zip?hlzh-cn 替换原来的platform-tools文件夹即可。 问题原因分析&#xff1a;电脑端adb client版本&#xff08;41&#xff09;和安卓端adb …...

WPF TextBox 输入限制 详解

总目录 前言 通常对于WPF输入框 输入的控制无非以下方式 1 直接禁止输入(包括粘贴) 不符合要求的字符 如只可输入数字的输入框&#xff0c;当你输入字母的时候是无法输入的 2 输入后&#xff0c;校验内容是否符合要求&#xff0c;然后提示错误&#xff0c;禁止提交信息 如只可…...

安装Visual studio2022后,没法新建.net 4.5.2的项目

在Visual Studio 2022中无法新建.NET Framework 4.5.2的项目&#xff0c;通常是因为Visual Studio 2022默认不再支持较旧的.NET Framework版本&#xff0c;如4.5或4.5.2。不过&#xff0c;你可以通过一些手动步骤来使Visual Studio 2022支持.NET Framework 4.5.2项目。以下是一…...

【读书笔记】《论语别裁》孝道是这样一个东西

一、内容摘要 本章通过比较人类与其他动物的生存方式&#xff0c;探讨了孝道和人文文化的重要性。作者提到&#xff0c;在自然界中&#xff0c;所有生物都在为自身生存而努力&#xff0c;动物之间的亲子关系如母鸡保护小鸡体现了母性的重要性。虽然人类在外表上与动物无异&…...

【magic-dash】01:magic-dash创建单页面应用及二次开发

文章目录 一、magic-dash是什么1.1 安装1.2 使用1.2.1 查看内置项目模板1.2.2 生成指定项目模板1.2.3 查看当前magic-dash版本1.2.4 查看命令说明1.2.5 内置模板列表二、创建虚拟环境并安装magic-dash三、magic-dash单页工具应用开发3.1 创建单页面项目3.1.1 使用命令行创建单页…...

Python编程构建动态的圣诞画面

Python编程构建动态的圣诞画面 引言 今天是圣诞节&#xff0c;空气中弥漫着节日的气息。让我们利用Python编程技能&#xff0c;为我们的屏幕带来一丝节日的温暖。本文将引导你通过Python代码创建一个动态的圣诞场景&#xff0c;包括闪烁的圣诞树和房屋画面&#xff0c;所有这…...

2025年创业投资前瞻:AI、可持续发展与基础设施建设的深度整合

随着科技的进步和社会需求的变化,2025年的创业环境将更加复杂且充满机遇。本篇文章旨在为寻求在这一关键时期启动或扩展业务的企业家提供一份详尽的投资指南,聚焦于人工智能(AI)、可持续发展和基础设施建设三大核心领域。 1. 智能政府与公民服务 自动化行政流程:通过引入…...

vulnhub靶场-matrix-breakout-2-morpheus攻略(截止至获取shell)

扫描出ip为192.168.121.161 访问该ip&#xff0c;发现只是一个静态页面什么也没有 使用dir dirsearch 御剑都只能扫描到/robots.txt /server-status 两个页面&#xff0c;前者提示我们什么也没有&#xff0c;后面两个没有权限访问 扫描端口&#xff0c;存在81端口 访问&#x…...

C++软件设计模式之类型模式和对象型模式

在 C 软件设计模式中&#xff0c;通常将设计模式分为两大类&#xff1a;类型模式&#xff08;Type Patterns&#xff09;和对象型模式&#xff08;Object Patterns&#xff09;。这两种模式在实现和应用上有不同的特点和目的。 类型模式&#xff08;Type Patterns&#xff09;…...

Oracle、ACCSEE与TDMS的区别

Oracle、ACCSEE和TDMS都是不同类型的数据管理和存储工具&#xff0c;它们各自有独特的用途、结构和复杂性。Oracle是一个功能强大的关系型数据库管理系统&#xff0c;适用于大规模企业级应用&#xff0c;支持复杂查询和事务管理。ACCSEE主要应用于实时数据采集和过程监控&#…...

视频监控平台:Liveweb视频汇聚融合平台智慧安防视频监控应用方案

Liveweb是一款功能强大、灵活部署的安防视频监控平台&#xff0c;支持多种主流标准协议&#xff0c;包括GB28181、RTSP/Onvif、RTMP等&#xff0c;同时兼容海康Ehome、海大宇等厂家的私有协议和SDK接入。该平台不仅提供传统安防监控功能&#xff0c;还支持接入AI智能分析&#…...

【ES6复习笔记】箭头函数(5)

简介 本教程将介绍如何在 JavaScript 中使用箭头函数&#xff0c;包括箭头函数的基本语法、特点以及在实际开发中的应用。通过本教程&#xff0c;你将学会如何使用箭头函数来简化代码&#xff0c;提高代码的可读性和简洁性。 箭头函数的基本语法 箭头函数是 ES6 引入的一种新…...

数字IC前端学习笔记:脉动阵列的设计方法学(四)

相关阅读 数字IC前端https://blog.csdn.net/weixin_45791458/category_12173698.html?spm1001.2014.3001.5482 引言 脉动结构&#xff08;也称为脉动阵列&#xff09;表示一种有节奏地计算并通过系统传输数据的处理单元(PEs)网络。这些处理单元有规律地泵入泵出数据以保持规则…...

基于web的音乐网站(Java+SpringBoot+Mysql)

目录 1系统概述 1.1 研究背景 1.2研究目的 1.3系统设计思想 2相关技术 2.1?MYSQL数据库 2.2?B/S结构 2.3?Spring Boot框架简介 3系统分析 3.1可行性分析 3.1.1技术可行性 3.1.2经济可行性 3.1.3操作可行性 3.2系统性能分析 3.2.1 系统安全性 3.2.2 数据完整…...

从 GitLab.com 到 JihuLab.com 的迁移指南

本文分享从 GitLab.com 到 JihuLab.com 的迁移指南。 近期&#xff0c;GitLab Inc. 针对其 SaaS 产品做了限制&#xff0c;如果被判定为国内用户&#xff0c;则会建议使用其在国内的发布版本极狐GitLab。从 GitLab SaaS 产品&#xff08;GitLab.com&#xff09;迁移到极狐GitL…...

纯真社区版IP库CZDB数据格式使用教程

1. 概述 纯真社区版IP库是一种免费且公开的IP地理位置数据库&#xff0c;主要面向非商业用途。其最新推出的CZDB格式是一种全新的数据文件格式&#xff0c;自2024年10月起将成为官方维护和更新的唯一版本。该格式支持同时存储IPv4和IPv6地址信息&#xff0c;具备以下优点&…...

go window安装protoc protoc生成protobuf文件

1. 下载&#xff1a; Releases protocolbuffers/protobuf GitHub 2. 解压缩&#xff1a; 3. 配置环境变量&#xff1a; 选择系统变量->Path -> 新增 解压缩后的bin路径 4. 打印版本&#xff1a; protoc --version 5. 安装protoc-gen-go cmd 下输入安装命令&#xff0…...

ChildLife“童年时光杯”足球联赛启动 共促青少年健康成长

2024年12月21日至22日&#xff0c;由美国知名婴幼儿营养品牌ChildLife童年时光赞助的“童年时光杯”青少年足球联赛将在上海拉开帷幕。本次赛事U7/U8组别共有16支足球队参赛&#xff0c;包括上海幸运星足球俱乐部旗下的明星球队&#xff0c;以及其他青少年俱乐部的优秀队伍&…...

Erlang语言的数据结构

题目&#xff1a;Erlang数据结构&#xff1a;构建高效并发世界的基石 一、引言 在编程世界中&#xff0c;数据结构是组织和管理数据的关键工具&#xff0c;它不仅影响着程序的效率&#xff0c;还直接关系到代码的可读性和可维护性。Erlang&#xff0c;这门为高并发、容错性设…...

宏定义介绍

假设我们有以下代码&#xff1a; LOG_INFO("rkipc_ini_path_ is %s, rkipc_iq_file_path_ is %s, rkipc_log_level is %d\n",rkipc_ini_path_, rkipc_iq_file_path_, rkipc_log_level);1. LOG_INFO 宏定义 根据之前的 LOG_INFO 宏定义&#xff1a; #define LOG_IN…...

攻防世界 - Web - Level 1 unseping

关注这个靶场的其它相关笔记&#xff1a;攻防世界&#xff08;XCTF&#xff09; —— 靶场笔记合集-CSDN博客 0x01&#xff1a;Write UP 本关是一个 PHP 代码审计关卡&#xff0c;考察的是 PHP 反序列化漏洞以及命令执行的一些绕过手段&#xff0c;下面笔者将带你一步步过关。…...

【ES6复习笔记】ES6的模块化(18)

模块化的概念 模块化是指将一个复杂的系统分解为多个模块&#xff0c;每个模块完成一个特定的功能&#xff0c;模块之间通过接口进行通信。模块化的目的是提高代码的可读性、可维护性和可重用性。 模块化规范产品&#xff0c; ES6 之前的模块化规范有&#xff1a; CommonJS …...

[项目][boost搜索引擎#4] cpp-httplib使用 log.hpp 前端 测试及总结

目录 编写http_server模块 1. 引入cpp-httplib到项目中 2. cpp-httplib的使用介绍 3. 正式编写http_server 九、添加日志到项目中 十、编写前端模块 十一. 详解传 gitee 十二、项目总结 项目的扩展 写在前面 [项目详解][boost搜索引擎#1] 概述 | 去标签 | 数据清洗 |…...

vue3入门教程:计算属性

计算属性的基本用法 计算属性是通过computed函数创建的&#xff0c;它接受一个getter函数作为参数&#xff0c;并返回一个只读的响应式ref对象。该ref对象通过.value属性暴露getter函数的返回值。 <template><div><p>原始数据: {{ count }}</p><p…...

Linux大数据方向shell

一、概述 shell是一个命令行解释器&#xff0c;它接收应用程序/用户命令&#xff0c;然后调用操作系统内核&#xff0c;还是一个功能相当强大的编程语言&#xff0c;易编写&#xff0c;易调试&#xff0c;灵活性强。 二、shell入门 1.输出hello world touch helloworld.sh&…...

深度学习blog-卷积神经网络(CNN)

卷积神经网络&#xff08;Convolutional Neural Network&#xff0c;CNN&#xff09;是一种广泛应用于计算机视觉领域&#xff0c;如图像分类、目标检测和图像分割等任务中的深度学习模型。 1. 结构 卷积神经网络一般由以下几个主要层组成&#xff1a; 输入层&#xff1a;接收…...

Unity3D如何优化物理模拟?

在Unity3D中优化物理模拟可以显著提高游戏的性能和稳定性。以下是一些常见的优化策略&#xff1a; 1. 调整物理引擎设置 物理时间步长&#xff08;Physics Time Step&#xff09;&#xff1a;这是物理引擎每次更新的时间间隔。较小的值可以提高物理模拟的精度&#xff0c;但会…...

C项目 天天酷跑(下篇)

上篇再博客里面有&#xff0c;接下来我们实现我们剩下要实现的功能 文章目录 碰撞检测 血条的实现 积分计数器 前言 我们现在要继续优化我们的程序才可以使这个程序更加的全面 碰撞的检测 定义全局变量 实现全局变量 void checkHit() {for (int i 0; i < OBSTACLE_C…...

认识Python语言

Python背景介绍 Python的作者是荷兰人 Guido van Rossum&#xff08;龟叔&#xff09;Python正是诞生于1991年Python目前有两个版本&#xff0c;Python2和Python3 代码不完全兼容源文件.py文件名后缀Python的解释如今有多个语言实现&#xff0c;我们常用的是Cpython或者IPytho…...

Python——day09

os模块 sys模块 time模块 logging模块...

机器视觉检测相机基础知识 | 颜色 | 光源 | 镜头 | 分辨率 / 精度 / 公差

注&#xff1a;本文为 “keyence 视觉沙龙中机器视觉检测基础知识” 文章合辑。 机器视觉检测基础知识&#xff08;一&#xff09;颜色篇 视觉检测硬件构成的基本部分包括&#xff1a;处理器、相机、镜头、光源。 其中&#xff0c;和光源相关的最重要的两个参数就是光源颜色和…...

在 CentOS 系统上安装 ClickHouse

在 CentOS 系统上安装 ClickHouse 数据库相对简单&#xff0c;可以通过官方提供的安装包来进行。以下是详细的安装步骤。 1. 更新系统 首先&#xff0c;确保你的系统是最新的&#xff0c;更新软件包和系统库&#xff1a; sudo yum update -y2. 安装依赖库 ClickHouse 需要一…...

FreeSql

官网 1、安装包 Install-Package FreeSql Install-Package FreeSql.Provider.SqlServer2、Program.cs 文件 using FreeSql; using Microsoft.OpenApi.Models; using System.Configuration;var builder WebApplication.CreateBuilder(args);builder.Services.AddController…...

webpakc介绍

介绍 因为不确定打出的前端包所访问的后端IP&#xff0c;需要对项目中IP配置文件单独拿出来&#xff0c;方便运维部署的时候对IP做修改。 因此&#xff0c;需要用webpack单独打包指定文件。 CommonsChunkPlugin module.exports {entry: {app: APP_FILE // 入口文件},outpu…...

自然语言处理基础

目录 一&#xff1a;文本表示 1&#xff1a;词的独热表示 2&#xff1a;词的分布式表示 &#xff08;1&#xff09;最初分布式表示 &#xff08;2&#xff09;&#xff1a;点互信息&#xff08;PMI&#xff09; &#xff08;3&#xff09;奇异值分解&#xff08;SVD&…...

创新引领,从零到一:陶氏减速机在高精密领域的深耕与突破

在高精密机械传动中&#xff0c;陶氏智能正以一款革命性的“第四类”减速机——环面包络多齿啮合减速机&#xff0c;书写着属于自己的传奇篇章。这款减速机不仅代表了技术的飞跃&#xff0c;更是对传统工业自动化领域的一次深刻革新&#xff0c;其影响力横跨航天航空、工业机器…...

神经网络-VggNet

2014年VggNet被推出&#xff0c;获取了ILSVRC2014比赛分类项目的第二名&#xff0c;第一名是GoogleNet&#xff0c;该网络在下节介绍&#xff0c;本节主要介绍VggNet。 VggNet可以称为是一个家族&#xff0c;根据层数的不同包括了A、A-LRN、B、C、D等网络结构&#xff0c;其中…...

服务器数据恢复—Lustre分布式文件系统下服务器节点进水的数据恢复案例

服务器数据恢复环境&故障&#xff1a; 5台节点服务器&#xff0c;每台节点服务器上有一组RAID5阵列。每组RAID5阵列上有6块硬盘&#xff08;其中1块硬盘设置为热备盘&#xff0c;其他5块硬盘为数据盘&#xff09;。上层系统环境为Lustre分布式文件系统。 机房天花板漏水导致…...

实战分享:开发设计文档模版及编写要点

总框架 一、需求类开发设计文档模版 1、PRD链接 PRD文档链接 2、后端设计 1&#xff09;流程图/代码逻辑描述 描述代码逻辑&#xff0c;要求清晰准确&#xff0c;尽量用图表描述 超过3人天工作量的需求必须有流程图 2&#xff09;库表设计 涉及数据库的改动&#xff0c…...

一文彻底拿捏DevEco Studio的使用小技巧

程序员Feri一名12年的程序员,做过开发带过团队创过业,擅长Java相关开发、鸿蒙开发、人工智能等,专注于程序员搞钱那点儿事,希望在搞钱的路上有你相伴&#xff01;君志所向,一往无前&#xff01; 0.安装DevEco Studio DevEco Studio面向HarmonyOS应用及元服务开发者提供的集成开…...

Linux文件目录 --- touch命令创建文件

四、touch命令 touch命令用于创建新文件或更改现有文件的时间戳。文件的时间戳包括最后访问时间、最后修改时间和最后更改时间。 touch [选项] 文件名称 选项作用- a改变档案的读取时间记录-c 假如目的档案不存在&#xff0c;不会建立新的档案-d 指定时间与日期-h影响每个…...

Scala课堂小结

(一)数组&#xff1a; 1.不可变数组 2.创建数组...