随着多云多集群的场景越来越丰富,在各个云厂商环境部署 KubeSphere 的需求随之升高。由于各云厂商的云资源使用规则和菜单导航栏各不相同,会使用户花大量时间去排错。为降低部署过程错误率,本教程使用华为云平台部署一套高可用的 KubeSphere,希望可以帮助到大家提高部署体验。

一、部署前期准备

所需环境的资源满足以下条件即可:

华为云产品 数量 用途 备注
ECS 云服务器 6 master、node
VPC 1 可用区
ELB 2 负载均衡
安全组 1 出入口管控
公网 IP 7 外网访问

二、云平台资源初始化

1.创建 VPC

进入到华为云控制, 在左侧列表选择「虚拟私有云」, 选择「创建虚拟私有云」 创建 VPC,配置如下图:

2.创建安全组

创建一个安全组,设置入方向的规则、关联实例参考如下:

3.创建实例

在网络配置中,网络选择第一步创建的 VPC 和子网。在安全组中,选择上一步创建的安全组。

4.创建负载均衡器(创建内外两个)

内网 ELB:

外网 ELB:

若集群需要配置公网访问,则需要为外网负载均衡器配置一个公网 IP 为 所有节点 添加后端监听器,监听端口为 80(测试使用 30880 端口,此处 80 端口也需要在安全组中开放)。

后面配置文件 config.yaml 需要配置在前面创建的 内网 SLB 分配的地址(VIP)

 controlPlaneEndpoint:
domain: lb.kubesphere.local
address: "192.168.0.205"
port: "6443"

部署 KubeSphere 平台

1.下载 KK

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

2.添加执行权限

$ chmod +x kk

3.使用 kubekey 部署

$ ./kk create config --with-kubesphere v3.1.1 --with-kubernetes v1.17.9 -f master-HA.yaml

4.集群配置调整

