问题:k8s 增加节点master 或者worker节点具体操作
来源:4-6 基于kubespray的集群运维

qq_富帮主_03493832
2022-09-17
问题:k8s 增加节点master 或者node
根据课程资料 是增加master配置
1.编辑hosts.yaml,增加master节点配置
$ vi inventory/mycluster/hosts.yaml
请问编辑的内容是什么?
[root@node-1 kubespray-2.15.0]# cat inventory/mycluster/hosts.yaml
all:
hosts:
node-1:
ansible_host: 192.168.50.100
ip: 192.168.50.100
access_ip: 192.168.50.100
node-2:
ansible_host: 192.168.50.101
ip: 192.168.50.101
access_ip: 192.168.50.101
node-3:
ansible_host: 192.168.50.102
ip: 192.168.50.102
access_ip: 192.168.50.102
children:
kube-master:
hosts:
node-1:
node-2:
kube-node:
hosts:
node-1:
node-2:
node-3:
etcd:
hosts:
node-1:
node-2:
node-3:
k8s-cluster:
children:
kube-master:
kube-node:
calico-rr:
hosts: {}
比如我要增加192.168.50.103 主机名为node-4 为master节点
更改为如下,(字体我加粗了):
[root@node-1 kubespray-2.15.0]# cat inventory/mycluster/hosts.yaml
all:
hosts:
node-1:
ansible_host: 192.168.50.100
ip: 192.168.50.100
access_ip: 192.168.50.100
node-2:
ansible_host: 192.168.50.101
ip: 192.168.50.101
access_ip: 192.168.50.101
node-3:
ansible_host: 192.168.50.102
ip: 192.168.50.102
access_ip: 192.168.50.102
node-4:
ansible_host: 192.168.50.103
ip: 192.168.50.103
access_ip: 192.168.50.103
children:
kube-master:
hosts:
node-1:
node-2:
node-4:
kube-node:
hosts:
node-1:
node-2:
node-3:
node-4:
etcd:
hosts:
node-1:
node-2:
node-3:
node-4:
k8s-cluster:
children:
kube-master:
kube-node:
calico-rr:
hosts: {}
这样更改对吗?如果是node也是这样改是吗?
另外我准备好需要下载的安装包 这样就不用科学上网进行下载了是吧 我是用kubespray方式安装的。
谢谢回答
1回答
-
刘果国
2022-09-19
先理解一下每个配置项的意思。这个东西不存在对不对,而是你想要什么样的结果。kube-master:是你的集群中的master节点。
kube-node:是集群中的worker节点
etcd:是etcd集群00
相似问题