Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

아래와 같이 localhost에 등록된 모든 repo에서 influxdb chart를 찾는다.

Code Block
languagepy
$ helm search repo influxdb                                                                                                                                            
NAME                            CHART VERSION   APP VERSION     DESCRIPTION                                                                                                                   
bitnami/influxdb                1.0.0           1.8.3           InfluxDB is an open source time-series database...                                                                            
influxdata/influxdb             4.8.9           1.8.0           Scalable datastore for metrics, events, and rea...                                                                            
influxdata/influxdb-enterprise  0.1.12          1.8.0           Run InfluxDB Enterprise on Kubernetes                                                                                         
influxdata/influxdb2            1.0.11          2.0.0-rc        A Helm chart for InfluxDB v2                                                                                                  
stable/influxdb                 4.3.2           1.7.9           DEPRECATED Scalable datastore for metrics, even...                                                                            
bitnami/grafana                 4.0.2           7.3.3           Grafana is an open source, feature rich metrics...                                                                            
influxdata/kapacitor            1.3.1           1.5.4           InfluxDB's native data processing engine. It ca...                                                                            
stable/kapacitor                1.2.2           1.5.2           DEPRECATED InfluxDB's native data processing en...                                                                            
influxdata/chronograf           1.1.19          1.8.8           Open-source web application written in Go and R...                                                                            
influxdata/telegraf             1.7.32          1.16            Telegraf is an agent written in Go for collecti...                                                                            
influxdata/telegraf-operator    1.1.5           v1.1.1          A Helm chart for Kubernetes to deploy telegraf-...

Install Chart

to do기본적인 chart 설치 명령은 다음과 같다.

Code Block
languagepy
# Generate Release name.
$ helm install bitnami/nginx -n ns-test01 -g
# Specify Release name as "nginx-test".
$ helm install nginx-test bitnami/nginx -n ns-test01

Install Customized Chart

대부분의 경우 선호하는 구성을 사용하기 위해 차트를 커스터마이징 하게 될 것이다.

차트에 어떤 옵션이 구성 가능한지 보려면, helm show values를 사용한다.

Code Block
languagepy
$ helm show values bitnami/nginx
## Global Docker image parameters
## Please, note that this will override the image parameters, including dependencies, configured to use the global value
## Current available global Docker image parameters: imageRegistry and imagePullSecrets
##
# global:
#   imageRegistry: myRegistryName
#   imagePullSecrets:
#     - myRegistryKeySecretName

## Bitnami NGINX image version
## ref: https://hub.docker.com/r/bitnami/nginx/tags/
##
image:
  registry: docker.io
...
(omit)

## NGINX Service properties
##
service:
  ## Service type
  ##
  type: LoadBalancer

  ## HTTP Port
  ##
  port: 80

  ## HTTPS Port
  ##
  httpsPort: 443
...
(omit)

Using with --set 옵션

위에서 type: LoadBalancerNodePort로 변경하길 원한다면, 아래와 같이 설정할 수 있다.
(namespace 지정하지 않으면 default namespace로 지정된다.)

Code Block
languagepy
$ kubectl create ns ns-test01

$ helm install bitnami/nginx -n ns-test01 -g --set service.type=NodePort

# 확인
$ helm ls -n ns-test01
NAME                    NAMESPACE       REVISION        UPDATED                                 STATUS          CHART           APP VERSION
nginx-1606192435        ns-test01       1               2020-11-24 13:33:57.905368836 +0900 KST deployed        nginx-8.1.0     1.19.4

# svc 확인
$ kubectl get svc -n ns-test01
NAME               TYPE       CLUSTER-IP     EXTERNAL-IP   PORT(S)        AGE
nginx-1606192435   NodePort   10.100.99.47   <none>        80:31639/TCP   95m

Using with --values(or -f) 옵션

Code Block
languagepy
# Make yaml file with overrides.
$ vim config.yaml
service:
  type: NodePort

$ helm install -g -n ns-test01 -f config.yaml bitnami/nginx

# 확인
$ helm ls -n ns-test01
NAME                    NAMESPACE       REVISION        UPDATED                                 STATUS          CHART           APP VERSION
nginx-1606192435        ns-test01       1               2020-11-24 13:33:57.905368836 +0900 KST deployed        nginx-8.1.0     1.19.4
nginx-1606197987        ns-test01       1               2020-11-24 15:06:30.102370781 +0900 KST deployed        nginx-8.1.0     1.19.4

# svc 확인
$ kubectl get svc -n ns-test01
NAME               TYPE       CLUSTER-IP     EXTERNAL-IP   PORT(S)        AGE
nginx-1606192435   NodePort   10.100.99.47   <none>        80:31639/TCP   95m
nginx-1606197987   NodePort   10.96.87.201   <none>        80:30435/TCP   3m8s

--set--values(or -f)를 지정하는 자세한 가이드는 Helm 공식 가이드(링크)를 참고하도록 한다.

Via Download Chart package

위 섹션들에서와 같이 설치를 원하는 chart의 내용을 조회 후, --set 등을 통해 설치할 수도 있지만, helm pull 명령을 통해 chart package를 다운로드 후 직접 수정하여 설치할 수도 있다.

Code Block
languagepy
$ helm pull bitnami/nginx
$ ls
nginx-8.1.0.tgz
$ tar xzf nginx-8.1.0.tgz
$ cd nginx
$ ls -l
total 76
-rw-r--r--. 1 root root   219 Nov 18 23:45 Chart.lock
drwxr-xr-x. 3 root root    20 Nov 23 13:25 charts
-rw-r--r--. 1 root root   599 Nov 18 23:45 Chart.yaml
drwxr-xr-x. 2 root root    84 Nov 23 13:25 ci
-rw-r--r--. 1 root root 38884 Nov 18 23:45 README.md
drwxr-xr-x. 2 root root  4096 Nov 23 13:25 templates
-rw-r--r--. 1 root root  1880 Nov 18 23:45 values.schema.json
-rw-r--r--. 1 root root 19786 Nov 23 13:58 values.yaml

위에 압축 해제된 파일들 중 원하는(보통의 경우 values.yaml이 될 것이다) 파일을 수정하여, 아래 명령으로 설치하면 된다.

Code Block
languagepy
# bitnami/nginx 대신 ./nginx로 지정.
$ helm install -g -n ns-test01 ./nginx