apiVersion: kubekey.kubesphere.io/v1alpha1
kind: Cluster
metadata:
name: master-HA
spec:
hosts:
- {name: master1, address: 192.168.1.10, internalAddress: 192.168.1.10, password: yourpassword} # Assume that the default port for SSH is 22, otherwise add the port number after the IP address as above
- {name: master2, address: 192.168.1.11, internalAddress: 192.168.1.11, password: yourpassword} # Assume that the default port for SSH is 22, otherwise add the port number after the IP address as above
- {name: master3, address: 192.168.1.12, internalAddress: 192.168.1.12, password: yourpassword} # Assume that the default port for SSH is 22, otherwise add the port number after the IP address as above
- {name: node1, address: 192.168.1.13, internalAddress: 192.168.1.13, password: yourpassword} # Assume that the default port for SSH is 22, otherwise add the port number after the IP address as above
- {name: node2, address: 192.168.1.14, internalAddress: 192.168.1.14, password: yourpassword} # Assume that the default port for SSH is 22SSH is 22, otherwise add the port number after the IP address as above
- {name: node3, address: 192.168.1.15, internalAddress: 192.168.1.15, password: yourpassword} # Assume that the default port for SSH is 22, otherwise add the port number after the IP address as above
roleGroups:
etcd:
- master[1:3]
master:
- master[1:3]
worker:
- node[1:3]
controlPlaneEndpoint:
domain: lb.kubesphere.local
address: "192.168.1.8"
port: "6443"
kubernetes:
version: v1.17.9
imageRepo: kubesphere
clusterName: cluster.local
masqueradeAll: false # masqueradeAll tells kube-proxy to SNAT everything if using the pure iptables proxy mode. [Default: false]
maxPods: 110 # maxPods is the number of pods that can run on this Kubelet. [Default: 110]
nodeCidrMaskSize: 24 # internal network node size allocation. This is the size allocated to each node on your network. [Default: 24]
proxyMode: ipvs # mode specifies which proxy mode to use. [Default: ipvs]
network:
plugin: calico
calico:
ipipMode: Always # IPIP Mode to use for the IPv4 POOL created at start up. If set to a value other than Never, vxlanMode should be set to "Never". [Always | CrossSubnet | Never] [Default: Always]
vxlanMode: Never # VXLAN Mode to use for the IPv4 POOL created at start up. If set to a value other than Never, ipipMode should be set to "Never". [Always | CrossSubnet | Never] [Default: Never]
vethMTU: 1440 # The maximum transmission unit (MTU) setting determines the largest packet size that can be transmitted through your network. [Default: 1440]
kubePodsCIDR: 10.233.64.0/18
kubeServiceCIDR: 10.233.0.0/18
registry:
registryMirrors: ["https://*.mirror.aliyuncs.com"] # # input your registryMirrors
insecureRegistries: []
privateRegistry: ""
storage:
defaultStorageClass: localVolume
localVolume:
storageClassName: local ---
apiVersion: installer.kubesphere.io/v1alpha1
kind: ClusterConfiguration
metadata:
name: ks-installer
namespace: kubesphere-system
labels:
version: v3.1.1
spec:
local_registry: ""
persistence:
storageClass: ""
authentication:
jwtSecret: ""
etcd:
monitoring: true # Whether to install etcd monitoring dashboard
endpointIps: 192.168.1.10,192.168.1.11,192.168.1.12 # etcd cluster endpointIps
port: 2379 # etcd port
tlsEnable: true
common:
mysqlVolumeSize: 20Gi # MySQL PVC size
minioVolumeSize: 20Gi # Minio PVC size
etcdVolumeSize: 20Gi # etcd PVC size
openldapVolumeSize: 2Gi # openldap PVC size
redisVolumSize: 2Gi # Redis PVC size
es: # Storage backend for logging, tracing, events and auditing.
elasticsearchMasterReplicas: 1 # total number of master nodes, it's not allowed to use even number
elasticsearchDataReplicas: 1 # total number of data nodes
elasticsearchMasterVolumeSize: 4Gi # Volume size of Elasticsearch master nodes
elasticsearchDataVolumeSize: 20Gi # Volume size of Elasticsearch data nodes
logMaxAge: 7 # Log retention time in built-in Elasticsearch, it is 7 days by default.
elkPrefix: logstash # The string making up index names. The index name will be formatted as ks-<elk_prefix>-log
# externalElasticsearchUrl:
# externalElasticsearchPort:
console:
enableMultiLogin: false # enable/disable multiple sing on, it allows an account can be used by different users at the same time.
port: 30880
alerting: # Whether to install KubeSphere alerting system. It enables Users to customize alerting policies to send messages to receivers in time with different time intervals and alerting levels to choose from.
enabled: true
auditing: # Whether to install KubeSphere audit log system. It provides a security-relevant chronological set of records,recording the sequence of activities happened in platform, initiated by different tenants.
enabled: true
devops: # Whether to install KubeSphere DevOps System. It provides out-of-box CI/CD system based on Jenkins, and automated workflow tools including Source-to-Image & Binary-to-Image
enabled: true
jenkinsMemoryLim: 2Gi # Jenkins memory limit
jenkinsMemoryReq: 1500Mi # Jenkins memory request
jenkinsVolumeSize: 8Gi # Jenkins volume size
jenkinsJavaOpts_Xms: 512m # The following three fields are JVM parameters
jenkinsJavaOpts_Xmx: 512m
jenkinsJavaOpts_MaxRAM: 2g
events: # Whether to install KubeSphere events system. It provides a graphical web console for Kubernetes Events exporting, filtering and alerting in multi-tenant Kubernetes clusters.
enabled: true
logging: # Whether to install KubeSphere logging system. Flexible logging functions are provided for log query, collection and management in a unified console. Additional log collectors can be added, such as Elasticsearch, Kafka and Fluentd.
enabled: true
logsidecarReplicas: 2
metrics_server: # Whether to install metrics-server. IT enables HPA (Horizontal Pod Autoscaler).
enabled: true
monitoring: #
prometheusReplicas: 1 # Prometheus replicas are responsible for monitoring different segments of data source and provide high availability as well.
prometheusMemoryRequest: 400Mi # Prometheus request memory
prometheusVolumeSize: 20Gi # Prometheus PVC size
alertmanagerReplicas: 1 # AlertManager Replicas
multicluster:
clusterRole: none # host | member | none # You can install a solo cluster, or specify it as the role of host or member cluster
networkpolicy: # Network policies allow network isolation within the same cluster, which means firewalls can be set up between certain instances (Pods).
enabled: true
notification: # It supports notification management in multi-tenant Kubernetes clusters. It allows you to set AlertManager as its sender, and receivers include Email, Wechat Work, and Slack.
enabled: true
openpitrix: # Whether to install KubeSphere App Store. It provides an application store for Helm-based applications, and offer application lifecycle management
enabled: true
servicemesh: # Whether to install KubeSphere Service Mesh (Istio-based). It provides fine-grained traffic management, observability and tracing, and offer visualization for traffic topology
enabled: true

