共計(jì) 3320 個(gè)字符,預(yù)計(jì)需要花費(fèi) 9 分鐘才能閱讀完成。
這篇文章主要介紹了 Helm 管理工具怎么用,具有一定借鑒價(jià)值,感興趣的朋友可以參考下,希望大家閱讀完這篇文章之后大有收獲,下面讓丸趣 TV 小編帶著大家一起了解一下。
一 Helm 簡介
Helm:
chart: 一個(gè) helm 程序包
Repository: Charts 倉庫,https/http 服務(wù)器
Release:特定的 chart 部署于目標(biāo)集群上的一個(gè)實(shí)例
Chart – Config – Release
helm: 客戶端。管理本地 Chart 倉庫,管理 Chart,與 Tiller 服務(wù)器交互,發(fā)送 Chart,實(shí)例安裝,查詢,卸載等操作
Tiller:服務(wù)端,接收 helm 發(fā)來的 Chart 與 Config, 合并生成 Release
二 部署 Helm
1 下載 helm
wget https://storage.googleapis.com/kubernetes-helm/helm-v2.13.1-linux-amd64.tar.gz
2 解壓
tar xf helm-v2.13.1-linux-amd64.tar.gz
3 安裝 helm
cd linux-amd64/
mv helm /usr/bin/
# helm version
Client: version.Version{SemVer: v2.13.1 , GitCommit: 618447cbf203d147601b4b9bd7f8c37a5d39fbb4 , GitTreeState: clean}
Error: could not find tiller
4 安裝 tiller
部署 tiller 對于開啟 rbac 認(rèn)真的集群需要進(jìn)行 rbac 授權(quán)并且綁定在集群級(jí)別的 clusterrolebinding
# cat tiller-rbac.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: tiller
namespace: kube-system
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: tiller
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: tiller
namespace: kube-system
kubectl apply -f tiller-rbac.yaml
如果想要部署在特定的名稱該空間使用請參考官網(wǎng)
https://github.com/helm/helm/blob/master/docs/rbac.md
查看 tiller
# kubectl get serviceaccount -n kube-system | grep tiller
tiller 1 4m25s
5 初始化 tiller
helm init --service-account tiller --history-max 200
Creating /root/.helm
Creating /root/.helm/
repository
Creating /root/.helm/
repository/cache
Creating /root/.helm/
repository/local
Creating /root/.helm/
plugins
Creating /root/.helm/
starters
Creating /root/.helm/
cache/archive
Creating /root/.helm/
repository/repositories.yaml
Adding stable repo with URL: https://kubernetes-charts.storage.googleapis.com
Adding local repo with URL: http://127.0.0.1:8879/charts
$HELM_HOME has been configured at /root/.helm.
Tiller (the Helm server-side component) has been installed into your Kubernetes Cluster.
Please note: by default, Tiller is deployed with an insecure allow unauthenticated users policy.
To prevent this, run `helm init` with the --tiller-tls-verify flag.
For more information on securing your installation see: https://docs.helm.sh/using_helm/#securing-your-helm-installation
Happy Helming!
可以預(yù)先設(shè)置下載 proxy
export HTTPS_PROXY= http://www.ik8s.io:10080
如果提示失敗并且是連接 https://ip:6443 超時(shí)可以通過設(shè)置環(huán)境變量
export NO_PROXY= 節(jié)點(diǎn) ip/16, 回環(huán)地址 /16
再次安裝
6 查看 tiller
# kubectl get pod -n kube-system | grep tiller
tiller-deploy-876ff889-jjfn9 1/1 Running 0 4m29s
# helm version
Client: version.Version{SemVer: v2.13.1 , GitCommit: 618447cbf203d147601b4b9bd7f8c37a5d39fbb4 , GitTreeState: clean}
Server: version.Version{SemVer: v2.13.1 , GitCommit: 618447cbf203d147601b4b9bd7f8c37a5d39fbb4 , GitTreeState: clean}
7 helm chart 官方可用倉庫
1) helm.sh
2) hub.kubeapps.com
8 升級(jí)倉庫
helm repo update
9 helm 基本使用
1) 查看 某 chart
# helm search jenkins
NAME CHART VERSION APP VERSION DESCRIPTION
stable/jenkins 1.1.16 lts Open source continuous integration server. It supports mu...
2) 查看 chart 的詳細(xì)信息
helm inspect stable/jenkins
3) 安裝某應(yīng)用
helm install --name memcached stable/memcached
4) 卸載某個(gè)應(yīng)用
helm delete memcached
5) 查看應(yīng)用列表
helm list
6) 獲取 chart
helm get/fatch stable/jenkins
7) 歷史管理
helm history memcached
8) 創(chuàng)建 chart
helm create ..
9) 打包
helm package ..
10) 回滾
helm rollback ...
11) 查看 helm 版本
helm version
12) 查看狀態(tài)
helm status
...... 通過 helm --help 獲取
10 helm 家目錄
家目錄主要查看我們使用過的 chart
/root/.helm/
感謝你能夠認(rèn)真閱讀完這篇文章,希望丸趣 TV 小編分享的“Helm 管理工具怎么用”這篇文章對大家有幫助,同時(shí)也希望大家多多支持丸趣 TV,關(guān)注丸趣 TV 行業(yè)資訊頻道,更多相關(guān)知識(shí)等著你來學(xué)習(xí)!