rancher使用方法
rancher
rancher是一个web界面管理k8s集群的工具,可以通过在web界面点点就可以实现所要的资源。
官网:https://ranchermanager.docs.rancher.com
安装docker
curl -o /etc/yum.repos.d/Centos-7.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo
systemctl stop firewalld && systemctl disable firewalld
sed -ri 's#(SELINUX=).*#\1disabled#' /etc/selinux/config
setenforce 0
getenforce 0
swapoff -a
#关闭开机启动
sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab
yum install chrony -y
sed -i.bak "s@server@#server@g" /etc/chrony.conf
sed -i "6aserver ntp.aliyun.com iburst" /etc/chrony.conf
systemctl start chronyd &&systemctl status chronyd
modprobe br_netfilter
cat > /etc/sysctl.d/docker.conf <<EOF
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward = 1
EOF
#配置阿里源
yum remove docker docker-common docker-selinux docker-engine -y
wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum install docker-ce docker-compose -y
mkdir -p /etc/docker
cat > /etc/docker/daemon.json <<EOF
{
"registry-mirrors":["https://rsbud4vc.mirror.aliyuncs.com","https://registry.docker-cn.com","https://docker.mirrors.ustc.edu.cn","https://dockerhub.azk8s.cn","http://hub-mirror.c.163.com"]
}
EOF
sudo systemctl daemon-reload &&sudo systemctl restart docker && systemctl enable docker && systemctl status docker
docker info |grep version
安装rancher
docker run --privileged -d --restart=unless-stopped -p 80:80 -p 443:443 rancher/rancher:v2.7.3
加入集群
#重置密码
https://ranchermanager.docs.rancher.com/zh/faq/technical-items#如何重置管理员密码
$ docker exec -ti <container_id> reset-password
New password for default administrator (user-xxxxx):
<new_password>
curl --insecure -sfL https://192.168.199.190/v3/import/jg59m2626l2cqj4sk75qcntgrp2zkjc2qkd2h2gd6xjlpkrtvlpmk5_c-m-n8t8f2wd.yaml | kubectl apply -f -








浙公网安备 33010602011771号