安装KubeSphere最好的方法就是参考官方文档,而且官方文档是中文的。

官网地址:https://kubesphere.com.cn/

https://github.com/kubesphere/kubesphere/blob/master/README_zh.md

Kubernetes(K8S) kubesphere 介绍

安装提前条件:

使用 Kubeadm 部署 Kubernetes(K8S) 安装--附K8S架构图

使用 Kubeadm 部署 Kubernetes(K8S) 安装 -- 持久化存储(NFS网络存储)

Kubernetes(K8S) 安装 Metrics-Server

# 检查 K8S 版本,低版本需要升级
[root@k8smaster kubesphere]# kubectl version

安装

[root@k8smaster ~]# cd /opt/k8s/kubesphere
# 创建文件storageclass.yaml
[root@k8smaster kubesphere]# vi storageclass.yaml
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: local-storage
provisioner: kubernetes.io/no-provisioner
volumeBindingMode: WaitForFirstConsumer # persistentVolumeClaim.yaml
[root@k8smaster kubesphere]# vi persistentVolumeClaim.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: local-pve
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi
storageClassName: local-storage # 下载核心文件(可以讯雷下载好传到 服务器)
[root@k8smaster kubesphere]# wget https://github.com/kubesphere/ks-installer/releases/download/v3.1.1/kubesphere-installer.yaml
[root@k8smaster kubesphere]# wget https://github.com/kubesphere/ks-installer/releases/download/v3.1.1/cluster-configuration.yaml
[root@k8smaster kubesphere]# ll
总用量 12
-rwxrwxrwx 1 root root 7663 4月 23 09:41 cluster-configuration.yaml
-rwxrwxrwx 1 root root 4064 4月 23 09:41 kubesphere-installer.yaml # 安装
[root@k8smaster kubesphere]# kubectl apply -f storageclass.yaml
storageclass.storage.k8s.io/local-storage created
[root@k8smaster kubesphere]# kubectl apply -f persistentVolumeClaim.yaml
persistentvolumeclaim/local-pve created [root@k8smaster kubesphere]# kubectl apply -f kubesphere-installer.yaml
customresourcedefinition.apiextensions.k8s.io/clusterconfigurations.installer.kubesphere.io created
namespace/kubesphere-system created
serviceaccount/ks-installer created
clusterrole.rbac.authorization.k8s.io/ks-installer created
clusterrolebinding.rbac.authorization.k8s.io/ks-installer created
deployment.apps/ks-installer created [root@k8smaster kubesphere]# kubectl apply -f cluster-configuration.yaml
clusterconfiguration.installer.kubesphere.io/ks-installer created #解决找不到证书的问题
[root@k8smaster kubesphere]# kubectl -n kubesphere-system create secret generic kube-etcd-client-certs --from-file=etcd-client-ca.crt=/etc/kubernetes/pki/etcd/ca.crt --from-file=etcd-client.crt=/etc/kubernetes/pki/apiserver-etcd-client.crt --from-file=etcd-client.key=/etc/kubernetes/pki/apiserver-etcd-client.key
secret/kube-etcd-client-certs created # 查看 POD 详情
[root@k8smaster kubesphere]# kubectl describe pod -n kubesphere-system
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 12m default-scheduler Successfully assigned kubesphere-system/ks-installer-7bd6b699df-9lnlc to k8snode1
Normal Pulling 12m kubelet Pulling image "kubesphere/ks-installer:v3.1.1"
Normal Pulled 11m kubelet Successfully pulled image "kubesphere/ks-installer:v3.1.1"
Normal Created 11m kubelet Created container installer
Normal Started 11m kubelet Started container installer
[root@k8smaster kubesphere]# # 使用命令查看进度
[root@k8smaster kubesphere]# kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f

如果出现下面错误,需要安装 storageclass、persistentVolumeClaim

TASK [preinstall : KubeSphere | Stopping if default StorageClass was not found] ***
fatal: [localhost]: FAILED! => {
"assertion": "\"(default)\" in default_storage_class_check.stdout",
"changed": false,
"evaluated_to": false,
"msg": "Default StorageClass was not found !"
}
# 删除
[root@k8smaster kubesphere]# kubectl delete -f kubesphere-installer.yaml
[root@k8smaster kubesphere]# kubectl delete -f cluster-configuration.yaml
# 安装完 storageclass 后,重新安装
[root@k8smaster kubesphere]# kubectl apply -f storageclass.yaml
[root@k8smaster kubesphere]# kubectl apply -f persistentVolumeClaim.yaml
[root@k8smaster kubesphere]# kubectl apply -f kubesphere-installer.yaml
[root@k8smaster kubesphere]# kubectl apply -f cluster-configuration.yaml

