rancher2安装部署k8s和harbor仓库
系统基本配置关闭防火墙systemctl stop firewalld&&systemctl disable firewalld关闭selinuxsetenforce 0&&sed -i ‘s/enforcing/disabled/’ /etc/selinux/config关闭swapswapoff -a&&sed -ri ‘s/.swap./#&a
系统基本配置
关闭防火墙 systemctl stop firewalld&&systemctl disable firewalld
关闭selinux setenforce 0&&sed -i ‘s/enforcing/disabled/’ /etc/selinux/config
关闭swap swapoff -a&&sed -ri ‘s/.swap./#&/’ /etc/fstab
修改主机名 hostnamectl set-hostname xxxxx
添加hosts 192.168.1.211 k8s-01
192.168.1.212 k8s-02
192.168.1.213 k8s-03
192.168.1.213 k8s-03
更新yum阿里云的源和更新yum
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum makecache
yum update -y
安装docker-ce
yum install epel-release -y
yum install yum-utils -y
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum makecache
yum install docker-ce -y
systemctl start docker
systemctl enable docker
安装rancher2
mkdir -p /usr/local/rancher/rancher && mkdir -p /usr/local/rancher/auditlog
sudo docker run -d --restart=unless-stopped -p 9090:80 -p 9443:443 -v /usr/local/rancher/rancher:/var/lib/rancher
-v /usr/local/rancher/auditlog:/var/log/auditlog
–name rancher rancher/rancher:sta
安装harbor
1、需要安装docker并运行
2、需要安装docker-compose
yum install docker-compose -y
3、下载地址
https://github.com/goharbor/harbor/releases
4、解压并进入目录,拷贝一份配置文件
cp harbor.yml.tmpl harbor.yml
5、编辑配置文件
hostname: 10.10.9.118 修改为自己主机的ip
内网使用注释掉https段
data_volume: /harbordata 设置一个自己能看懂的目录
6、安装harbor
./prepare 应用配置文件
./install.sh 启动相对应的7个容器
在Rancher上疏散该节点
删除节点
登录该节点宿主机,删除rancher相关容器
docker rm -f -v $(docker ps -aq)
删除该节点的所有volume
docker volume rm $(docker volume ls)
最后删除/var/lib/rancher文件夹
更多推荐
所有评论(0)