Skip to content

Commit

Permalink
取消helms别名
Browse files Browse the repository at this point in the history
  • Loading branch information
gjmzj committed Nov 25, 2018
1 parent a71ddd2 commit 47a8049
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
8 changes: 4 additions & 4 deletions docs/guide/helm.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ $ ansible-playbook /etc/ansible/roles/helm/helm.yml
- 4-创建tiller专用的RBAC配置,只允许helm在指定的namespace查看和安装应用
- 5-安全安装tiller到集群,tiller服务启用tls验证
- 6-配置helm客户端使用tls方式与tiller服务端通讯
- 7-创建helms命令别名,方便使用,即alias helms='helm --tls --tiller-namespace {{ helm_namespace }}'

注:helms别名生效请执行:`source ~/.bashrc`,或者退出后重新登陆shell
- 使用`helms`执行与tiller服务有关的命令,比如 `helms ls` `helms version` `helms install`
- 使用`helm`执行其他命令,比如`helm search` `helm fetch` `helm home`
### 注意因使用了TLS认证,所以helm命令执行分以下两种情况

- 执行与tiller服务有关的命令,比如 `helm ls` `helm version` `helm install`等需要加`--tls`参数
- 执行其他命令,比如`helm search` `helm fetch` `helm home`等不需要加`--tls`

## 使用helm安装应用到k8s上

Expand Down
2 changes: 1 addition & 1 deletion docs/guide/jenkins.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Error: transport is closing
```
请执行以下命令快速安装进行修复:
```
helms install manifests/jenkins/ --name jenkins
helm install --tls manifests/jenkins/ --name jenkins
```

由于初始化过程中,默认安装指定的插件,所以启动较慢,大概5-10分钟左右就可以启动完成了。
Expand Down
18 changes: 9 additions & 9 deletions docs/guide/prometheus.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ drwx------ 3 root root 4096 Jun 2 21:39 prometheus/
``` bash
$ source ~/.bashrc
$ cd /etc/ansible/manifests/prometheus
# 安装 prometheus chart,如果你的helm安装没有启用tls证书,请使用helm命令替换以下的helms命令
$ helms install \
# 安装 prometheus chart,如果你的helm安装没有启用tls证书,请忽略--tls参数
$ helm install --tls \
--name monitor \
--namespace monitoring \
-f prom-settings.yaml \
-f prom-alertsmanager.yaml \
-f prom-alertrules.yaml \
prometheus
# 安装 grafana chart
$ helms install \
$ helm install --tls \
--name grafana \
--namespace monitoring \
-f grafana-settings.yaml \
Expand Down Expand Up @@ -81,23 +81,23 @@ monitor-prometheus-server NodePort 10.68.248.94 <none>
- 升级(修改配置):修改配置请在`prom-settings.yaml` `prom-alertsmanager.yaml` 等文件中进行,保存后执行:
``` bash
# 修改prometheus
$ helms upgrade monitor -f prom-settings.yaml -f prom-alertsmanager.yaml -f prom-alertrules.yaml prometheus
$ helm upgrade --tls monitor -f prom-settings.yaml -f prom-alertsmanager.yaml -f prom-alertrules.yaml prometheus
# 修改grafana
$ helms upgrade grafana -f grafana-settings.yaml -f grafana-dashboards.yaml grafana
$ helm upgrade --tls grafana -f grafana-settings.yaml -f grafana-dashboards.yaml grafana
```
- 回退:具体可以参考`helm help rollback`文档
``` bash
$ helms rollback monitor [REVISION]
$ helm rollback --tls monitor [REVISION]
```
- 删除
``` bash
$ helms del monitor --purge
$ helms del grafana --purge
$ helm del --tls monitor --purge
$ helm del --tls grafana --purge
```

## 验证告警

- 修改`prom-alertsmanager.yaml`文件中邮件告警为有效的配置内容,并使用 helms upgrade更新安装
- 修改`prom-alertsmanager.yaml`文件中邮件告警为有效的配置内容,并使用 helm upgrade更新安装
- 查看`prom-alertrules.yaml`文件,确认文件中设置了内存使用超过90%的告警规则
- 部署测试应用,并压力测试使其内存超过90%,看是否触发告警并发送告警邮件
``` bash
Expand Down
4 changes: 2 additions & 2 deletions docs/practice/es_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ kube-system nfs-provisioner-01-6b7fbbf9d4-bh8lh 1/1 Running 0

``` bash
$ cd /etc/ansible/manifests/es-cluster
# 如果你的helm安装没有启用tls证书,请使用helm命令替换以下的helms命令
$ helms install --name es-cluster --namespace elastic -f es-values.yaml elasticsearch
# 如果你的helm安装没有启用tls证书,请忽略以下--tls参数
$ helm install --tls --name es-cluster --namespace elastic -f es-values.yaml elasticsearch
```

- 4.验证 es 集群
Expand Down
2 changes: 1 addition & 1 deletion roles/helm/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
regexp: 'helm completion'
line: 'source <(helm completion bash)'

# 为方便与tiller进行安全通信,使用helms别名
# (DEPRECATED) 为方便与tiller进行安全通信,使用helms别名;helm v2.11.0 无法使用这个别名方式
#- name: 配置helm命令别名
# lineinfile:
# dest: ~/.bashrc
Expand Down

0 comments on commit 47a8049

Please sign in to comment.