安装环境准备
1.关闭防火墙 selinux
2.查看关闭swap分区
echo "vm.swappiness=0" >> /etc/sysctl.conf
swapoff -a
sed -i 's$/dev/mapper/centos-swap$#/dev/mapper/centos-swap$g ' /etc/fstab
3.安装依赖组件
yum install ebtables socat ipset conntrack -y
4.安装docker
yum install yum-utils -y
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum makecache
yum install docker-ce-18.09.9-3.el7 docker-ce-cli-18.09.9 -y
systemctl enable docker
systemctl start docker
docker version
配置镜像加速器
tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://w0637fe0.mirror.aliyuncs.com"]
}
EOF
systemctl restart docker
5.同步时间
ntpdate ntp1.aliyun.com
部署kubevsphere-kubernetes
1.配置kubernetes-yum源
cat > /etc/yum.repos.d/kubernetes.repo << EOF
> [kubernetes]
> name=Kubernetes
> baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64
> enabled=1
> gpgcheck=0
> repo_gpgcheck=0
> gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
> EOF
yum makecache
2.安装kubelet、kubectl
yum install kubelet-1.17.9 kubectl-1.17.9 -y
3.同时安装 Kubernetes和KubeSphere
curl -sfL https://get-kk.kubesphere.io | VERSION=v1.0.1 sh -
chmod +x kk
./kk create cluster --with-kubernetes v1.17.9 --with-kubesphere v3.0.0
4.输入以下命令以检查安装结果
kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f
评论区