欢迎来到CloudService文涵的博客

人生三从境界:昨夜西风凋碧树,独上高楼,望尽天涯路。 衣带渐宽终不悔,为伊消得人憔悴。 众里寻他千百度,蓦然回首,那人却在灯火阑珊处。

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"
posted on 2022-04-10 14:58  Cloudservice  阅读(813)  评论(0编辑  收藏  举报