下载 KubeKey

KubeKey 是新一代 Kubernetes 和 KubeSphere 安装器,可帮助您以简单、快速、灵活的方式安装 Kubernetes 和 KubeSphere。

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

准备镜像

如果您想让安装加快或者您的机房没有外网,可以使用公司内部的私有仓库,预先把镜像推送到私有仓库中,我这里的仓库使用harbor

下载离线安装工具,我这里只是用这个脚本来下载和推送镜像

curl -L -O https://github.com/kubesphere/ks-installer/releases/download/v3.0.0/offline-installation-tool.sh
curl -L -O https://github.com/kubesphere/ks-installer/releases/download/v3.0.0/images-list.txt

拉取镜像

./offline-installation-tool.sh -s -l images-list.txt -d ./kubesphere-images
在./kubesphere-images目录下能看到以下压缩包
# ll
total 8606088
-rw-r--r-- 1 root root 454465957 Feb 2 15:37 csi-images.tar.gz
-rw-r--r-- 1 root root 1231853258 Feb 2 15:33 example-images.tar.gz
-rw-r--r-- 1 root root 445244294 Feb 2 14:50 istio-images.tar.gz
-rw-r--r-- 1 root root 762326634 Feb 2 14:27 k8s-images.tar.gz
-rw-r--r-- 1 root root 1297767607 Feb 2 14:40 ks-core-images.tar.gz
-rw-r--r-- 1 root root 3439146357 Feb 2 15:19 ks-devops-images.tar.gz
-rw-r--r-- 1 root root 733165078 Feb 2 14:46 ks-logging-images.tar.gz
-rw-r--r-- 1 root root 448651153 Feb 2 15:23 openpitrix-images.tar.gz

推送镜像到私有仓库,待脚本完成即可

./offline-installation-tool.sh -l images-list.txt -d ./kubesphere-images -r hub.evbj.easou.com

创建多节点集群

您可用使用 KubeKey 同时安装 Kubernetes 和 KubeSphere,通过自定义配置文件中的参数创建多节点集群。

创建安装有 KubeSphere 的 Kubernetes 集群(例如 --with-kubesphere v3.0.0)

./kk create config --with-kubernetes v1.17.9 --with-kubesphere v3.0.0

系统将创建默认的 config-sample.yaml 文件。您可以根据您的环境修改此文件。

