1. 程式人生 > >使用指令碼在Linux伺服器上自動安裝Kubernetes的包管理器Helm

使用指令碼在Linux伺服器上自動安裝Kubernetes的包管理器Helm

Helm之於Kubernetes好比yum之於Red Hat Enterprise Linux,或者apt-get之於Ubuntu。

Helm是由helm CLI和Tiller組成,是典型的Client/Server應用。helm運行於客戶端,提供命令列介面;Tiller應用運行於Kubernetes內部。

在Jerry之前的文章裡曾經介紹過手動下載Helm安裝包,解壓後把執行檔案拷貝到環境變數的做法。

其實還有另外一種全自動的做法,使用安裝指令碼自動安裝。

1. 自動下載安裝指令碼

curl https://raw.githubusercontent.com/helm/helm/master/scripts/get

> get_helm.sh

開啟指令碼,可以看到helm安裝的環境變數HELM_INSTALL_DIR為/usr/local/bin:

2. chmod 700 get_helm.sh

./get_helm.sh:

3. 執行helm init, 看到Happy Helming訊息,說明安裝成功。

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!

要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":