5.执行命令创建集群

# 指定配置文件创建集群
$ ./kk create cluster --with-kubesphere v3.1.1 -f master-HA.yaml # 查看 KubeSphere 安装日志 -- 直到出现控制台的访问地址和登录帐户
$ kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f
#####################################################
### Welcome to KubeSphere! ###
##################################################### Console: http://192.168.1.10:30880
Account: admin
Password: P@88w0rd NOTES:
1. After you log 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 up and running.
2. Please change the default password after login. #####################################################
https://kubesphere.io 2020-08-28 01:25:54
#####################################################

访问公网 IP + Port 为部署后的使用情况,使用默认帐户密码 (admin/P@88w0rd),文章组件安装为最大化,登录点击平台管理>集群管理可看到下图安装组件列表和机器情况。在集群概述页面中,可以看到如下图所示的仪表板。

本文由博客一文多发平台 OpenWrite 发布!

在华为云上安装高可用 KubeSphere的更多相关文章

  1. K3S系列文章-使用AutoK3s在腾讯云上安装高可用K3S集群

    开篇 <K3s 系列文章> <Rancher 系列文章> 方案 在腾讯云上安装 K3S 后续会在这套 K3S 集群上安装 Rancher 方案目标 高可用 3 台master ...

  2. 华为云:实现高可用的负载均衡web集群

    华为云: 2台云主机做负载均衡调度 >>申请一个虚拟浮动ip,并绑定一个弹性公网ip >>将两台云主机绑定到虚拟浮动ip上 3台web服务器 1台云服务器做jumpserver ...

  3. 利用ansible书写playbook在华为云上批量配置管理工具自动化安装ceph集群

    首先在华为云上购买搭建ceph集群所需云主机: 然后购买ceph所需存储磁盘 将购买的磁盘挂载到用来搭建ceph的云主机上 在跳板机上安装ansible 查看ansible版本,检验ansible是否 ...

  4. 企业运维实践-还不会部署高可用的kubernetes集群?使用kubeadm方式安装高可用k8s集群v1.23.7

    关注「WeiyiGeek」公众号 设为「特别关注」每天带你玩转网络安全运维.应用开发.物联网IOT学习! 希望各位看友[关注.点赞.评论.收藏.投币],助力每一个梦想. 文章目录: 0x00 前言简述 ...

  5. kubernetes实战(二十五):kubeadm 安装 高可用 k8s v1.13.x

    1.系统环境 使用kubeadm安装高可用k8s v.13.x较为简单,相比以往的版本省去了很多步骤. kubeadm安装高可用k8s v.11 和 v1.12 点我 主机信息 主机名 IP地址 说明 ...

  6. 如何在腾讯云上安装Cloud Foundry

    Cloud Foundry是VMware推出的业界第一个开源PaaS云平台,它支持多种框架.语言.运行时环境.云平台及应用服务,使开发人员能够在几秒钟内进行应用程序的部署和扩展,无需担心任何基础架构的 ...

  7. Azure 上的高可用概念

    更多内容,添加公众号关注: 场景一: 某智能家居厂家,用户喊出“小X同学,帮我扫地”后,服务器宕机了,扫地机器人不能立即启动,于是,用户可能再连续喊几次后,无奈又习惯的按下了扫地机器人的启动按钮. 场 ...

  8. 亚马逊AWS在线系列讲座——基于AWS云平台的高可用应用设计

    设计高可用的应用是架构师的一个重要目标,可是基于云计算平台设计高可用应用与基于传统平台的设计有很多不同.云计算在给架构师带来了很多新的设计挑战的时候,也给带来了很多新的设计理念和可用的服务.怎样在设计 ...

  9. 代码迁移到华为云上和Git的坑

    代码迁移到华为云上和Git的坑 先设置小乌龟Git上方式为ssh 参考链接:https://www.liangzl.com/get-article-detail-3586.html 注意:Tortoi ...

  10. 每天响应数亿次请求,腾讯云如何提供高可用API服务?

    每天响应数亿次请求,腾讯云如何提供高可用API服务? https://mp.weixin.qq.com/s/OPwlHcqkaTT_gcwHfr5Shw 李阳 云加社区 2020-09-16 导语 | ...