apiVersion: kubekey.kubesphere.io/v1alpha1
kind: Cluster
metadata:
name: ESCloud
spec:
hosts:
- {name: kubesphere001, address: 10.26.31.34, internalAddress: 10.26.31.34, privateKeyPath: "~/.ssh/id_dsa", port: 20755}
- {name: kubesphere002, address: 10.26.31.36, internalAddress: 10.26.31.36, privateKeyPath: "~/.ssh/id_dsa", port: 20755}
- {name: kubesphere003, address: 10.26.31.42, internalAddress: 10.26.31.42, privateKeyPath: "~/.ssh/id_dsa", port: 20755}
- {name: kubesphere004, address: 10.26.31.46, internalAddress: 10.26.31.46, privateKeyPath: "~/.ssh/id_dsa", port: 20755}
- {name: kubesphere005, address: 10.26.31.118, internalAddress: 10.26.31.118, privateKeyPath: "~/.ssh/id_dsa", port: 20755}
- {name: kubesphere006, address: 10.26.31.119, internalAddress: 10.26.31.119, privateKeyPath: "~/.ssh/id_dsa", port: 20755}
- {name: kubesphere007, address: 10.26.31.120, internalAddress: 10.26.31.120, privateKeyPath: "~/.ssh/id_dsa", port: 20755}
- {name: kubesphere008, address: 10.26.31.121, internalAddress: 10.26.31.121, privateKeyPath: "~/.ssh/id_dsa", port: 20755}
roleGroups:
etcd:
- kubesphere001
- kubesphere002
- kubesphere003
master:
- kubesphere001
- kubesphere002
- kubesphere003
worker:
- kubesphere004
- kubesphere005
- kubesphere006
- kubesphere007
- kubesphere008
controlPlaneEndpoint:
domain: lb.kubesphere.local
address: ""
port: "6443"
kubernetes:
version: v1.17.9
imageRepo: kubesphere
clusterName: cluster.local
network:
plugin: calico
kubePodsCIDR: 10.233.64.0/18
kubeServiceCIDR: 10.233.0.0/18
registry:
registryMirrors: []
insecureRegistries: ["hub.kubeops.net"]
privateRegistry: "hub.kubeops.net"
addons: [] ---
apiVersion: installer.kubesphere.io/v1alpha1
kind: ClusterConfiguration
metadata:
name: ks-installer
namespace: kubesphere-system
labels:
version: v3.0.0
spec:
local_registry: "hub.kubeops.net"
persistence:
storageClass: ""
authentication:
jwtSecret: ""
etcd:
monitoring: true
endpointIps: localhost
port: 2379
tlsEnable: true
common:
es:
elasticsearchDataVolumeSize: 20Gi
elasticsearchMasterVolumeSize: 4Gi
elkPrefix: logstash
logMaxAge: 7
mysqlVolumeSize: 20Gi
minioVolumeSize: 20Gi
etcdVolumeSize: 20Gi
openldapVolumeSize: 2Gi
redisVolumSize: 2Gi
console:
enableMultiLogin: true # enable/disable multi login
port: 30880
alerting:
enabled: false
auditing:
enabled: false
devops:
enabled: false
jenkinsMemoryLim: 2Gi
jenkinsMemoryReq: 1500Mi
jenkinsVolumeSize: 8Gi
jenkinsJavaOpts_Xms: 512m
jenkinsJavaOpts_Xmx: 512m
jenkinsJavaOpts_MaxRAM: 2g
events:
enabled: false
ruler:
enabled: true
replicas: 2
logging:
enabled: false
logsidecarReplicas: 2
metrics_server:
enabled: true
monitoring:
prometheusMemoryRequest: 400Mi
prometheusVolumeSize: 20Gi
multicluster:
clusterRole: none # host | member | none
networkpolicy:
enabled: false
notification:
enabled: false
openpitrix:
enabled: false
servicemesh:
enabled: false

环境初始化

./kk init os -f config-sample.yaml
INFO[14:04:19 CST] Init operating system
INFO[14:04:20 CST] Start initializing kubesphere008 [10.26.31.121] node=10.26.31.121
INFO[14:04:20 CST] Start initializing kubesphere001 [10.26.31.34] node=10.26.31.34
INFO[14:04:20 CST] Start initializing kubesphere003 [10.26.31.42] node=10.26.31.42
INFO[14:04:20 CST] Start initializing kubesphere005 [10.26.31.118] node=10.26.31.118
INFO[14:04:20 CST] Start initializing kubesphere006 [10.26.31.119] node=10.26.31.119
INFO[14:04:20 CST] Start initializing kubesphere004 [10.26.31.46] node=10.26.31.46
INFO[14:04:20 CST] Start initializing kubesphere007 [10.26.31.120] node=10.26.31.120
INFO[14:04:20 CST] Start initializing kubesphere002 [10.26.31.36] node=10.26.31.36
INFO[14:06:34 CST] Complete initialization kubesphere005 [10.26.31.118] node=10.26.31.118
INFO[14:06:56 CST] Complete initialization kubesphere002 [10.26.31.36] node=10.26.31.36
INFO[14:07:04 CST] Complete initialization kubesphere006 [10.26.31.119] node=10.26.31.119
INFO[14:07:04 CST] Complete initialization kubesphere007 [10.26.31.120] node=10.26.31.120
INFO[14:07:07 CST] Complete initialization kubesphere003 [10.26.31.42] node=10.26.31.42
INFO[14:07:11 CST] Complete initialization kubesphere004 [10.26.31.46] node=10.26.31.46
INFO[14:08:23 CST] Complete initialization kubesphere001 [10.26.31.34] node=10.26.31.34
INFO[14:10:57 CST] Complete initialization kubesphere008 [10.26.31.121] node=10.26.31.121
INFO[14:10:57 CST] Init operating system successful.

