k8s搭建(脚本一键部署)
搭建k8s
1. 准备工作(一台master,一台node)
2. master节点
将chinaskills_cloud_paas.iso和CentOS-1804.iso上传到master节点
curl -o CentOS-1804.iso http://10.104.44.30/file/os-images/CentOS-1804.iso
curl -o chinaskills_cloud_paas.iso http://10.104.44.30/file/k8s/chinaskills_cloud_paas.iso
2.1 将CentOS-1804.iso挂载到/mnt
[root@master ~]# mount -o loop CentOS-1804.iso /mnt/
mount: /dev/loop0 is write-protected, mounting read-only
[root@master ~]# mkdir -p /opt/centos
[root@master ~]# cd /mnt/
[root@master mnt]# cp -rfv * /opt/centos/
2.2 将chinaskills_cloud_paas.iso挂载到/mnt
[root@master ~]# mount -o loop chinaskills_cloud_paas.iso /mnt/
mount: /dev/loop0 is write-protected, mounting read-only
2.3 配置master的yum
[root@master ~]# vi /etc/yum.repos.d/local.repo
[centos]
name=centos
baseurl=file:///opt/centos
enabled=1
gpgcheck=0
[k8s]
name=k8s
baseurl=file:///opt/kubernetes-repo
enabled=1
gpgcheck=0
2.4 安装ftp
[root@master ~]# yum -y install vsftpd
2.5 关闭selinux
[root@master ~]# setenforce 0
[root@master ~]# getenforce
2.6 进入opt执行
k8s_harbor_install.sh
k8s_image_push.sh
k8s_master_install.sh
2.7 查看
[root@master opt]# kubectl get nodes
[root@node-wh ~]# ssh master "kubectl get nodes"
本文来自博客园,作者:Cloudservice,转载请注明原文链接:https://www.cnblogs.com/whwh/p/16125938.html,只要学不死,就往死里学!