随机推荐

  1. python画图报错:OSError: 'seaborn-whitegrid' is not a valid package style

    解决方法: https://stackoverflow.com/questions/78019854/matplotlib-seaborn-whitegrid-is-not-a-valid-packa ...

  2. 由于美国的制程限制,假如我国的同等性能的AI芯片5年内无法实现量产化我们应该如何发展我们的AI领域的基础设施呢?

    相关: 美晶片禁令面難題!封過頭反把市場送中國? 今年华为公司推出了mate pro60手机,可以说我们可以实现7nm芯片的制造了,但是要注意,我们在实现7nm芯片制造的时候使用的应该依旧是被美国限制 ...

  3. 决定了,今日起开始准备弃用京东JD

    估计京东是为了节约开支,然后开始大比例的把快递物流业务进行外包了,这直接导致服务质量的直线下滑,10多年前我选择弃用当当网而选择京东JD就是因为当时当地的当当网快递是用沈阳晚报的快递上门的,快递员连P ...

  4. 为什么使用服务器CPU运算Tensorflow、Pytorch代码会导致近百个逻辑核心的CPU使用率高达100%呢

    2022年11月10日更新 本文所提问题与CPU的向量计算(simd)关系并不大,主要原因就是CPU多线程并行计算所导致的.不过CPU的SIMD导致CPU功耗大幅度上升并且导致CPU降频运行也确实会影 ...

  5. pytorch中神经网络的多线程数设置:torch.set_num_threads(N)

    实验室的同学一直都是在服务器上既用CPU训练神经网络也有使用GPU的,最近才发现原来在pytorch中可以通过设置  torch.set_num_threads(args.thread)  来限制CP ...

  6. 【转载】流形学习 (Manifold Learning) ——(学习笔记)

    第一篇:   摘抄自:https://zhuanlan.zhihu.com/p/54516805 从度量空间到拓扑空间 拓扑这门学科的一个方向涉及到去研究集合在"连续变形"下一些不 ...

  7. AI 大模型时代呼唤新一代基础设施,DataOps 2.0和调度编排愈发重要

    在 AI 时代,DataOps 2.0 代表了一种全新的数据管理和操作模式,通过自动化数据管道.实时数据处理和跨团队协作,DataOps 2.0 能够加速数据分析和决策过程.它融合了人工智能和机器学习 ...

  8. 如何让您的 .NET应用程序更智能-- 请参加 8.20 的 .NET Conf -- Focus on AI

    Microsoft 将于 2024 年 8 月 20 日举办免费的 .NET Conf: Focus on AI.该虚拟活动为开发人员提供了如何集成 .NET 和 AI 以增强应用程序开发和用户体验的 ...

  9. zabbix 二次开发(添加menu)

    zabbix 二次开发--- 在zabbix菜单栏中增加 CMDB 菜单,该菜单下有个子栏目 CMDB overview,如图: 实现此效果,我们需要修改两个地方:menu.inc.php 和 mai ...

  10. vscode注释快捷键

    单行注释 ctrl+/ 多行注释 ctrl+alt+a 文档注释 /** 复制上面一行 ctrl+d 选中段落整体向左或向右缩进 ctrl +[ 或 ctrl + ] 查找 ctrl + f