Skip to content

Commit

Permalink
docs: use cases - helm installer
Browse files Browse the repository at this point in the history
Signed-off-by: Bird <aflybird0@gmail.com>
  • Loading branch information
aFlyBird0 committed Jan 6, 2023
1 parent caf3be9 commit 08a36b7
Show file tree
Hide file tree
Showing 19 changed files with 230 additions and 7 deletions.
10 changes: 10 additions & 0 deletions docs/plugins/helm-installer/argocd.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Install Argo CD with DevStream

## InstanceID Prefix

The `instanceID` prefix must be `argocd`, the minimum tools configuration example:

```yaml
tools:
- name: helm-installer
instanceID: argocd
```
## Default Configs
| key | default value | description |
Expand Down
10 changes: 10 additions & 0 deletions docs/plugins/helm-installer/argocd.zh.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# 使用 DevStream 部署 Argo CD

## 前缀匹配

`instanceID` 的前缀需要是 `argocd`,最小化 tools 配置示例:

```yaml
tools:
- name: helm-installer
instanceID: argocd
```
## 默认配置
| 配置项 | 默认值 | 描述 |
Expand Down
10 changes: 10 additions & 0 deletions docs/plugins/helm-installer/artifactory.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Install Artifactory with DevStream

## InstanceID Prefix

The `instanceID` prefix must be `artifactory`, the minimum tools configuration example:

```yaml
tools:
- name: helm-installer
instanceID: artifactory
```
## Default Configs
| key | default value | description |
Expand Down
10 changes: 10 additions & 0 deletions docs/plugins/helm-installer/artifactory.zh.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# 使用 DevStream 部署 Artifactory

## 前缀匹配

`instanceID` 的前缀需要是 `artifactory`,最小化 tools 配置示例:

```yaml
tools:
- name: helm-installer
instanceID: artifactory
```
## 默认配置
| key | default value | description |
Expand Down
10 changes: 10 additions & 0 deletions docs/plugins/helm-installer/devlake.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Install DevLake with DevStream

## InstanceID Prefix

The `instanceID` prefix must be `devlake`, the minimum tools configuration example:

```yaml
tools:
- name: helm-installer
instanceID: devlake
```
## Default Configs
| key | default value | description |
Expand Down
10 changes: 10 additions & 0 deletions docs/plugins/helm-installer/devlake.zh.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# 使用 DevStream 部署 DevLake

## 前缀匹配

`instanceID` 的前缀需要是 `devlake`,最小化 tools 配置示例:

```yaml
tools:
- name: helm-installer
instanceID: devlake
```
## 默认配置
| 配置项 | 默认值 | 描述 |
Expand Down
14 changes: 8 additions & 6 deletions docs/plugins/helm-installer/helm-installer.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ tools:
```
在这个配置文件里,和插件相关的配置 name 和 instanceID,前者表示你将使用 `helm-installer` 插件,后者表示插件实例名。
请注意这个 instanceID 使用了 "argocd-" 前缀,DevStream 会识别这个前缀,尝试寻找 Argo CD 应用对应的 Chart,并设置一系列默认值,然后开始部署。
请注意这个 instanceID 使用了 "argocd" 前缀,DevStream 会识别这个前缀,尝试寻找 Argo CD 应用对应的 Chart,并设置一系列默认值,然后开始部署。

你可以在 [Install Argo CD with DevStream](./argocd.zh.md) 中查看 DevStream 为你设置了哪些默认值。

Expand Down Expand Up @@ -47,6 +47,7 @@ tools:
chartName: ""
version: ""
namespace: ""
releaseName: ""
wait: true
timeout: 10m
upgradeCRDs: true
Expand All @@ -58,7 +59,7 @@ tools:
### 2.1、instanceID 使用技巧

instanceID 的前缀如果能够匹配到某个已经被支持的工具(详见文末列表),那么 DevStream 会为你设置一系列的默认值。
比如 "argocd-001" 的前缀 "argocd-" 能够匹配到 "argocd" + "-",因此 Argo CD 的默认 Chart 配置会被应用,于是如下最小化配置:
比如 "argocd-001" 的前缀 "argocd-" 能够匹配到 "argocd",因此 Argo CD 的默认 Chart 配置会被应用,于是如下最小化配置:

```yaml
tools:
Expand All @@ -74,13 +75,14 @@ tools:
dependsOn: [ ]
options:
repo:
name: ""
url: ""
name: "argo"
url: "https://argoproj.github.io/argo-helm"
chart:
chartPath: ""
chartName: ""
chartName: "argo/argo-cd"
version: ""
namespace: ""
namespace: "argocd"
releaseName: "argocd"
wait: true
timeout: 10m
upgradeCRDs: true
Expand Down
10 changes: 10 additions & 0 deletions docs/plugins/helm-installer/kube-prometheus.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Install kube-prometheus with DevStream

## InstanceID Prefix

The `instanceID` prefix must be `kube-prometheus`, the minimum tools configuration example:

```yaml
tools:
- name: helm-installer
instanceID: kube-prometheus
```
## Default Configs
| key | default value | description |
Expand Down
10 changes: 10 additions & 0 deletions docs/plugins/helm-installer/kube-prometheus.zh.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# 使用 DevStream 部署 kube-prometheus

## 前缀匹配

`instanceID` 的前缀需要是 `kube-prometheus`,最小化 tools 配置示例:

