安装单机版KubeSphere
### kubesphere ## 在linux上安装Kubernetes和KubeSphere ## 关闭防火墙或者开放必要的[防火墙端口] systemctl disable firewalld systemctl stop firewalld systemctl status firewalld ## 查看并关闭swap分区 swapoff -a echo "vm.swappiness=0" >> /etc/sysctl.conf sysctl -p /etc/sysctl.conf sed -i 's$/dev/mapper/centos-swap$#/dev/mapper/centos-swap$g' /etc/fstab free -m ## 查看Selinux状态 getenforce ## 安装依赖组件 yum install -y ebtables socat ipset conntrack ## 安装docker yum install -y yum-utils yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo yum makecache fast yum -y install docker-ce-18.09.9-3.el7 docker-ce-cli-18.09.9 ## 启动docker systemctl enable docker && systemctl start docker systemctl status docker ## 设置docker镜像加速器 vim /etc/docker/daemon.json { "registry-mirrors":["https://gqk8w9va.mirror.aliyuncs.com"] } ## 重启docker使配置生效 systemctl restart docker docker info|grep "Registry Mirrors" -A 1 ## 检查DNS设置 cat /etc/resolv.conf ## 设置kubernetes仓库 vi /etc/yum.repos.d/kubernetes.repo [kubernetes] name=Kubernetes baseurl=http://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64 enabled=1 gpgcheck=0 repo_gpgcheck=0 gpgkey=http://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg http://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg yum makecache fast ## 安装kubelet和kubectl yum install -y kubelet-1.17.9 kubectl-1.17.9 ## 下载kubekey yum install -y wget #需要谷歌 wget -c https://kubesphere.io/download/kubekey-v1.0.0-linux-amd64.tar.gz -O - | tar -xz --2020-09-26 23:45:18-- https://kubesphere.io/download/kubekey-v1.0.0-linux-amd64.tar.gz #不需要谷歌 export KKZONE=cn curl -sfL https://get-kk.kubesphere.io | VERSION=v1.1.1 sh - chmod +x kk ## 开始安装 ## 使用kubekey安装kubernetes(默认v1.17.9)和kubesphere(默认v3.0.0) ./kk create cluster --with-kubernetes v1.17.9 --with-kubesphere v3.0.0 ## 检查安装 kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f
官方教程:https://v3-1.docs.kubesphere.io/zh/docs/quick-start/all-in-one-on-linux/