部署

以上准备工作完成且再次检查配置文件无误后,执行安装。

./kk create cluster -f config-sample.yaml
+-------------------------+------+------+---------+----------+-------+-------+-----------+--------+------------+-------------+------------------+--------------+
| name | sudo | curl | openssl | ebtables | socat | ipset | conntrack | docker | nfs client | ceph client | glusterfs client | time |
+-------------------------+------+------+---------+----------+-------+-------+-----------+--------+------------+-------------+------------------+--------------+
| kubesphere005 | y | y | y | y | y | y | y | y | y | y | y | CST 14:16:55 |
| kubesphere006 | y | y | y | y | y | y | y | y | y | y | y | CST 14:16:55 |
| kubesphere007 | y | y | y | y | y | y | y | y | y | y | y | CST 14:16:55 |
| kubesphere004 | y | y | y | y | y | y | y | y | y | y | y | CST 14:16:55 |
| kubesphere001 | y | y | y | y | y | y | y | y | y | y | y | CST 14:16:55 |
| kubesphere003 | y | y | y | y | y | y | y | y | y | y | y | CST 14:16:55 |
| kubesphere002 | y | y | y | y | y | y | y | y | y | y | y | CST 14:16:55 |
| kubesphere008 | y | y | y | y | y | y | y | y | y | y | y | CST 14:16:55 |
+-------------------------+------+------+---------+----------+-------+-------+-----------+--------+------------+-------------+------------------+--------------+ This is a simple check of your environment.
Before installation, you should ensure that your machines meet all requirements specified at
https://github.com/kubesphere/kubekey#requirements-and-recommendations Continue this installation? [yes/no]: yes
INFO[14:17:25 CST] Downloading Installation Files
INFO[14:17:25 CST] Downloading kubeadm ... **************************************************
#####################################################
### Welcome to KubeSphere! ###
##################################################### Console: http://10.26.31.34:30880
Account: admin
Password: P@88w0rd NOTES:
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 2021-02-05 15:47:21
#####################################################

至此kubesphere安装成功,可以通过浏览器访问http://10.26.31.34:30880 验证

验证

您可以使用默认的帐户和密码 admin/P@88w0rd 登录 KubeSphere 控制台并开始使用 KubeSphere。请在登录后修改默认密码。

登录后如下图

现在就可以开始您的kubesphere之旅了,更多详情请参见官网

使用kubekey安装kubesphere的更多相关文章

  1. Centos 7.6 使用 kubekey 部署 kubesphere v3.1.0

    文章目录 主要功能 硬件要求 Kubernetes版本要求 配置主机之间的免密 安装所需依赖 下载KubeKey 创建Kubernetes集群以及KubeSphere kk命令使用方式 修改配置文件 ...

  2. 安装KubeSphere

    1. KubeSphere 是什么 1.1. 官方解释 KubeSphere是一个分布式操作系统,提供以Kubernetes为核心的云原生堆栈,旨在成为第三方应用程序的即插即用架构,以促进其生态系统的 ...

  3. 安装 KubeSphere DevOps 系统

    1.  安装KubeSphere 安装了一夜,终于看到了期待已久的画面 第一步.硬件配置(PS:VirtualBox虚拟机): 操作系统:Ubuntu 18.04 CPU:4核 内存:8G 磁盘:60 ...

  4. K8S安装Kubesphere

    准备工作 安装Helm curl -L https://git.io/get_helm.sh | bash 创建账户 cat > heml-rbac.yaml << EOF apiV ...

  5. 【葵花宝典】All-in-One模式安装KubeSphere

    1.准备 Linux 机器 2.google api受限下载 KubeKey export KKZONE=cn curl -sfL https://get-kk.kubesphere.io | VER ...

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

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

  7. [转帖]Kubesphere all-in-one 安装方式.

    All-in-One 模式 对于首次接触 KubeSphere 高级版的用户,想寻找一个最快安装和体验 KubeSphere 高级版核心功能的方式,all-in-one 模式支持一键安装 KubeSp ...

  8. KubeSphere单节点(all-in-one)平台搭建记录

    KubeSphere单节点(all-in-one)平台搭建记录 目录 KubeSphere单节点(all-in-one)平台搭建记录 一.主机准备 1.1 主机配置 1.2 环境准备 二.下载kube ...

  9. Kubernetes Dashboard 终结者:KubeSphere

    原文链接:Kubernetes Dashboard 终结者:KubeSphere 2018 年 7 月份,青云在 Cloud Insight 云计算峰会上推出了一款全新的容器平台--KubeSpher ...

