YJWANG

How to set Helm on Kubernetes (helm v2) 본문

60.Cloud/80.Kubernetes

How to set Helm on Kubernetes (helm v2)

왕영주 2021. 1. 11. 10:04

Refer to


Install Helm Client


아래에서 소개된 방법 외에도 Helm 공식 문서 통해서 추가로 확인할 수 있다.

From script

[root@master01 helm]# curl -LO https://git.io/get_helm.sh
[root@master01 helm]# chmod +x get_helm.sh 
[root@master01 helm]# ./get_helm.sh 

From pre-built
아래 링크에서 tar 파일 다운로드

https://github.com/helm/helm/releases

[root@master01 helm]# wget https://get.helm.sh/helm-v3.5.0-rc.2-linux-amd64.tar.gz
[root@master01 helm]# tar -xvzf helm-v3.5.0-rc.2-linux-amd64.tar.gz linux-amd64/  
[root@master01 helm]# mv linux-amd64/helm /usr/local/bin/helm  
[root@master01 helm]# ls -l /usr/local/bin/helm
rwxr-xr-x 1 3434 3434 39743488 1월 6 18:08 /usr/local/bin/helm
[root@master01 helm]# helm help

Install Tiller Server


Set RBAC

[root@master01 tiller\]# cat rbac-config.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

-

[root@master01 tiller\]# kubectl apply -f rbac-config.yaml  
    serviceaccount/tiller created  
    clusterrolebinding.rbac.authorization.k8s.io/tiller created

-

[root@master01 tiller\]# helm init --service-account tiller  
    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://charts.helm.sh/stable](https://charts.helm.sh/stable)  
    Adding local repo with URL: [http://127.0.0.1:8879/charts](http://127.0.0.1:8879/charts)

-

Few of helm commands


[root@master01 tiller]# helm search tomcat
NAME             CHART VERSION    APP VERSION    DESCRIPTION                                                 
stable/tomcat    0.4.3            7.0            DEPRECATED - Deploy a basic tomcat application server wit...

[root@master01 tiller]# helm repo list
NAME      URL                          
stable    https://charts.helm.sh/stable
local     http://127.0.0.1:8879/charts 

[root@master01 tiller]# helm inspect values stable/tomcat

[root@master01 tiller]# helm install stable/tomcat -n tomcat1

[root@master01 tiller]# cat config.yaml 
service:
        type: NodePort

[root@master01 tiller]# helm install stable/tomcat -n tomcat2 -f config.yaml 
반응형