```yaml
tools:
- name: helm-installer
instanceID: kube-prometheus
```
## 默认配置
| 配置项 | 默认值 | 描述 |
Expand Down
10 changes: 10 additions & 0 deletions docs/plugins/helm-installer/openldap.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Install OpenLDAP with DevStream

## InstanceID Prefix

The `instanceID` prefix must be `openldap`, the minimum tools configuration example:

```yaml
tools:
- name: helm-installer
instanceID: openldap
```
### Default Configs
| key | default value | description |
Expand Down
10 changes: 10 additions & 0 deletions docs/plugins/helm-installer/openldap.zh.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# 使用 DevStream 部署 OpenLDAP

## 前缀匹配

`instanceID` 的前缀需要是 `openldap`,最小化 tools 配置示例:

```yaml
tools:
- name: helm-installer
instanceID: openldap
```
## 默认配置
| 配置项 | 默认值 | 描述 |
Expand Down
10 changes: 10 additions & 0 deletions docs/plugins/helm-installer/sonarqube.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Install SonarQube with DevStream

## InstanceID Prefix

The `instanceID` prefix must be `sonarqube`, the minimum tools configuration example:

```yaml
tools:
- name: helm-installer
instanceID: sonarqube
```
### Default Configs
| key | default value | description |
Expand Down
10 changes: 10 additions & 0 deletions docs/plugins/helm-installer/tekton.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Install Tekton with DevStream

## InstanceID Prefix

The `instanceID` prefix must be `tekton`, the minimum tools configuration example:

```yaml
tools:
- name: helm-installer
instanceID: tekton
```
## Default Configs
| key | default value | description |
Expand Down
10 changes: 10 additions & 0 deletions docs/plugins/helm-installer/tekton.zh.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# 使用 DevStream 部署 Tekton

## 前缀匹配

`instanceID` 的前缀需要是 `tekton`,最小化 tools 配置示例:

```yaml
tools:
- name: helm-installer
instanceID: tekton
```
## 默认配置
| 配置项 | 默认值 | 描述 |
Expand Down
10 changes: 10 additions & 0 deletions docs/plugins/helm-installer/vault.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Install Vault with DevStream

## InstanceID Prefix

The `instanceID` prefix must be `vault`, the minimum tools configuration example:

```yaml
tools:
- name: helm-installer
instanceID: vault
```
## Default Configs
| key | default value | description |
Expand Down
10 changes: 10 additions & 0 deletions docs/plugins/helm-installer/vault.zh.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# 使用 DevStream 部署 Vault

## 前缀匹配

`instanceID` 的前缀需要是 `vault`, 最小化 tools 配置示例:

```yaml
tools:
- name: helm-installer
instanceID: vault
```
## 默认配置
| 配置项 | 默认值 | 描述 |
Expand Down
1 change: 1 addition & 0 deletions docs/use-cases/helm-installer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Replacing Helm with DevStream Makes Application Deployment Easier
69 changes: 69 additions & 0 deletions docs/use-cases/helm-installer.zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# 用 DevStream 替代 Helm 让应用部署更加简单

helm-installer 插件实现了比 helm 更加简单和容易上手的方式来快速部署提供了 Helm Chart 的应用。

下面以 Argo CD 为例,介绍如何使用 DevStream 部署 Argo CD。

## 1 下载

进入你的工作目录,运行:

```shell
sh -c "$(curl -fsSL https://download.devstream.io/download.sh)"
```

!!! quote "可选"
你可以将 `dtm` 移到 PATH 中。例如:`mv dtm /usr/local/bin/`

更多安装方式详见[安装dtm](./install.zh.md)。

## 2 配置

创建一个 `config.yaml` 文件,内容如下:

```yaml title="config.yaml"
config:
state:
backend: local
options:
stateFile: devstream.state
tools:
- name: helm-installer
instanceID: argocd
```
其中 `instanceID` 为 "argocd",匹配了 "argocd" 前缀,DevStream 会识别这个前缀,尝试寻找 Argo CD 应用对应的 Chart,并设置一系列默认值,然后开始部署。

通过 DevStream 安装 Helm 应用,你不需要搜索/阅读应用的官方文档,也不需要依次运行 `helm repo add` 等命令。你只需要知道应用的名称,将其作为 `instanceID` 的前缀,然后运行即可。这里是 [DevStream 支持的所有应用列表及前缀对应关系](../plugins/helm-installer/helm-installer.zh.md#3)。

## 3 初始化

运行以下命令以下载相应的插件:

```shell
./dtm init -f config.yaml
```

## 4 应用

运行以下命令以安装 Argo CD:

```shell
./dtm apply -f config.yaml -y
```

<script id="asciicast-549701" src="https://asciinema.org/a/549701.js" async></script>

## 5 检查结果

运行以下命令,可以看到 Argo CD 已经安装成功:

```shell
kubectl get pods -n argocd
```

<script id="asciicast-549703" src="https://asciinema.org/a/549703.js" async></script>

## 6 更进一步

DevStream 除了通过提供默认配置来简化应用部署,还提供了完整的 Helm values 文件的配置能力,详见[自定义Chart配置](../plugins/helm-installer/helm-installer.zh.md#22-chart)
3 changes: 2 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ nav:
- GitOps:
- use-cases/gitops/*.md
- Reference:
- use-cases/reference/*.md
- use-cases/reference/*.md
- use-cases/helm-installer*.md
- Plugins:
- plugins/plugins-list*.md
- Helm Installer:
Expand Down

0 comments on commit 08a36b7

Please sign in to comment.