当前位置:   article > 正文

Linux系统下KubeSphere3.4.1离线安装包制作及部署过程

kubesphere3.4.1离线

一、概述

KubeSphere 是 GitHub 上的一个开源项目,是成千上万名社区用户的聚集地。很多用户都在使用 KubeSphere 运行工作负载。对于在 Linux 上的安装,KubeSphere 既可以部署在云端,也可以部署在本地环境中,例如 AWS EC2、Azure VM 和裸机等。

KubeSphere 为用户提供轻量级安装程序 KubeKey(该程序支持安装 Kubernetes、KubeSphere 及相关插件),安装过程简单而友好。KubeKey 不仅能帮助用户在线创建集群,还能作为离线安装解决方案。

以下是可用的安装选项:

  • All-in-One:在单个节点上安装 KubeSphere(仅为让用户快速熟悉 KubeSphere)。
  • 多节点安装:在多个节点上安装 KubeSphere(用于测试或开发)。
  • 在 Linux 上离线安装:将 KubeSphere 的所有镜像打包(便于在 Linux 上进行离线安装)。
  • 高可用安装:安装具有多个节点的高可用 KubeSphere 集群,该集群用于生产环境。
  • 最小化安装:仅安装 KubeSphere 所需的最少系统组件。以下是最低资源要求:
    • 2 个 CPU
    • 4 GB 运行内存
    • 40 GB 存储空间
  • 全家桶安装:安装 KubeSphere 的所有可用系统组件,例如 DevOps、服务网格、告警等。

注意:并非所有选项都相互排斥,例如,您可以在离线环境中使用最小化安装将 KubeSphere 部署在多个节点上。

本文主要介绍在Linux系统下离线安装KubeSphere

 前提条件:

要开始进行多节点安装,您需要参考如下示例准备至少三台主机。

主机 IP主机名称角色系统版本
172.31.10.2node1联网主机用于制作离线包Ubuntu20.04 LTS
172.31.10.43node2离线环境主节点Ubuntu20.04 LTS
172.31.10.44node3离线环境镜像仓库节点Ubuntu20.04 LTS

部署准备

在私有云上创建3台云主机如下,物理机也可以

二、制作离线安装包

KubeKey 是一个用于部署 Kubernetes 集群的开源轻量级工具。它提供了一种灵活、快速、便捷的方式来仅安装 Kubernetes/K3s,或同时安装 Kubernetes/K3s 和 KubeSphere,以及其他云原生插件。除此之外,它也是扩展和升级集群的有效工具。

KubeKey v2.1.0 版本新增了清单(manifest)和制品(artifact)的概念,为用户离线部署 Kubernetes 集群提供了一种解决方案。manifest 是一个描述当前 Kubernetes 集群信息和定义 artifact 制品中需要包含哪些内容的文本文件。在过去,用户需要准备部署工具,镜像 tar 包和其他相关的二进制文件,每位用户需要部署的 Kubernetes 版本和需要部署的镜像都是不同的。现在使用 KubeKey,用户只需使用清单 manifest 文件来定义将要离线部署的集群环境需要的内容,再通过该 manifest 来导出制品 artifact 文件即可完成准备工作。离线部署时只需要 KubeKey 和 artifact 就可快速、简单的在环境中部署镜像仓库和 Kubernetes 集群。

2.1 登录node1执行以下命令下载并解压KubeKey

curl -sfL https://get-kk.kubesphere.io | VERSION=v3.0.13 sh -

2.2 在node1上执行以下命令,并复制示例中的 manifest 内容。

