Skip to content

Commit

Permalink
Optimize deployment documentation (erda-project#1198)
Browse files Browse the repository at this point in the history
  • Loading branch information
luobily authored Jul 28, 2021
1 parent 75a759f commit f7d72c3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 94 deletions.
60 changes: 11 additions & 49 deletions docs/guides/deploy/How-to-install-Erda-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@

### 先决条件

- Kuberentes 1.16 - 1.18
- Kubernetes 1.16 - 1.18
- 至少需要 4 个节点 (1 个 Master 和 3 个 Worker)
- 每个节点 4 CPU 16 G 内存
- **不要在集群上安装 ingress controller 组件**
- 需要安装 [ingress controller](https://kubernetes.io/zh/docs/concepts/services-networking/ingress-controllers/) 组件
- Docker 19.03 +
- CentOS 7.4 +
- Helm 3 +
- 泛域名(可选项,用于访问 Erda 平台,如 *.erda.io)


- 泛域名(可选项,通过 Kubernetes Ingress 配置域名来访问 Erda 平台,如 *.erda.io)

### 安装 Erda

Expand All @@ -24,23 +22,18 @@
cd erda
```



2. 在 Kubernetes Master 节点上设置安装 Erda 时的必要配置

- 请确保 `~/.kube/` 路径下有 **kubeconfig** 文件
- 请确保 kubeconfig 文件中有如下配置
- `certificate-authority-data`
- `client-certificate-data`
- `client-key-data`


- 设置 Erda 安装前的配置并且执行 `prepare.sh` 脚本

- 脚本中会执行如下操作:
- 生成 ETCD 的 SSL
- 生成多集群管理的 SSL
- 为节点设置上 Erda 应用所需要用的标签
- Erda 安装工具中需要的一些配置

Expand All @@ -58,8 +51,6 @@
bash scripts/prepare.sh
```



- 修改 docker daemon 文件中的 `insecure-registries` 字段

```shell
Expand All @@ -73,8 +64,6 @@
# 重启 docker daemon
systemctl restart docker
```



- 在每个节点上设置 NFS 作为网络共享存储

Expand All @@ -93,23 +82,8 @@
```shell
bash scripts/storage_prepare.sh
```




- 您需要在 LB 机器上开放 80, 443 端口,这台机器将承载所有的外部流量

```shell
# 您可以使用如下命令在您的 Kubernetes 集群上找到 LB 节点:
kubectl get node -o wide --show-labels | grep dice/lb
```

- 记住节点的 IP,您将会在后续设置**泛域名**时用到该节点 IP



3. 通过 Helm 安装 Erda Helm 包,并且等待所有的 Erda 组件准备就绪
3. 通过 Helm 安装 Erda ,并且等待所有的 Erda 组件准备就绪

```shell
# 安装 erda-base
Expand All @@ -122,10 +96,8 @@
helm install package/erda-$(cat VERSION).tgz --generate-name
```



4. 安装 Erda 平台组件之后

- 设置管理员用户名和密码,用于推送 Erda 扩展组件(扩展组件将作为一种插件被用于流水线)

```shell
Expand All @@ -134,18 +106,12 @@
bash scripts/push-ext.sh
```

- 如果有真实的泛域名,您需要进行域名配置,将该域名的访问流量导入 Kubernetes 集群的 Ingress Controller,让集群中配置的 Ingress 域名能正常访问

- 如果没有真实的泛域名, 您需要在浏览器所在的机器上将下列的 URL 写到 `etc/hosts` 文件中,请将下面的示例 IP 替换为该 Kubernetes 集群的 Ingress Controller 的入口 IP



- 如果您购买了真实的泛域名,您需要将其与上述获取到的 LB 节点 IP 绑定

> 举例如下,假设您有 LB 节点的 IP 为 10.0.0.1,泛域名(ERDA_GENERIC_DOMAIN 变量中设置)为 `erda.io`, 您需要将 LB 节点 IP 与泛域名在您的解析器(如 DNS 或 F5 服务器)上绑定



- 如果没有真实的泛域名地址, 您需要在您浏览器所在的机器上将下列的 URL 写到 `etc/hosts` 文件中,请替换 IP 为 **LB 节点**的 IP

> 举例如下: 假设您有 LB 节点的 IP 为 10.0.0.1,泛域名(ERDA_GENERIC_DOMAIN 变量中设置)为 `erda.io`, org-name 为 `erda-test`. 所以您需要将下列的信息写入到 `/etc/hosts` 文件中
> 举个例子,假设您的 Kubernetes 集群的 Ingress Controller 的入口 IP 为 10.0.0.1,泛域名(ERDA_GENERIC_DOMAIN 变量中设置)为 `erda.io`, org-name 为 `erda-test`, 需要将下列的信息写入到 `/etc/hosts` 文件中

```shell
10.0.0.1 collector.erda.io
Expand All @@ -155,15 +121,11 @@
# 注意: org-name 举例为 erda-test
10.0.0.1 erda-test-org.erda.io
```



- 将您创建好的组织名称作为标签设置到您的 Kubernetes 节点上(组织名称是 Erda 中的一种组)

```shell
kubectl label node <node_name> dice/org-<orgname>=true --overwrite
```



5. 在您设置过 `/etc/hosts` 文件的机器上用浏览器访问 `http://erda.io`,并开始您的 Erda 之旅
5. 最后您可以通过浏览器访问 `http://erda.io`,并开始您的 Erda 之旅
51 changes: 6 additions & 45 deletions docs/guides/deploy/How-to-install-Erda.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
- Kubernetes 1.16 - 1.18
- At least 4 Nodes (1 Master and 3 Workers)
- Each node needs at least 4 core CPU, 16G memory
- **Don't Install the ingress-controller-manager component**
- Install the [ingress controller](https://kubernetes.io/zh/docs/concepts/services-networking/ingress-controllers/) component
- Docker 19.03 +
- CentOS 7.4 +
- Helm 3 +
- Generic Domain Name (Optional, which is used to visit the Erda cluster,e.g. *.erda.io)


- Generic Domain Name (Optional, configure the domain name through Kubernetes Ingress to access the Erda platform,e.g. *.erda.io)

### Install Erda

Expand All @@ -24,8 +22,6 @@
cd erda
```



2. Apply Erda necessary configurations on the **Kubernetes Master Node**.

- make sure the **kubeconfig** file on the ~/.kube/config.
Expand All @@ -35,13 +31,10 @@
- `client-certificate-data`
- `client-key-data`


- set configuration to prepare to install Erda and execute the `prepare.sh` script

- The script will do the following tasks:
- generate etc SSL
- generate multi-cluster manager SSL
- set node labels which use for Erda Application
- set Erda installer configuration

Expand All @@ -59,8 +52,6 @@
bash scripts/prepare.sh
```



- update `insecure-registries` in the config of the docker daemon

```shell
Expand All @@ -75,8 +66,6 @@
systemctl restart docker
```



- set NFS share storage as network storage to each node.

- if you already have share storage like AliCloud NAS, you need to set them to **each node** with command like:
Expand All @@ -89,28 +78,12 @@
mount -t nfs -o vers=4,minorversion=0,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport file-system-id.region.nas.aliyuncs.com:/ /netdata
```



- if not, you need to execute the script. It will install NFS utils, create a directory `/netdata` to the current machine, and mount `/netdata` to each node

```shell
bash scripts/storage_prepare.sh
```



- you need to open the 80, 443 ports of the **LB machine** , which will receivers all outside traffic

```shell
# you can find the LB machine on your Kubernetes cluster with the command:
kubectl get node -o wide --show-labels | grep dice/lb
```

- keep the node IP, you will use it when you set the **generic domain name**



3. Install the Erda with helm package and waiting all Erda components are ready

```shell
Expand All @@ -124,8 +97,6 @@
helm install package/erda-$(cat VERSION).tgz --generate-name
```



4. After Installed Erda

- set administrator user name and password to push the Erda extensions(the extension is a plugin which uses in the pipeline)
Expand All @@ -137,17 +108,11 @@
bash scripts/push-ext.sh
```

- If you have a real generic domain name, you need to configure the domain name and import the access traffic of the domain name into the Ingress Controller of the Kubernetes cluster, so that the Ingress domain name configured in the cluster can be used normally.

- If you have a real generic domain name, you need to set the generic domain name with the LB Node IP.
- If not, you need to write the following URLs to `/etc/hosts` on the **machine where the browser is located**, replace the <IP> below with the entry IP of the Ingress Controller of the Kubernetes cluster.

> For example, suppose the IP of the LB node is 10.0.0.1 and the generic domain name( ERDA_GENERIC_DOMAIN ) is *.erda.io. you need to bind the two together on the specified resolver like DNS or F5 Server.



- If not, you need to write the following URLs to `/etc/hosts` on the **machine where the browser is located**, replace the <IP> with IP of the **LB machine**

> For example, suppose the IP of the LB node is `10.0.0.1`, ERDA_GENERIC_DOMAIN is `erda.io`, org-name is `erda-test`. so you need to write the following info to `/etc/hosts`
> For example, suppose the IP of the ingress controller is `10.0.0.1`, ERDA_GENERIC_DOMAIN is `erda.io`, org-name is `erda-test`, write the following info to `/etc/hosts`

```shell
10.0.0.1 collector.erda.io
Expand All @@ -158,14 +123,10 @@
10.0.0.1 erda-test-org.erda.io
```



- set your Kubernetes nodes label with your created organization name(organization is a name for a group in Erda)

```shell
kubectl label node <node_name> dice/org-<orgname>=true --overwrite
```



5. Visit the URL `http://erda.io` on your browser machine which set the `/etc/hosts`
5. Finally, you can visit `http://erda.io` through your browser and start your Erda journey

0 comments on commit f7d72c3

Please sign in to comment.