Table of Contents
이 문서는 Kubernetes 의 Helm 설치에 대해 다룬다.
Helm 은 Kubernetes 에서 작동하는 많은 Application 들을 손쉽게 설치하도록 도와주는 프로그램이다. 마치 Ubuntu 의 APT 나 CentOS 의 Yum 이 프로그램 설치를 손쉽게 해주는것과 같다.
Helm
Helm 은 Client – Server 로 구성된다.
Client 는 CLI 명령어를 말하며 플랫폼마다 바이너리로 배포된다. 따라서 다운로드 받아서 압축을 풀면 바로 사용할 수 있다.
Server 는 Tiller 라고 불리운다. 이것은 Kubernetes 상에서 작동되는데 Deploy 해서 설치하면 된다.
Helm Client
Helm 클라이언트는 GitHub 에서 다운로드가 가능하다.
]$ wget https://get.helm.sh/helm-v2.16.6-linux-amd64.tar.gz ]$ tar xvzf helm-v2.16.6-linux-amd64.tar.gz ]$ sudo cp linux-amd64/tiller /usr/local/bin ]$ sudo cp linux-amd64/helm /usr/local/bin ]$ sudo chown root:docker /usr/local/bin/tiller ]$ sudo chown root:docker /usr/local/bin/helm
다음과 같이 설치가 잘되었는지 확인한다.
]$ helm version
Client: &version.Version{SemVer:"v2.16.6", GitCommit:"dd2e5695da88625b190e6b22e9542550ab503a47", GitTreeState:"clean"}
Error: could not find tiller
Helm Server – Tiller
Tiller 를 설치하기 위해서 서비스 계정을 생성하고 cluster-admin Role 을 생성해 준다. 이는 CLI 로 생성하거나 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 rbac-tiller.yaml serviceaccount/tiller created clusterrolebinding.rbac.authorization.k8s.io/tiller created
이제 Tiller 를 설치해 준다.
$ helm init --service-account tiller
Creating /home/systemv/.helm
Creating /home/systemv/.helm/repository
Creating /home/systemv/.helm/repository/cache
Creating /home/systemv/.helm/repository/local
Creating /home/systemv/.helm/plugins
Creating /home/systemv/.helm/starters
Creating /home/systemv/.helm/cache/archive
Creating /home/systemv/.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 /home/systemv/.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://v2.helm.sh/docs/securing_installation/
이제 다시 helm client 를 실행해보자.
]$ helm version
Client: &version.Version{SemVer:"v2.16.6", GitCommit:"dd2e5695da88625b190e6b22e9542550ab503a47", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.16.6", GitCommit:"dd2e5695da88625b190e6b22e9542550ab503a47", GitTreeState:"clean"}
이제 helm 의 저장소를 최신판으로 업데이트를 해보자.
]$ helm repo update