kubenertes 1.17集群部署总结
发布日期:2021-06-30 20:16:10
浏览次数:3
分类:技术文章
本文共 4297 字,大约阅读时间需要 14 分钟。
使用Easypack下提供的Ansible脚本进行一主多从的集群构建,本次所发布的版本未遇到明显问题,倒是解决了1.16版本中出现的kubectl get cs的unknown显示的问题。部署方法
详细操作方法可参看:https://blog.csdn.net/liumiaocn/article/details/103725251
集群部署
集群说明
机器名称 | IP | 操作系统 | Master节点 | kube-apiserver | kube-scheduler | kube-controller-manager | ETCD | Node节点 | Flannel | Docker | kubelet | kube-proxy |
---|---|---|---|---|---|---|---|---|---|---|---|---|
host131 | 192.168.163.131 | CentOS 7.6 | Yes | 安装 | 安装 | 安装 | 安装 | Yes | 安装 | 安装 | 安装 | 安装 |
host132 | 192.168.163.132 | CentOS 7.6 | - | - | - | - | - | Yes | 安装 | 安装 | 安装 | 安装 |
host133 | 192.168.163.133 | CentOS 7.6 | - | - | - | - | - | Yes | 安装 | 安装 | 安装 | 安装 |
host134 | 192.168.163.134 | CentOS 7.6 | - | - | - | - | - | Yes | 安装 | 安装 | 安装 | 安装 |
hosts准备
[root@host131 ansible]# cat hosts.multi-nodes # kubernetes : master[master-nodes]host131 var_master_host=192.168.163.131 var_master_node_flag=True# kubernetes : node[agent-nodes]host131 var_node_host=192.168.163.131 var_etcd_host=192.168.163.131 var_master_host=192.168.163.131 var_master_node_flag=Truehost132 var_node_host=192.168.163.132 var_etcd_host=192.168.163.131 var_master_host=192.168.163.131 var_master_node_flag=Falsehost133 var_node_host=192.168.163.133 var_etcd_host=192.168.163.131 var_master_host=192.168.163.131 var_master_node_flag=Falsehost134 var_node_host=192.168.163.134 var_etcd_host=192.168.163.131 var_master_host=192.168.163.131 var_master_node_flag=False# kubernetes : etcd[etcd]host131 var_etcd_host=192.168.163.131[root@host131 ansible]#
集群部署
[root@host131 ansible]# ansible-playbook 20.multi-nodes.yml PLAY [agent-nodes] *********************************************************************************************************************TASK [clean : stop services] ***********************************************************************************************************changed: [host134]changed: [host132]changed: [host133]changed: [host131]...省略PLAY RECAP *****************************************************************************************************************************host131 : ok=94 changed=81 unreachable=0 failed=0 host132 : ok=56 changed=46 unreachable=0 failed=0 host133 : ok=56 changed=46 unreachable=0 failed=0 host134 : ok=56 changed=46 unreachable=0 failed=0 [root@host131 ansible]#
结果确认
- 版本确认
[root@host131 ansible]# kubectl versionClient Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0", GitCommit:"70132b0f130acc0bed193d9ba59dd186f0e634cf", GitTreeState:"clean", BuildDate:"2019-12-07T21:20:10Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"linux/amd64"}Server Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0", GitCommit:"70132b0f130acc0bed193d9ba59dd186f0e634cf", GitTreeState:"clean", BuildDate:"2019-12-07T21:12:17Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"linux/amd64"}[root@host131 ansible]#
- 节点确认
[root@host131 ansible]# kubectl get nodes -o wideNAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME192.168.163.131 Ready41s v1.17.0 192.168.163.131 CentOS Linux 7 (Core) 3.10.0-957.el7.x86_64 docker://18.9.7192.168.163.132 Ready 45s v1.17.0 192.168.163.132 CentOS Linux 7 (Core) 3.10.0-957.el7.x86_64 docker://18.9.7192.168.163.133 Ready 45s v1.17.0 192.168.163.133 CentOS Linux 7 (Core) 3.10.0-957.el7.x86_64 docker://18.9.7192.168.163.134 Ready 45s v1.17.0 192.168.163.134 CentOS Linux 7 (Core) 3.10.0-957.el7.x86_64 docker://18.9.7[root@host131 ansible]#
- kubectl get cs
[root@host131 ansible]# kubectl get csNAME STATUS MESSAGE ERRORscheduler Healthy ok controller-manager Healthy ok etcd-0 Healthy {"health":"true"} [root@host131 ansible]#
1.16中出现的问题已经不存在了。
问题总结
部署时有时会碰到如下错误提示,原因未定,重新执行就不再出现此问题。
"error: the server doesn't have a resource type \"clusterrolebinding\"\nerror: no matches for kind \"ClusterRoleBinding\" in version \"rbac.authorization.k8s.io/v1beta1\"", "stderr_lines": ["error: the server doesn't have a resource type \"clusterrolebinding\"", "error: no matches for kind \"ClusterRoleBinding\" in version \"rbac.authorization.k8s.io/v1beta1\""],
转载地址:https://liumiaocn.blog.csdn.net/article/details/103725256 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
感谢大佬
[***.8.128.20]2024年04月25日 09时11分20秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
轨迹规划 trajectory planning
2019-04-30
AGV自动导引运输车
2019-04-30
Trie树(字典树)
2019-04-30
COMP7404 Machine Learing——KNN
2019-04-30
COMP7404 Machine Learing——SVM
2019-04-30
COMP7404 Machine Learing——ROC
2019-04-30
Python量子计算qiskit
2019-04-30
Python的多线程不是真的多线程(GIL全局解释器锁)
2019-04-30
Python手动读取MNIST数据集
2019-04-30
Python手动读取CIFAR-10数据集
2019-04-30
Pytorch(十一) —— 分布式(多GPU)训练
2019-04-30
Deeplab v3
2019-04-30
tensor/矩阵/图片等更换通道,调整size
2019-04-30
本地和colab 中 改变tensorflow的版本
2019-04-30