備忘録/にわかエンジニアが好きなように書く

個人的にとりあえず仕組みを知るためにとりあえず動くまで構築や動作をみただけの単なる操作ログです。個人用の備忘録となり、最新の導入手順は個別に確認してください。 ※変な内容や間違いを書いているなどありましたらコメントやご指摘いただけると幸いです。

Kubernetes Helmの導入

 

前提条件

CentOS7

kubernetes

Helm追加手順 ※マスターノードで実施

kubernetesバージョン

[root@k8s-master ~]# kubectl version
Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.1", GitCommit:"d4ab47518836c750f9949b9e0d387f20fb92260b", GitTreeState:"clean", BuildDate:"2018-04-12T14:26:04Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.1", GitCommit:"d4ab47518836c750f9949b9e0d387f20fb92260b", GitTreeState:"clean", BuildDate:"2018-04-12T14:14:26Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
[root@k8s-master ~]#

Helmバイナリファイルをダウンロード

[root@k8s-master ~]# curl -sL https://storage.googleapis.com/kubernetes-helm/helm-v2.9.0-rc4-linux-amd64.tar.gz > helm.tar.gz
[root@k8s-master ~]# tar -xzvf helm.tar.gz
linux-amd64/
linux-amd64/helm
linux-amd64/LICENSE
linux-amd64/README.md
[root@k8s-master ~]#

Helmバイナリファイルコピー

[root@k8s-master ~]# cp linux-amd64/helm /usr/local/bin

Helm init / リポジトリデータ更新

[root@k8s-master ~]# helm init
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.
For more information on securing your installation see: https://docs.helm.sh/using_helm/#securing-your-helm-installation
Happy Helming!
[root@k8s-master ~]#
[root@k8s-master ~]# helm repo update
Hang tight while we grab the latest from your chart repositories...
...Skip local chart repository
...Successfully got an update from the "stable" chart repository
Update Complete. ? Happy Helming!?
[root@k8s-master ~]#

 

Kubernetes pod/service確認

[root@k8s-master ~]# kubectl get pods --namespace=kube-system
NAME READY STATUS RESTARTS AGE
etcd-k8s-master 1/1 Running 0 3d
kube-apiserver-k8s-master 1/1 Running 0 3d
kube-controller-manager-k8s-master 1/1 Running 0 3d
kube-dns-86f4d74b45-4dtn7 3/3 Running 0 3d
kube-flannel-ds-b2vlt 1/1 Running 0 3d
kube-flannel-ds-jt5sf 1/1 Running 0 3d
kube-flannel-ds-ktr24 1/1 Running 0 3d
kube-flannel-ds-tqqgb 1/1 Running 0 3d
kube-proxy-9gx98 1/1 Running 0 3d
kube-proxy-n75hz 1/1 Running 0 3d
kube-proxy-qfqwz 1/1 Running 0 3d
kube-proxy-xpshl 1/1 Running 0 3d
kube-scheduler-k8s-master 1/1 Running 0 3d
tiller-deploy-75d848bb9-tjgdp 1/1 Running 0 1m
[root@k8s-master ~]# kubectl get service --namespace=kube-system
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kube-dns ClusterIP 10.96.0.10 <none> 53/UDP,53/TCP 3d
tiller-deploy ClusterIP 10.96.76.19 <none> 44134/TCP 1m
[root@k8s-master ~]#

Helmバージョン確認

Server側の表示はしばらく時間がかかります。

[root@k8s-master ~]# helm version
Client: &version.Version{SemVer:"v2.9.0-rc4", GitCommit:"030d2c066bcf5a37931e0169b7921f3758d97095", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.9.0-rc4", GitCommit:"030d2c066bcf5a37931e0169b7921f3758d97095", GitTreeState:"clean"}
[root@k8s-master ~]#

手順の参考先

github.com

docs.helm.sh