cby-chen / Kubernetes

kubernetes (k8s) 二进制高可用安装,Binary installation of kubernetes (k8s) --- 开源不易,帮忙点个star,谢谢了🌹

Home Page:https://www.oiox.cn

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

kubectl get node只有主节点和node节点无kubectl的问题

dixtdf opened this issue · comments

v1.24.1-Ubuntu-binary-install-IPv6-IPv4-Three-Masters-Two-Slaves

5.1.7测试高可用

这一步我将主节点01重启机器后 通了

8.2.3启动kubelet
这里出现了两个问题
root@k8s-master01:/etc/kubernetes# kubectl get node
NAME STATUS ROLES AGE VERSION
k8s-master01 Ready 7m44s v1.24.1
这里只有一个 node
然后我去k8s-master02提示The connection to the server localhost:8080 was refused - did you specify the right host or port?
root@k8s-master02:~# kubectl get node
The connection to the server localhost:8080 was refused - did you specify the right host or port?

root@k8s-node01:~# kubectl get node
Command 'kubectl' not found, but can be installed with:
snap install kubectl

2.2.3将组件发送至其他k8s节点

for NODE in $Work; do scp /usr/local/bin/kube{let,-proxy} $NODE:/usr/local/bin/ ; done
这里没有将kubectl放到 node节点

8.2.1所有k8s节点创建相关目录

这一步为什么又让所有节点执行 kubelet

commented

2.2.3 在master01 上执行,get node 也在master01执行

commented

v1.24.1-Ubuntu-binary-install-IPv6-IPv4-Three-Masters-Two-Slaves

5.1.7测试高可用

这一步我将主节点01重启机器后 通了

8.2.3启动kubelet 这里出现了两个问题 root@k8s-master01:/etc/kubernetes# kubectl get node NAME STATUS ROLES AGE VERSION k8s-master01 Ready 7m44s v1.24.1 这里只有一个 node 然后我去k8s-master02提示The connection to the server localhost:8080 was refused - did you specify the right host or port? root@k8s-master02:~# kubectl get node The connection to the server localhost:8080 was refused - did you specify the right host or port?

root@k8s-node01:~# kubectl get node Command 'kubectl' not found, but can be installed with: snap install kubectl

2.2.3将组件发送至其他k8s节点

for NODE in $Work; do scp /usr/local/bin/kube{let,-proxy} $NODE:/usr/local/bin/ ; done 这里没有将kubectl放到 node节点

8.2.1所有k8s节点创建相关目录

这一步为什么又让所有节点执行 kubelet

1)安装完只能看到master01节点,node服务器的kubelet服务没起来或者请求没被批准
2)master2上出错,是因为没有配.kube/config或配置出错
3)kuectl实在master上执行,node节点一般不配

kubernetes一键安装,多支持:ek8-for-centos7-v1.24.3