-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: Provide an offline installation method for Helm. (#7729) #7730
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,7 +49,7 @@ KubeBlocks 是基于 Kubernetes 的原生应用,你可以使用 Helm 来进行 | |
|
||
## 安装步骤 | ||
|
||
**使用 Helm 安装 KubeBlocks** | ||
**在线安装 KubeBlocks** | ||
|
||
1. 创建 CRD 依赖。 | ||
|
||
|
@@ -95,6 +95,125 @@ KubeBlocks 是基于 Kubernetes 的原生应用,你可以使用 Helm 来进行 | |
|
||
::: | ||
|
||
**离线安装 KubeBlocks** | ||
|
||
在生产环境中,K8S 集群一般是不能连接外网的,只会允许办公环境的电脑通过 VPN 连接 K8S 集群。在线安装方式不可用,需要进行离线安装。 | ||
## 环境准备 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The heading level here is problematic: this level is the same as the previous The correct hierarchy should be |
||
|
||
<table> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why a HTML table is needed here ? |
||
<tr> | ||
<td colspan="3">1. K8S 集群中有可用的镜像仓库(假定为registry.kb)</td> | ||
</tr > | ||
<tr> | ||
<td colspan="3">2. K8S 的部署节点安装 helm</td> | ||
</tr > | ||
</table> | ||
总得来说就是将在线的crd , helm-charts,公有云镜像下载下来,然后helm install安装 | ||
|
||
1. 下载crd并安装 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's recommended to first introduce on a manifest of files that needs to be downloaded from the Internet and how to get them, then the rest of the steps only manipulate on these downloaded files. |
||
1. 办公电脑访问下面地址,会自动下载 crd 文件 | ||
```bash | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not a bash command |
||
https://github.com/apecloud/kubeblocks/releases/download/v0.8.4-beta.11/kubeblocks_crds.yaml | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The version is hard-coded here |
||
``` | ||
2. 将文件上传到集群中,并安装 crd | ||
```bash | ||
kubectl create -f crds.yaml // 这里假定下载为 crds.yaml | ||
``` | ||
|
||
2. 下载远程 helmchart 文件 | ||
```bash | ||
helm repo add kubeblocks https://apecloud.github.io/helm-charts | ||
|
||
helm repo update | ||
|
||
helm fetch kubeblocks/kubeblocks --version 0.8.4-beta.11 // 这里指定了版本为 0.8.4-beta.11 | ||
``` | ||
3. 将仓库的 repo 改成集群可用的仓库,这里假定可用的是 registry.kb | ||
1. 将下载的 helmchart 包解压,会得到一个 kubeblocks 的文件夹,进入后修改 value.yaml | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not create a new |
||
```bash | ||
tar zxvf kubeblocks-0.8.4-beta.11 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. version hard-coded |
||
``` | ||
2. 改对应的 repo | ||
```bash | ||
## KubeBlocks container image settings | ||
## | ||
## @param image.registry KubeBlocks image registry | ||
## @param image.repository KubeBlocks image repository | ||
## @param image.pullPolicy KubeBlocks image pull policy | ||
## @param image.tag KubeBlocks image tag (immutable tags are recommended) | ||
## @param image.imagePullSecrets KubeBlocks image pull secrets | ||
## @param image.tools.repository KubeBlocks tools image repository | ||
image: | ||
registry: registry.kb //换成可用的 registry | ||
repository: apecloud/kubeblocks | ||
pullPolicy: IfNotPresent | ||
# Overrides the image tag whose default is the chart appVersion. | ||
tag: "" | ||
imagePullSecrets: [] | ||
tools: | ||
repository: apecloud/kubeblocks-tools | ||
datascript: | ||
repository: apecloud/kubeblocks-datascript | ||
|
||
|
||
|
||
## @param addonChartsImage - addon charts image, used to copy Helm charts to the addon job container. | ||
## @param addonChartsImage.chartsPath - the helm charts path in the addon charts image. | ||
addonChartsImage: | ||
# if the value of addonChartsImage.registry is not specified using `--set`, it will be set to the value of 'image.registry' by default | ||
registry: "registry.kb" // 换成可用的 registry | ||
repository: apecloud/kubeblocks-charts | ||
pullPolicy: IfNotPresent | ||
tag: "" | ||
chartsPath: /charts | ||
pullSecrets: [] | ||
``` | ||
4. 将需要的远程镜像重新 tag 推到 K8S 的镜像仓库 | ||
1. 基本需要的镜像是下面这几个 | ||
```bash | ||
infracreate-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/kubeblocks-datascript:0.8.4-beta.11 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. image tag hard-coded |
||
infracreate-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/kubeblocks-tools:0.8.4-beta.11 | ||
infracreate-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/kubeblocks:0.8.4-beta.11 | ||
infracreate-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/snapshot-controller:v6.2.1 | ||
infracreate-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/kubeblocks-charts:0.8.4-beta.11 | ||
``` | ||
2. 将他们重新 tag 后推到远端(以kubeblocks:0.8.4-beta.11举例) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better put these steps at the download phase |
||
```bash | ||
docker pull infracreate-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/kubeblocks:0.8.4-beta.11 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. version hard-coded |
||
docker tag infracreate-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/kubeblocks:0.8.4-beta.11 registry.kb/apecloud/kubeblocks:0.8.4-beta.11 | ||
docker push registry.kb/apecloud/kubeblocks:0.8.4-beta.11 | ||
``` | ||
后续有需要的镜像也可以按照上面的方式添加 | ||
|
||
5. 可以将部分自动安装的 addon 关闭,只保留需要的 | ||
|
||
在kubeblocks/templates/addons 文件夹中,将对应的数据库的配置中的 autoInstall 改成 false(以 apecloud-mysql-addon.yaml举例) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @shanshanying Are there any settings in KubeBlocks' |
||
```bash | ||
{{- $selectorLabels := include "kubeblocks.selectorLabels" . }} | ||
{{- include "kubeblocks.buildAddonCR" (merge (dict | ||
"kbVersion" ">=0.7.0" | ||
"selectorLabels" $selectorLabels | ||
"name" "apecloud-mysql" | ||
"version" "0.8.0-beta.8" | ||
"model" "RDBMS" | ||
"provider" "apecloud" | ||
"description" "ApeCloud MySQL is a database that is compatible with MySQL syntax and achieves high availability through the utilization of the RAFT consensus protocol." | ||
"autoInstall" false ) .) -}} // 将原本的 true 改成false | ||
``` | ||
6. 部署 | ||
|
||
将原本的 kubeblocks 文件夹打包上传至集群部署节点 | ||
```bash | ||
tar czvf kb0.8.4beta11.tgz kubeblocks | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The first command is executed in your local machine that can access the Internet; the second command is executed in your server in the air-gapped environment. They shouldn't be put into the same code block. |
||
helm install kubeblocks kubeblocks/. --create-namespace kb-system | ||
``` | ||
:::note | ||
|
||
中间有问题需要卸载的时候,一定要使用 helm uninstall 的方式,不能使用删除 kb-system 命名空间的方式,因为部分资源不在 kb-system 下,会导致异常。比如设置某些数据库自动安装的开关失效 | ||
|
||
::: | ||
|
||
|
||
## 验证 KubeBlocks 安装 | ||
|
||
执行以下命令来检查 KubeBlocks 是否已成功安装。 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The situation described here may not be accurate, so it is recommended to delete the relevant content.