随机推荐

  1. EasyPoi中@Excel注解中numFormat的使用

    需求说明:使用EasyPoi时导出文件中折扣字段是小数,被测试同学提了一个bug,需要转成百分数导出. 个人觉得应该转百分号只要在@Excel注解里面加个属性即可,但是在网上的easypoi教程中没有 ...

  2. Mirai框架qq机器人教程 新版

    Mirai框架qq机器人教程 新版 前言 资料列表 1.准备 i. 配置java环境 ii. 配置IDE iii. 下载mirai-console-loader(mcl)作为启动器 2.创建mirai ...

  3. NOIP初赛篇——09原码、反码和补码

    一.数的原码.补码和反码表示 机器数和真值 ​ 在计算机中,表示数值的数字符号只有0和1两个数码,我们规定最高位为符号位,并用0表示正符号,用1表示负符号.这样,机器中的数值和符号全"数码化 ...

  4. Vue 组件内滚动条 滚到到底部

    因为在vue中,某个组件内 使用scrollTop赋值 滚动条没有变化 使用scrollTo 也不行(window.scorllTo 或者dom.scrollTo) 所以可以考虑使用投机取巧的办法: ...

  5. 【MyBatis】自定义 MyBatis

    自定义 MyBatis 文章源码 执行查询信息的分析 我们知道,MyBatis 在使用代理 DAO 的方式实现增删改查时只做两件事: 创建代理对象 在代理对象中调用 selectList() 配置信息 ...

  6. 【SpringMVC】SpringMVC 实现文件上传

    SpringMVC 实现文件上传 文章源码 文件上传回顾 查看 JavaWeb 阶段的文件上传下载 实现步骤: 客户端: 发送 post 请求,告诉服务器要上传什么文件 服务器: 要有一个 form ...

  7. Linux find 命令的初步实现(C++)

    Implement a myfind command following the find command in UNIX operating system. The myfind command s ...

  8. 【windows】快捷键

    Ctrl+字母键 1.Ctrl+A:全选 2.Ctrl+C:复制选择的项目 3.Ctrl+E:选择搜索框 4.Ctrl+F:选择搜索框 5.Ctrl+N:创建新的项目 6.Ctrl+W:关闭当前窗口 ...

  9. 分布式系统:分布式任务调度xxl-job较深入使用

    目录 系统关键概念介绍 执行器 任务 任务配置项描述 阻塞策略 路由策略 日志问题 客户端日志 服务端日志 框架目前发现的缺点以及存在的问题 xxl-job是一个分布式定时任务调度框架,功能强大,底层 ...

  10. CTS相关的几个表

    TMSALOG/TMSALOGAR :STMS传输日志表 TMSCNFS:传输组 TMSCDOM:传输域 TMSCDES:传输目的地 TMSBUFTXT:传输请求的短文本和用户 TMSCSYS:tms ...