Posted onInLinux
,
NetWorkWord count in article: 1.4kReading time ≈1 mins.
一、 准备工作
1.1 修改源: /etc/apt/source.list
deb https://mirror.nju.edu.cn/proxmox/debian/pve bookworm pve-no-subscription deb https://mirror.nju.edu.cn/debian/ bookworm main contrib non-free deb http://download.proxmox.com/debian/pve bookworm pve-no-subscription
deb https://mirrors.ustc.edu.cn/proxmox/debian/pve bookworm pve-no-subscription
1.3 注释企业版订阅:
/etc/apt/source.list.d/pve-enterprise.list
1.4 更新
apt update && apt dist-upgrade
二、 相关报错
2.1 pve-apt-hook: not found
/bin/sh: 1: /usr/share/proxmox-ve/pve-apt-hook: not found E: Sub-process /usr/share/proxmox-ve/pve-apt-hook returned an error code (127) E: Failure running script /usr/share/proxmox-ve/pve-apt-hook
ceph-common : Depends: librbd1 (= 16.2.15-pve1) but 17.2.7-pve2~bpo11+1 is to be installed Depends: python3-cephfs (= 16.2.15-pve1) but it is not going to be installed Depends: python3-ceph-argparse (= 16.2.15-pve1) but 17.2.7-pve2~bpo11+1 is to be installed Depends: python3-ceph-common (= 16.2.15-pve1) but 17.2.7-pve2~bpo11+1 is to be installed Depends: python3-rados (= 16.2.15-pve1) but it is not going to be installed Depends: python3-rbd (= 16.2.15-pve1) but it is not going to be installed Depends: python3-rgw (= 16.2.15-pve1) but it is not going to be installed
[root@k8s-node1 ~]# kubeadm join k8s-master:6443 --token 23tt2a.nqn384abbd7rrb8h \ > --discovery-token-ca-cert-hash sha256:7f96b53f61538846515d5905c8073a3919362a893b0463d5bcab7b7b53506af6 [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.
5.2 验证集群状态
k8s-msater 上查看状态 kubectl get cs
[root@k8s-master ~]# kubectl get cs Warning: v1 ComponentStatus is deprecated in v1.19+ NAME STATUS MESSAGE ERROR controller-manager Unhealthy Get "http://127.0.0.1:10252/healthz": dial tcp 127.0.0.1:10252: connect: connection refused scheduler Unhealthy Get "http://127.0.0.1:10251/healthz": dial tcp 127.0.0.1:10251: connect: connection refused etcd-0 Healthy {"health":"true"}
[root@k8s-master manifests]# kubectl get cs Warning: v1 ComponentStatus is deprecated in v1.19+ NAME STATUS MESSAGE ERROR controller-manager Healthy ok scheduler Healthy ok etcd-0 Healthy {"health":"true"}
[root@k8s-master manifests]# kubectl cluster-info Kubernetes control plane is running at https://k8s-master:6443 KubeDNS is running at https://k8s-master:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'. [root@k8s-master manifests]# kubectl get nodes NAME STATUS ROLES AGE VERSION k8s-master Ready control-plane,master 6h49m v1.20.0 k8s-node1 Ready <none> 16m v1.20.0 k8s-node2 Ready <none> 13m v1.20.0
# Define the addresses to test ADDRESSES=("localhost""127.0.0.1""$(hostname -I | awk '{print $1}')""::1")
# Function to test telnet connection test_telnet() { local address=$1 echo -n "Testing $address:$PORT... " iftimeout 2 telnet $address$PORT 2>/dev/null | grep -q "Connected"; then echo"Connected" else echo"Connection failed" fi } # Loop through the addresses and test each one for address in"${ADDRESSES[@]}"; do test_telnet $address done