vim manifest.yaml
  1. ---
  2. apiVersion: kubekey.kubesphere.io/v1alpha2
  3. kind: Manifest
  4. metadata:
  5. name: sample
  6. spec:
  7. arches:
  8. - amd64
  9. operatingSystems:
  10. - arch: amd64
  11. type: linux
  12. id: centos
  13. version: "7"
  14. repository:
  15. iso:
  16. localPath:
  17. url: https://github.com/kubesphere/kubekey/releases/download/v3.0.10/centos7-rpms-amd64.iso
  18. - arch: amd64
  19. type: linux
  20. id: ubuntu
  21. version: "20.04"
  22. repository:
  23. iso:
  24. localPath:
  25. url: https://github.com/kubesphere/kubekey/releases/download/v3.0.10/ubuntu-20.04-debs-amd64.iso
  26. kubernetesDistributions:
  27. - type: kubernetes
  28. version: v1.23.15
  29. components:
  30. helm:
  31. version: v3.9.0
  32. cni:
  33. version: v1.2.0
  34. etcd:
  35. version: v3.4.13
  36. calicoctl:
  37. version: v3.23.2
  38. ## For now, if your cluster container runtime is containerd, KubeKey will add a docker 20.10.8 container runtime in the below list.
  39. ## The reason is KubeKey creates a cluster with containerd by installing a docker first and making kubelet connect the socket file of containerd which docker contained.
  40. containerRuntimes:
  41. - type: docker
  42. version: 20.10.8
  43. - type: containerd
  44. version: 1.6.4
  45. crictl:
  46. version: v1.24.0
  47. docker-registry:
  48. version: "2"
  49. harbor:
  50. version: v2.5.3
  51. docker-compose:
  52. version: v2.2.2
  53. images:
  54. - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-apiserver:v1.23.15
  55. - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-controller-manager:v1.23.15
  56. - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-proxy:v1.23.15
  57. - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-scheduler:v1.23.15
  58. - registry.cn-beijing.aliyuncs.com/kubesphereio/pause:3.6
  59. - registry.cn-beijing.aliyuncs.com/kubesphereio/coredns:1.8.6
  60. - registry.cn-beijing.aliyuncs.com/kubesphereio/cni:v3.23.2
  61. - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-controllers:v3.23.2
  62. - registry.cn-beijing.aliyuncs.com/kubesphereio/node:v3.23.2
  63. - registry.cn-beijing.aliyuncs.com/kubesphereio/pod2daemon-flexvol:v3.23.2
  64. - registry.cn-beijing.aliyuncs.com/kubesphereio/typha:v3.23.2
  65. - registry.cn-beijing.aliyuncs.com/kubesphereio/flannel:v0.12.0
  66. - registry.cn-beijing.aliyuncs.com/kubesphereio/provisioner-localpv:3.3.0
  67. - registry.cn-beijing.aliyuncs.com/kubesphereio/linux-utils:3.3.0
  68. - registry.cn-beijing.aliyuncs.com/kubesphereio/haproxy:2.3
  69. - registry.cn-beijing.aliyuncs.com/kubesphereio/nfs-subdir-external-provisioner:v4.0.2
  70. - registry.cn-beijing.aliyuncs.com/kubesphereio/k8s-dns-node-cache:1.15.12
  71. - registry.cn-beijing.aliyuncs.com/kubesphereio/ks-installer:v3.4.1
  72. - registry.cn-beijing.aliyuncs.com/kubesphereio/ks-apiserver:v3.4.1
  73. - registry.cn-beijing.aliyuncs.com/kubesphereio/ks-console:v3.4.1
  74. - registry.cn-beijing.aliyuncs.com/kubesphereio/ks-controller-manager:v3.4.1
  75. - registry.cn-beijing.aliyuncs.com/kubesphereio/kubectl:v1.22.0
  76. - registry.cn-beijing.aliyuncs.com/kubesphereio/kubectl:v1.21.0
  77. - registry.cn-beijing.aliyuncs.com/kubesphereio/kubectl:v1.20.0
  78. - registry.cn-beijing.aliyuncs.com/kubesphereio/kubefed:v0.8.1
  79. - registry.cn-beijing.aliyuncs.com/kubesphereio/tower:v0.2.1
  80. - registry.cn-beijing.aliyuncs.com/kubesphereio/minio:RELEASE.2019-08-07T01-59-21Z
  81. - registry.cn-beijing.aliyuncs.com/kubesphereio/mc:RELEASE.2019-08-07T23-14-43Z
  82. - registry.cn-beijing.aliyuncs.com/kubesphereio/snapshot-controller:v4.0.0
  83. - registry.cn-beijing.aliyuncs.com/kubesphereio/nginx-ingress-controller:v1.1.0
  84. - registry.cn-beijing.aliyuncs.com/kubesphereio/defaultbackend-amd64:1.4
  85. - registry.cn-beijing.aliyuncs.com/kubesphereio/metrics-server:v0.4.2
  86. - registry.cn-beijing.aliyuncs.com/kubesphereio/redis:5.0.14-alpine
  87. - registry.cn-beijing.aliyuncs.com/kubesphereio/haproxy:2.0.25-alpine
  88. - registry.cn-beijing.aliyuncs.com/kubesphereio/alpine:3.14
  89. - registry.cn-beijing.aliyuncs.com/kubesphereio/openldap:1.3.0
  90. - registry.cn-beijing.aliyuncs.com/kubesphereio/netshoot:v1.0
  91. - registry.cn-beijing.aliyuncs.com/kubesphereio/cloudcore:v1.13.0
  92. - registry.cn-beijing.aliyuncs.com/kubesphereio/iptables-manager:v1.13.0
  93. - registry.cn-beijing.aliyuncs.com/kubesphereio/edgeservice:v0.3.0
  94. - registry.cn-beijing.aliyuncs.com/kubesphereio/gatekeeper:v3.5.2
  95. - registry.cn-beijing.aliyuncs.com/kubesphereio/openpitrix-jobs:v3.3.2
  96. - registry.cn-beijing.aliyuncs.com/kubesphereio/devops-apiserver:ks-v3.4.1
  97. - registry.cn-beijing.aliyuncs.com/kubesphereio/devops-controller:ks-v3.4.1
  98. - registry.cn-beijing.aliyuncs.com/kubesphereio/devops-tools:ks-v3.4.1
  99. - registry.cn-beijing.aliyuncs.com/kubesphereio/ks-jenkins:v3.4.0-2.319.3-1
  100. - registry.cn-beijing.aliyuncs.com/kubesphereio/inbound-agent:4.10-2
  101. - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-base:v3.2.2
  102. - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-nodejs:v3.2.0
  103. - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-maven:v3.2.0
  104. - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-maven:v3.2.1-jdk11
  105. - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-python:v3.2.0
  106. - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-go:v3.2.0
  107. - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-go:v3.2.2-1.16
  108. - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-go:v3.2.2-1.17
  109. - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-go:v3.2.2-1.18
  110. - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-base:v3.2.2-podman
  111. - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-nodejs:v3.2.0-podman
  112. - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-maven:v3.2.0-podman
  113. - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-maven:v3.2.1-jdk11-podman
  114. - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-python:v3.2.0-podman
  115. - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-go:v3.2.0-podman
  116. - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-go:v3.2.2-1.16-podman
  117. - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-go:v3.2.2-1.17-podman
  118. - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-go:v3.2.2-1.18-podman
  119. - registry.cn-beijing.aliyuncs.com/kubesphereio/s2ioperator:v3.2.1
  120. - registry.cn-beijing.aliyuncs.com/kubesphereio/s2irun:v3.2.0
  121. - registry.cn-beijing.aliyuncs.com/kubesphereio/s2i-binary:v3.2.0
  122. - registry.cn-beijing.aliyuncs.com/kubesphereio/tomcat85-java11-centos7:v3.2.0
  123. - registry.cn-beijing.aliyuncs.com/kubesphereio/tomcat85-java11-runtime:v3.2.0
  124. - registry.cn-beijing.aliyuncs.com/kubesphereio/tomcat85-java8-centos7:v3.2.0
  125. - registry.cn-beijing.aliyuncs.com/kubesphereio/tomcat85-java8-runtime:v3.2.0
  126. - registry.cn-beijing.aliyuncs.com/kubesphereio/java-11-centos7:v3.2.0
  127. - registry.cn-beijing.aliyuncs.com/kubesphereio/java-8-centos7:v3.2.0
  128. - registry.cn-beijing.aliyuncs.com/kubesphereio/java-8-runtime:v3.2.0
  129. - registry.cn-beijing.aliyuncs.com/kubesphereio/java-11-runtime:v3.2.0
  130. - registry.cn-beijing.aliyuncs.com/kubesphereio/nodejs-8-centos7:v3.2.0
  131. - registry.cn-beijing.aliyuncs.com/kubesphereio/nodejs-6-centos7:v3.2.0
  132. - registry.cn-beijing.aliyuncs.com/kubesphereio/nodejs-4-centos7:v3.2.0
  133. - registry.cn-beijing.aliyuncs.com/kubesphereio/python-36-centos7:v3.2.0
  134. - registry.cn-beijing.aliyuncs.com/kubesphereio/python-35-centos7:v3.2.0
  135. - registry.cn-beijing.aliyuncs.com/kubesphereio/python-34-centos7:v3.2.0
  136. - registry.cn-beijing.aliyuncs.com/kubesphereio/python-27-centos7:v3.2.0
  137. - registry.cn-beijing.aliyuncs.com/kubesphereio/argocd:v2.3.3
  138. - registry.cn-beijing.aliyuncs.com/kubesphereio/argocd-applicationset:v0.4.1
  139. - registry.cn-beijing.aliyuncs.com/kubesphereio/dex:v2.30.2
  140. - registry.cn-beijing.aliyuncs.com/kubesphereio/redis:6.2.6-alpine
  141. - registry.cn-beijing.aliyuncs.com/kubesphereio/configmap-reload:v0.7.1
  142. - registry.cn-beijing.aliyuncs.com/kubesphereio/prometheus:v2.39.1
  143. - registry.cn-beijing.aliyuncs.com/kubesphereio/prometheus-config-reloader:v0.55.1
  144. - registry.cn-beijing.aliyuncs.com/kubesphereio/prometheus-operator:v0.55.1
  145. - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-rbac-proxy:v0.11.0
  146. - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-state-metrics:v2.6.0
  147. - registry.cn-beijing.aliyuncs.com/kubesphereio/node-exporter:v1.3.1
  148. - registry.cn-beijing.aliyuncs.com/kubesphereio/alertmanager:v0.23.0
  149. - registry.cn-beijing.aliyuncs.com/kubesphereio/thanos:v0.31.0
  150. - registry.cn-beijing.aliyuncs.com/kubesphereio/grafana:8.3.3
  151. - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-rbac-proxy:v0.11.0
  152. - registry.cn-beijing.aliyuncs.com/kubesphereio/notification-manager-operator:v2.3.0
  153. - registry.cn-beijing.aliyuncs.com/kubesphereio/notification-manager:v2.3.0
  154. - registry.cn-beijing.aliyuncs.com/kubesphereio/notification-tenant-sidecar:v3.2.0
  155. - registry.cn-beijing.aliyuncs.com/kubesphereio/elasticsearch-curator:v5.7.6
  156. - registry.cn-beijing.aliyuncs.com/kubesphereio/elasticsearch-oss:6.8.22
  157. - registry.cn-beijing.aliyuncs.com/kubesphereio/opensearch:2.6.0
  158. - registry.cn-beijing.aliyuncs.com/kubesphereio/opensearch-dashboards:2.6.0
  159. - registry.cn-beijing.aliyuncs.com/kubesphereio/opensearch-curator:v0.0.5
  160. - registry.cn-beijing.aliyuncs.com/kubesphereio/fluentbit-operator:v0.14.0
  161. - registry.cn-beijing.aliyuncs.com/kubesphereio/docker:19.03
  162. - registry.cn-beijing.aliyuncs.com/kubesphereio/fluent-bit:v1.9.4
  163. - registry.cn-beijing.aliyuncs.com/kubesphereio/log-sidecar-injector:v1.2.0
  164. - registry.cn-beijing.aliyuncs.com/kubesphereio/filebeat:6.7.0
  165. - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-events-operator:v0.6.0
  166. - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-events-exporter:v0.6.0
  167. - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-events-ruler:v0.6.0
  168. - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-auditing-operator:v0.2.0
  169. - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-auditing-webhook:v0.2.0
  170. - registry.cn-beijing.aliyuncs.com/kubesphereio/pilot:1.14.6
  171. - registry.cn-beijing.aliyuncs.com/kubesphereio/proxyv2:1.14.6
  172. - registry.cn-beijing.aliyuncs.com/kubesphereio/jaeger-operator:1.29
  173. - registry.cn-beijing.aliyuncs.com/kubesphereio/jaeger-agent:1.29
  174. - registry.cn-beijing.aliyuncs.com/kubesphereio/jaeger-collector:1.29
  175. - registry.cn-beijing.aliyuncs.com/kubesphereio/jaeger-query:1.29
  176. - registry.cn-beijing.aliyuncs.com/kubesphereio/jaeger-es-index-cleaner:1.29
  177. - registry.cn-beijing.aliyuncs.com/kubesphereio/kiali-operator:v1.50.1
  178. - registry.cn-beijing.aliyuncs.com/kubesphereio/kiali:v1.50
  179. - registry.cn-beijing.aliyuncs.com/kubesphereio/busybox:1.31.1
  180. - registry.cn-beijing.aliyuncs.com/kubesphereio/nginx:1.14-alpine
  181. - registry.cn-beijing.aliyuncs.com/kubesphereio/wget:1.0
  182. - registry.cn-beijing.aliyuncs.com/kubesphereio/hello:plain-text
  183. - registry.cn-beijing.aliyuncs.com/kubesphereio/wordpress:4.8-apache
  184. - registry.cn-beijing.aliyuncs.com/kubesphereio/hpa-example:latest
  185. - registry.cn-beijing.aliyuncs.com/kubesphereio/fluentd:v1.4.2-2.0
  186. - registry.cn-beijing.aliyuncs.com/kubesphereio/perl:latest
  187. - registry.cn-beijing.aliyuncs.com/kubesphereio/examples-bookinfo-productpage-v1:1.16.2
  188. - registry.cn-beijing.aliyuncs.com/kubesphereio/examples-bookinfo-reviews-v1:1.16.2
  189. - registry.cn-beijing.aliyuncs.com/kubesphereio/examples-bookinfo-reviews-v2:1.16.2
  190. - registry.cn-beijing.aliyuncs.com/kubesphereio/examples-bookinfo-details-v1:1.16.2
  191. - registry.cn-beijing.aliyuncs.com/kubesphereio/examples-bookinfo-ratings-v1:1.16.3
  192. - registry.cn-beijing.aliyuncs.com/kubesphereio/scope:1.13.0

注意: 

  • 若需要导出的 artifact 文件中包含操作系统依赖文件(如:conntarck、chrony 等),可在 operationSystem 元素中的 .repostiory.iso.url 中配置相应的 ISO 依赖文件下载地址或者提前下载 ISO 包到本地在 localPath 里填写本地存放路径并删除 url 配置项。

  • 开启 harbor 和 docker-compose 配置项,为后面通过 KubeKey 自建 harbor 仓库推送镜像使用。

  • 默认创建的 manifest 里面的镜像列表从 docker.io 获取。

  • 可根据实际情况修改 manifest-sample.yaml 文件的内容,用于之后导出期望的 artifact 文件。

  • 您可以访问 https://www.wpsshop.cn/w/小桥流水78/article/detail/915766

推荐阅读
相关标签
  

闽ICP备14008679号