fix helm脚本与文档

pull/206/merge
gjmzj 2018-05-26 17:55:28 +08:00
parent 5a62ce8dbf
commit 2c6419a523
2 changed files with 12 additions and 8 deletions

View File

@ -32,9 +32,10 @@ Error: cannot connect to Tiller
上述安装的tiller服务器默认允许匿名访问那么k8s集群中的任何pod都能访问tiller风险较大因此需要在helm客户端和tiller服务器间建立安全的SSL/TLS认证机制tiller服务器和helm客户端都是使用同一CA签发的`client cert`,然后互相识别对方身份。建议通过本项目提供的`ansible role`安装符合官网上介绍的安全加固措施在delpoy节点运行:
``` bash
# 如果已安装非安全模式,使用 helm reset 清理
$ cd /etc/ansible/roles/helm
$ ansible-playbook helm.yml
# 1.如果已安装非安全模式,使用 helm reset 清理
# 2.配置默认helm参数 vi /etc/ansible/roles/helm/defaults/main.yml
# 3.执行安装
$ ansible-playbook /etc/ansible/roles/helm/helm.yml
```
简单介绍下`/roles/helm/tasks/main.yml`中的步骤
@ -45,10 +46,12 @@ $ ansible-playbook helm.yml
- 4-创建tiller专用的RBAC配置只允许helm在指定的namespace查看和安装应用
- 5-安全安装tiller到集群tiller服务启用tls验证
- 6-配置helm客户端使用tls方式与tiller服务端通讯
- 7-创建helm命令别名方便使用即alias helm='helm --tls --tiller-namespace {{ helm_namespace }}'
- 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`
helm别名生效请执行`source ~/.bashrc`或者退出后重新登陆shell
## 使用helm安装应用到k8s上

View File

@ -53,9 +53,10 @@
regexp: 'helm completion'
line: 'source <(helm completion bash)'
# 为方便与tiller进行安全通信使用helms别名
- name: 配置helm命令别名
lineinfile:
dest: ~/.bashrc
state: present
regexp: "alias helm"
line: "alias helm='helm --tls --tiller-namespace {{ helm_namespace }}'"
regexp: "alias helms"
line: "alias helms='helm --tls --tiller-namespace {{ helm_namespace }}'"