ubuntu20.0.4 安装kubesphere

Kubernetes 集群管理平台有openshift,rancher, kubesphere

值得一提kubesphere是国人开发的。今天以all in one的方式同时安装kubernetes和kubesphere

1. 参考文档

All-in-One Installation on Linux (kubesphere.io)

2. 裸机

操作系统ubuntu20.0.4, cpu 16核, 内存16g,硬盘300G

3. 首先安装各种依赖

sudo apt update

sudo apt install openssh-server openssh-client

sudo apt install curl socat conntrack ebtables ipset

4. 安装docker

Install Docker Engine on Ubuntu | Docker Documentation

sudo apt-get update

sudo apt-get install \    apt-transport-https \    ca-certificates \    curl \    gnupg \    lsb-release

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

echo \  "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

sudo apt-get update

sudo apt-get install docker-ce docker-ce-cli containerd.io


5. 国内安装

首先设置参数

export KKZONE=cn

然后执行

curl -sfL https://get-kk.kubesphere.io | VERSION=v1.0.1 sh -

6. 一些下载困难的软件

执行下面命令,如果出现无法下载

sudo ./kk create cluster --with-kubernetes v1.18.6 --with-kubesphere v3.0.0

如果无法下载helm,就从华为镜像手动下载

https://mirrors.huaweicloud.com/helm/v3.2.1/

然后把helm放到目录

/home/xxx/kubekey/v1.18.6/amd64

如果cni插件从github下载困难,则手动用fastgit加速

https://hub.fastgit.org/containernetworking/plugins/releases/tag/v0.8.6

不用解压,直接放到目录

/home/xxx/kubekey/v1.18.6/amd64

7. 继续执行

sudo ./kk create cluster --with-kubernetes v1.18.6 --with-kubesphere v3.0.0

执行完毕,如果出现无法访问8080端口,就继续执行一遍

8.安装成功

########################################################              Welcome to KubeSphere!          ########################################################Console: http://192.168.0.2:30880Account: adminPassword: P@88w0rdNOTES:  1. After logging into the console, please check the    monitoring status of service components in    the "Cluster Management". If any service is not    ready, please wait patiently until all components    are ready.  2. Please modify the default password after login.#####################################################https://kubesphere.io            20xx-xx-xx xx:xx:xx#####################################################


9. config kubectl 

the config file for kubectl is under $home/.kube

kubesphere config is under $home/kubekey

export KUBECONFIG=~/kubekey/config

把export命令加入到.bashrc文件中,然后source一下

10. 访问kubesphere

浏览器输入

http://localhost:30880

就可以访问了,成功了


你可能感兴趣的:(ubuntu20.0.4 安装kubesphere)