Kubernetes(K8S) kubesphere 安装的更多相关文章

  1. Kubernetes(k8s)完整安装教程

    Kubernetes(k8s)完整安装教程  2019-08-27 2.3k 记录 发表评论 目录 1 安装 1.1 安装 Docker 1.2 安装 VirtualBox 1.3 安装 kubect ...

  2. ubuntu16.04 docker kubernetes(k8s) istio 安装

    版本: docker: 19.03.5 kubernetes: 1.17.0 istio: 1.4.3 步骤一:给ubuntu换源 https://www.cnblogs.com/lfri/p/106 ...

  3. kubernetes(k8s) helm安装kafka、zookeeper

    通过helm在k8s上部署kafka.zookeeper 通过helm方法安装 k8s上安装kafka,可以使用helm,将kafka作为一个应用安装.当然这首先要你的k8s支持使用helm安装.he ...

  4. K8S kubesphere安装mysql

    原先我们使用Docker按照mysql时候的命令 docker run -p 3306:3306 --name mysql-01 \ -v /mydata/mysql/log:/var/log/mys ...

  5. 从零搭建云原生技术kubernetes(K8S)环境-通过kubesPhere的AllInOne方式

    前言 k8s云原生搭建,步骤有点多,但通过kubesphere,可以快速搭建k8s环境,同时有一个以 Kubernetes 为内核的云原生分布式操作系统-kubesphere,本文将从零开始进行kub ...

  6. Windows玩转Kubernetes系列3-Centos安装K8S

    以往文章参考: Windows玩转Kubernetes系列1-VirtualBox安装Centos Windows玩转Kubernetes系列2-Centos安装Docker 安装K8S yum in ...

  7. Centos7 安装部署Kubernetes(k8s)集群

    目录 一.系统环境 二.前言 三.Kubernetes 3.1 概述 3.2 Kubernetes 组件 3.2.1 控制平面组件 3.2.2 Node组件 四.安装部署Kubernetes集群 4. ...

  8. Istio(二):在Kubernetes(k8s)集群上安装部署istio1.14

    目录 一.模块概览 二.系统环境 三.安装istio 3.1 使用 Istioctl 安装 3.2 使用 Istio Operator 安装 3.3 生产部署情况如何? 3.4 平台安装指南 四.Ge ...

  9. 使用k8s operator安装和维护etcd集群

    关于Kubernetes Operator这个新生事物,可以参考下文来了解这一技术的来龙去脉: https://yq.aliyun.com/articles/685522?utm_content=g_ ...

  10. 深入剖析Kubernetes k8s

    深入剖析Kubernetes k8s 毫无疑问,Kubernetes 已经成为容器领域当之无愧的事实标准.除了 Google.Microsoft 等技术巨擘们在容器领域里多年的博弈外,国内的 BAT. ...

随机推荐

  1. 【原创】freetype android交叉编译

    项目中Opencv需要显示中文,由于本身并不支持,所以需要借助第三方的库freetype来实现.这个库虽然android本身也有使用,但并没有暴露接口给外部使用. freetype官网 方式1 脚本编 ...

  2. 【原创】GmSSL Linux编译, 环境搭建

    编译环境: wsl ubuntu 20.04 GmSSL Project 算法相关原理文档 由于GmSSL继承自openssl, 为了防止和openssl冲突,最好将GmsSL 编译为静态库 在Lin ...

  3. 功能测试--Fiddler

    Fiddler(更推荐Charles,很好用) 1.fiddler是什么?------客户端的所有请求都要先经过fiddler,然后转发到服务器:反之,服务器的所有响应,也会先经过fiddler,然后 ...

  4. 创建function函数sys_guid时报错

    创建function函数sys_guid时报错 执行下面的命令 show variables like 'log_bin_trust_function_creators';set global log ...

  5. HTML笔记(二) HTML标签元素

    一 常用的头部元素标签 <head>元素包含了所有的头部标签元素. 1.<title> <title>标签定义了HTML文档的标题,在HTML/XHTML文档中是必 ...

  6. 转载C#文件下载的实现

    一.//TransmitFile实现下载     protected void Button1_Click(object sender, EventArgs e)    {        /*     ...

  7. mysql-单行处理函数

    1 单行处理函数 lower() 对于输出转换成小写 upper()对于输出转换成大写 substr()取子字符串 下标从1开始 length() 去长度 concat()将字符串进行拼接 例:将首字 ...

  8. layui tree 未命名 所遇到的坑

    由于传入类型不对,需要传入object类型,我传入的是String类型,所以出现了 一堆未命名, 在控制台输出查看,是一模一样的,困扰了我一下午,再次感谢老哥 参考自:https://www.cnbl ...

  9. Java8-聚合操作

    Java聚合操作(Aggregate Operations)是对一堆数据进行处理的新的操作方法,我们知道,如果想对一堆数据进行处理,比如一个List对象中的数据进行处理,传统的操作就是遍历List数据 ...

  10. DRF的序列化器Serializer

    一 序列化器的作用 1. 序列化,序列化器会把模型对象转换成字典,经过视图中response对象以后变成json字符串 2. 反序列化,视图中request会把客户端发送过来的数据转换成字典,序列化器 ...