SlideShare a Scribd company logo
1 of 51
Digging into Helm
윤상준
2018.10
sj.yun@sk.com
Step
Helm 개념
Helm 사용
Helm 개발
Helm 호스팅
Helm 운영
Helm?
Helm?
“Helm is the best way to find, share, and use software built for Kubernetes”
[https://helm.sh]
Helm
● Kubernetes를 위한 패키지 관리 툴
//Kubetnetes
$ helm install stable/mysql
//Homebrew
$ brew install mysql
//Apt
$ apt-get install mysql-server
//Yum
$ yum install mysql-server
Chart
● Helm에서 애플리케이션 패키징을 하기 위해 사용하는 형식
● Chart는 Kubernetes resource의 집합
Helm Features
//Helm
$ helm install stable/mysql
MySQL
Server
(Deployment)
Persistent
Volume
(PVC)
/etc/mysql/conf.d
(Configmap)
Password
(Secret)
Access
Endpoint
(Service)
//Kubernetes yaml
$ kubectl create -f deployment.yaml
$ kubectl create -f svc.yaml
$ kubectl create -f pvc.yaml
$ kubectl create -f secret.yaml
$ kubectl create -f configmap.yaml
#1 Manage Complexity
#2 Easy Updates
● Upgrade 명령을 사용하여 설정이나 버전을 쉽게 업데이트
$ helm upgrade mysql-release stable/mysql 
--set mysqlRootPassword="password"
$ helm upgrade mysql-release stable/mysql 
--version x.x.x
#3 Simple Sharing
$ helm package demoPackage
Share
Download
$ mv demo-0.1.0.tgz stable
$ helm repo index stable --url https://example.github.io/my-charts/stable
$ helm repo add my-charts https://example.github.io/my-charts
$ helm install my-charts/demo
#4 Rollback
● Rollback 명령을 사용하여 이전 버전 또는 특정 버전으로 쉽게 복구
$ helm history
REVISION UPDATED STATUS CHART DESCRIPTION
1 Thu Aug 15 00:49:37 2018 SUPERSEDED mysql-5.0.1
Install complete
...
10 Thu Aug 16 00:49:37 2018 DEPLOYED mysql-5.0.10
Upgrade complete
$ helm rollback mysql [REVISION_NUMBER]
Helm 사용하기
5
#1 Search
#2 Install
#3 Upgrade
#4 Rollback
#5 Delete
#1 Search
● Helm을 최초 설치하면 Kubernetes official repository에 기본적으로 연동
$ helm repo list
NAME URL
stable https://kubernetes-charts.storage.googleapis.com
local http://127.0.0.1:8879/charts
$ helm search
NAME CHART VERSION APP VERSION DESCRIPTION
stable/wordpress 2.1.10 4.9.8 Web publishing platform for building...
stable/jenkins 0.16.19 2.121.2 Open source continuous integration...
stable/mariadb 4.3.3 10.1.35 Fast, reliable, scalable, and easy to...
stable/mysql 0.8.3 5.7.14 Fast, reliable, scalable, and easy to...
…
$ helm search mysql
NAME CHART VERSION APP VERSION DESCRIPTION
stable/mysql 0.8.3 5.7.14 Fast, reliable, scalable, and easy...
stable/mysqldump 0.1.0 5.7.21 A Helm chart to help backup...
stable/mariadb 4.3.3 10.1.35 Fast, reliable, scalable, and easy...
#1 Search
● Inspect 명령으로 상세 정보 출력
$ helm inspect stable/mariadb
appVersion: 10.1.35
description: Fast, reliable, scalable, and easy to use open-source relational database
system. MariaDB Server is intended for mission-critical, heavy-load production systems
as well as for embedding into mass-deployed software. Highly available MariaDB cluster.
engine: gotpl
home: https://mariadb.org
icon: https://bitnami.com/assets/stacks/mariadb/img/mariadb-stack-220x234.png
keywords:
- mariadb
- mysql
- database
- sql
- prometheus
#2 Install
● Install 명령으로 원하는 chart를 바로 설치
# helm install [REPO_NAME/CHART_NAME] --name [RELEASE_NAME] --namespace [NAMESPACE]
$ helm install stable/mariadb
NAME: willing-armadillo
LAST DEPLOYED: Mon Oct 1 15:01:04 2018
NAMESPACE: default
STATUS: DEPLOYED
RESOURCES:
==> v1/Secret
NAME TYPE DATA AGE
willing-armadillo-mariadb Opaque 2 0s
==> v1/ConfigMap
NAME DATA AGE
willing-armadillo-mariadb-master-init-scripts 1 0s
...
==> v1/Service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
willing-armadillo-mariadb ClusterIP 10.3.255.79 <none> 3306/TCP 0s
...
==> v1beta1/StatefulSet
NAME DESIRED CURRENT AGE
willing-armadillo-mariadb-master 1 0 0s
willing-armadillo-mariadb-slave 1 0 0s
#2 Install
● Notes에 애플리케이션을 사용하기 위한 가이드 출력
...
NOTES:
Please be patient while the chart is being deployed
Tip:
Watch the deployment status using the command: kubectl get pods -w --namespace default -l release=willing-armadillo
...
Administrator credentials:
Username: root
Password : $(kubectl get secret --namespace default willing-armadillo-mariadb -o jsonpath="{.data.mariadb-root-
password}" | base64 --decode)
To connect to your database
1. Run a pod that you can use as a client:
kubectl run willing-armadillo-mariadb-client --rm --tty -i --image docker.io/bitnami/mariadb:10.1.35-debian-9 --
namespace default --command -- bash
2. To connect to master service (read/write):
mysql -h willing-armadillo-mariadb.default.svc.cluster.local -uroot -p my_database
…
$ kubectl get secret --namespace default willing-armadillo-mariadb -o jsonpath="{.data.mariadb-root-password}" | base64 --
decode
JYHQDJY7Im
#3 Upgrade
● Upgrade 명령을 통해 설정이나 버전을 업데이트
$ helm list
NAME REVISION UPDATED STATUS CHART
NAMESPACE
willing-armadillo 1 Mon Oct 1 15:01:04 2018 DEPLOYED mariadb-4.3.3 default
$ helm upgrade willing-armadillo --set rootUser.password=”admin” stable/mariadb
Release "willing-armadillo" has been upgraded. Happy Helming!
LAST DEPLOYED: Mon Oct 1 15:42:55 2018
NAMESPACE: default
STATUS: DEPLOYED
…
Administrator credentials:
Username: root
Password : $(kubectl get secret --namespace default willing-armadillo-mariadb -o jsonpath="{.data.mariadb-root-
password}" | base64 --decode)
…
$ kubectl get secret --namespace default willing-armadillo-mariadb -o jsonpath="{.data.mariadb-root-password}" |
base64 --decode
”admin”
#4 Rollback
● Rollback 명령을 사용하여 이전 버전 또는 특정 버전으로 쉽게 복구
$ helm list
NAME REVISION UPDATED STATUS CHART NAMESPACE
willing-armadillo 2 Mon Oct 1 15:42:55 2018 DEPLOYED mariadb-4.3.3 default
$ helm history willing-armadillo
REVISION UPDATED STATUS CHART DESCRIPTION
1 Mon Oct 1 15:01:04 2018 SUPERSEDED mariadb-4.3.3 Install complete
2 Mon Oct 1 15:42:55 2018 DEPLOYED mariadb-4.3.3 Upgrade complete
$ helm rollback willing-armadillo 1
Rollback was a success! Happy Helming!
$ helm history willing-armadillo
REVISION UPDATED STATUS CHART DESCRIPTION
1 Mon Oct 1 15:01:04 2018 SUPERSEDED mariadb-4.3.3 Install complete
2 Mon Oct 1 15:42:55 2018 SUPERSEDED mariadb-4.3.3 Upgrade complete
3 Mon Oct 1 16:18:04 2018 DEPLOYED mariadb-4.3.3 Rollback to 1
$ kubectl get secret --namespace default willing-armadillo-mariadb -o jsonpath="{.data.mariadb-root-password}" | base64 --
decode
JYHQDJY7Im
#5 Delete
● Delete 명령을 사용하여 설치된 Kubernetes 리소스 삭제
$ helm list
NAME REVISION UPDATED STATUS CHART NAMESPACE
willing-armadillo 2 Mon Oct 1 15:42:55 2018 DEPLOYED mariadb-4.3.3 default
# “--purge” 옵션을 주면 release name 까지 삭제. 아니면 list에는 남아있음.
$ helm del --purge willing-armadillo
release "willing-armadillo" deleted
# StatefulSet에서 “volumeClaimTemplates”을 통해 생성된 volume은 helm 삭제 후에도 남아있음. (make by design)
# https://github.com/helm/charts/blob/master/stable/mariadb/templates/master-statefulset.yaml
$ kubectl get pvc
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
data-w...-mariadb-master-0 Bound pvc-d24.. 8Gi RWO standard 1h
data-w...-mariadb-slave-0 Bound pvc-d25.. 8Gi RWO standard 1h
[참고] Helm & Tiller 설치
● Helm을 사용하기 위해서는 Tiller와 Helm Client를 설치 필요
○ Tiller : Helm의 서버로 일반적으로 Kubernetes cluster에 설치
○ Helm client : Helm 명령어를 실행하기 위한 CLI
● 설치 방법은 아래 블로그 참고
○ https://yunsangjun.github.io/blog/helm/2018/05/27/installing-helm.html
Helm Chart 만들기
Helm chart 생성 및 구조 #1
● Create 명령으로 Helm chart sample 생성
# helm create [CHART_NAME]
$ helm create demo
Creating demo
demo/
.helmignore # 형상관리에서 제외할 파일이나 디렉토리 목록
Chart.yaml # Chart의 정보를 저장
charts # 이 chart에서 의존성을 가지고 있는 chart가 위치
templates # Kubernetes 리소스의 템플릿 파일(deployment, service, ingress 등의 yaml)
values.yaml # 이 helm chart의 기본 설정 값을 저장. templates yaml 파일에서 사용
● Sample chart 구조
Helm chart 생성 및 구조 #2
● values.yaml 과 templates 구조
$ cat values.yaml
replicaCount: 1
image:
repository: nginx
tag: stable
pullPolicy: IfNotPresent
nameOverride: ""
fullnameOverride: ""
service:
type: ClusterIP
port: 80
ingress:
enabled: false
...
$ cat templates/service.yaml
apiVersion: v1
kind: Service
metadata:
name: {{ include "demo.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "demo.name" . }}
helm.sh/chart: {{ include "demo.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
app.kubernetes.io/name: {{ include "demo.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
Helm chart validation
● Lint 명령으로 Helm chart의 문법적인 오류 체크
$ helm lint demo
==> Linting ./
[INFO] Chart.yaml: icon is recommended
[ERROR] templates/: render error in "demo/templates/deployment.yaml": template:
demo/templates/deployment.yaml:11:22: executing "demo/templates/deployment.yaml" at
<.Values.replica.coun...>: can't evaluate field count in type interface {}
Error: 1 chart(s) linted, 1 chart(s) failed
$ cat demo/templates/deployment.yaml
...
spec:
replicas: {{ .Values.replica.count }} => .Values.replicaCount로 수정 필요
$ cat demo/values.yaml
...
replicaCount: 1
Helm chart package
● Package 명령으로 Helm chart package
$ ls -all
total 3
drwxr-xr-x 7 sangjunyun staff 224 10 3 15:56 .
drwxr-xr-x 41 sangjunyun staff 1312 10 3 11:49 ..
drwxr-xr-x 7 sangjunyun staff 224 10 3 12:01 demo
$ helm package demo
Successfully packaged chart and saved it to: PATH/demo-0.1.0.tgz
$ ls -all
total 3
drwxr-xr-x 7 sangjunyun staff 224 10 3 15:56 .
drwxr-xr-x 41 sangjunyun staff 1312 10 3 11:49 ..
drwxr-xr-x 7 sangjunyun staff 224 10 3 12:01 demo
-rw-r--r-- 1 sangjunyun staff 2608 10 3 12:01 demo-0.1.0.tgz
Helm chart template
● Template 명령으로 Kubernetes 리소스 파일이 어떻게 생성될 지 미리 확인
$ helm template demo > output.yaml
$ cat output.yaml
---
# Source: demo/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
name: RELEASE-NAME-demo
..
---
# Source: demo/templates/deployment.yaml
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: RELEASE-NAME-demo
...
Helm chart simulate
● Install 명령에 “--dry-run --debug” 옵션을 붙여 Helm install 시뮬레이션
$ helm install demo --dry-run --debug
...
NAME: lame-sasquatch
…
---
# Source: demo/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
name: lame-sasquatch-demo
…
---
# Source: demo/templates/deployment.yaml
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: lame-sasquatch-demo
…
Helm Chart 호스팅하기
Helm chart repository
● 내가 만든 Helm chart를 다른 사용자에게 공유하기 위해서는 Helm repository
가 필요
● Official repository(https://github.com/helm/charts)에 Contribution하는 방법과
자체 repository를 사용하는 두 가지 방식 있음
● 자체 repository는 크게 3가지 형태로 지원(웹 서버 기능 필요)
○ Github Pages
○ Object Storage(GCS, AWS S3, ICOS 등)
○ Ordinary Web Servers(Nginx, Apache)
Helm chart repository with Github Pages #1
● 쉽고 무료로 사용할 수 있는 방법
● Github Pages는 웹 서버 기능을 지원함
1. Github에 Repository 생성(여기서는 my-charts라고 가정)
2. Github Page 설정
Repository -> Settings -> Github Pages > Source > master branch 선택 > Save 선택
(설정 완료 후 나타나는 https://example.github.io/my-charts/ 주소가 웹 서버 주소
Helm chart repository with Github Pages #2
3. git repository checkout 및 stable 디렉토리 생성
$ git checkout https://github.com/example/my-charts.git
$ cd my-charts & mkdir stable
4. helm 파일을 stable 디렉토리에 복사(앞에서 생성한 demo-0.1.0.tgz 사용)
$ mv FILE_PATH/demo-0.1.0.tgz stable
5. Index 파일 생성. stable 디렉토리 하위에 index.yaml 파일 생성됨
# helm repo index [INDEX_FILE_PATH] --url [CHART_REPO_URL]
$ helm repo index stable --url https://example.github.io/my-charts/stable
6. 변경사항 git에 commit
$ git add --all & git commit -m 'init' & git push origin master
7. Chart repository 주소에 접속해 index 파일 확인
https://example.github.io/my-charts/stable/index.yaml
Helm chart repository with Github Pages #3
apiVersion: v1
entries:
demo:
- apiVersion: v1
appVersion: "1.0"
created: 2018-10-03T12:14:26.693334507+09:00
description: A Helm chart for Kubernetes
digest: c677efc778b455ad3b9d53c03d37cf0002d067ac80da35d0921672a77f3c9bc3
name: demo
urls:
- https://example.github.io/my-charts/stable/demo-0.1.0.tgz
version: 0.1.0
generated: 2018-10-03T12:14:26.690034532+09:00
8. Index 파일의 helm chart 패키지 다운로드 확인
https://example.github.io/my-charts/stable/demo-0.1.0.tgz
[참고] 샘플 helm repository
https://github.com/YunSangJun/my-charts
Helm chart 공유 및 사용 #1
● 준비된 helm chart와 repository를 다른 사용자들이 추가 및 사용
1. helm repository 추가
# helm repo add [REPO_NAME] [REPO_URL]
$ helm repo add my-charts https://example.github.io/my-charts/stable
2. 추가한 repository 확인
$ help repo list
NAME URL
...
my-charts https://example.github.io/my-charts/stable
3. repository에서 chart 검색
$ helm search my-charts
NAME CHART VERSION APP VERSION DESCRIPTION
my-charts/demo 0.1.0 1.0 A Helm chart for Kubernetes
Helm chart 공유 및 사용 #2
4. chart 사용하기
$ helm install my-charts/demo
NAME: flippant-narwhal
LAST DEPLOYED: Wed Oct 3 15:11:52 2018
NAMESPACE: default
STATUS: DEPLOYED
RESOURCES:
==> v1beta2/Deployment
NAME AGE
flippant-narwhal-demo 0s
…
NOTES:
1. Get the application URL by running these commands:
export POD_NAME=$(kubectl get pods --namespace default -l
"app.kubernetes.io/name=demo,app.kubernetes.io/instance=flippant-narwhal" -o
jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl port-forward $POD_NAME 8080:80
현실에서의 고민
Multi Cloud & Cluster?
● Kubernetes로 만든 애플리케이션 어떻게 Multi Cloud & Cluster에 배포?
$ cat pvc.yaml
kind: PersistentVolumeClaim
spec:
storageClassName: [???]
storageClassName:
gp2
storageClassName:
ibm-file-bronze
storageClassName:
standard
storageClassName:
default
Kubernetes?
● Kubernetes 에서는 변수 치환 기능을 제공할 계획 없음. (make by design)
https://github.com/kubernetes/kubernetes/issues/52787
Helming!
● Helm
$ export STORAGE_CLASS = gp2 | ibm-file-bronze | standard | azurefile
$ helm install stable/mariadb 
--set master.persistence.storageClass="${STORAGE_CLASS}"
Spinnaker + Helm
● Spinnaker의 Helm bake 기능을 활용과 연계
https://www.spinnaker.io/guides/user/kubernetes-v2/deploy-helm/
Monocular + Helm
● Monocular와 Helm repository를 연계해 앱 마켓플레이스 활용
https://github.com/helm/monocular
Helm 사용하기
고급
Chart의 설정 변경 #1 매개변수 사용
● Chart source repository 문서의 설정 정보를 참고하여 설정 변경
$ helm install stable/mariadb 
--set image.tag=x.x.x
https://github.com/helm/charts/tree/master/stable/mariadb
Chart의 설정 변경 #2 파일 사용
● yaml file 형태로 설정 변경도 가능. Chart의 values.yaml의 형식을 참고해서 작
성
$ cat values.yaml
image:
tag: x.x.x
...
$ helm install stable/mariadb 
-f values.yaml
Contribution
Helm chart contribution
● 내가 만든 애플리케이션을 kubernetes helm repository에 배포하고 싶다면?
Tips for contribution
1. Kubernetes helm code repository fork
2. 아래 가이드 참고하여 contributor 서명 후 commit
a. https://github.com/helm/charts/blob/master/CONTRIBUTING.md
3. “helm create”로 만들어진 최신 버전 chart를 참고하여 내가 만든 chart 검토
4. Guidelines을 참고하여 내가 만든 chart 검토
a. https://github.com/helm/charts/blob/master/REVIEW_GUIDELINES.md
5. 내가 만든 chart를 incubator 디렉토리에 commit
6. Pull request!
참고자료
Helm 참고 자료
● 블로그 : https://yunsangjun.github.io/blog/
Kubernetes 참고 자료
● 블로그 : http://tech.cloudz-labs.io/
Q & A
감사합니다

More Related Content

What's hot

Kubernetes & helm 활용
Kubernetes & helm 활용Kubernetes & helm 활용
Kubernetes & helm 활용SK Telecom
 
Monitoring on Kubernetes using prometheus
Monitoring on Kubernetes using prometheusMonitoring on Kubernetes using prometheus
Monitoring on Kubernetes using prometheusChandresh Pancholi
 
NGINX Kubernetes Ingress Controller: Getting Started – EMEA
NGINX Kubernetes Ingress Controller: Getting Started – EMEANGINX Kubernetes Ingress Controller: Getting Started – EMEA
NGINX Kubernetes Ingress Controller: Getting Started – EMEAAine Long
 
Helm - Application deployment management for Kubernetes
Helm - Application deployment management for KubernetesHelm - Application deployment management for Kubernetes
Helm - Application deployment management for KubernetesAlexei Ledenev
 
Introduction to Helm
Introduction to HelmIntroduction to Helm
Introduction to HelmHarshal Shah
 
NGINX Ingress Controller for Kubernetes
NGINX Ingress Controller for KubernetesNGINX Ingress Controller for Kubernetes
NGINX Ingress Controller for KubernetesNGINX, Inc.
 
Kubernetes Deployment Strategies
Kubernetes Deployment StrategiesKubernetes Deployment Strategies
Kubernetes Deployment StrategiesAbdennour TM
 
Kubernetes Monitoring & Best Practices
Kubernetes Monitoring & Best PracticesKubernetes Monitoring & Best Practices
Kubernetes Monitoring & Best PracticesAjeet Singh Raina
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes IntroductionPeng Xiao
 
Kubernetes architecture
Kubernetes architectureKubernetes architecture
Kubernetes architectureJanakiram MSV
 
IT Automation with Ansible
IT Automation with AnsibleIT Automation with Ansible
IT Automation with AnsibleRayed Alrashed
 
Kubernetes extensibility: CRDs & Operators
Kubernetes extensibility: CRDs & OperatorsKubernetes extensibility: CRDs & Operators
Kubernetes extensibility: CRDs & OperatorsSIGHUP
 
Kubernetes Architecture and Introduction
Kubernetes Architecture and IntroductionKubernetes Architecture and Introduction
Kubernetes Architecture and IntroductionStefan Schimanski
 
Helm - Package manager in K8S
Helm - Package manager in K8SHelm - Package manager in K8S
Helm - Package manager in K8SPiotr Perzyna
 
What is Platform as a Product? Clues from Team Topologies @ DevOps Porto meet...
What is Platform as a Product? Clues from Team Topologies @ DevOps Porto meet...What is Platform as a Product? Clues from Team Topologies @ DevOps Porto meet...
What is Platform as a Product? Clues from Team Topologies @ DevOps Porto meet...Manuel Pais
 
Kubernetes Helm: Why It Matters
Kubernetes Helm: Why It MattersKubernetes Helm: Why It Matters
Kubernetes Helm: Why It MattersPlatform9
 

What's hot (20)

Kubernetes & helm 활용
Kubernetes & helm 활용Kubernetes & helm 활용
Kubernetes & helm 활용
 
Helm 3
Helm 3Helm 3
Helm 3
 
Introduction to helm
Introduction to helmIntroduction to helm
Introduction to helm
 
Monitoring on Kubernetes using prometheus
Monitoring on Kubernetes using prometheusMonitoring on Kubernetes using prometheus
Monitoring on Kubernetes using prometheus
 
NGINX Kubernetes Ingress Controller: Getting Started – EMEA
NGINX Kubernetes Ingress Controller: Getting Started – EMEANGINX Kubernetes Ingress Controller: Getting Started – EMEA
NGINX Kubernetes Ingress Controller: Getting Started – EMEA
 
Helm - Application deployment management for Kubernetes
Helm - Application deployment management for KubernetesHelm - Application deployment management for Kubernetes
Helm - Application deployment management for Kubernetes
 
Introduction to Helm
Introduction to HelmIntroduction to Helm
Introduction to Helm
 
NGINX Ingress Controller for Kubernetes
NGINX Ingress Controller for KubernetesNGINX Ingress Controller for Kubernetes
NGINX Ingress Controller for Kubernetes
 
Kubernetes Deployment Strategies
Kubernetes Deployment StrategiesKubernetes Deployment Strategies
Kubernetes Deployment Strategies
 
What Is Helm
 What Is Helm What Is Helm
What Is Helm
 
Kubernetes Monitoring & Best Practices
Kubernetes Monitoring & Best PracticesKubernetes Monitoring & Best Practices
Kubernetes Monitoring & Best Practices
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 
Kubernetes architecture
Kubernetes architectureKubernetes architecture
Kubernetes architecture
 
IT Automation with Ansible
IT Automation with AnsibleIT Automation with Ansible
IT Automation with Ansible
 
Kubernetes extensibility: CRDs & Operators
Kubernetes extensibility: CRDs & OperatorsKubernetes extensibility: CRDs & Operators
Kubernetes extensibility: CRDs & Operators
 
Kubernetes Architecture and Introduction
Kubernetes Architecture and IntroductionKubernetes Architecture and Introduction
Kubernetes Architecture and Introduction
 
Helm - Package manager in K8S
Helm - Package manager in K8SHelm - Package manager in K8S
Helm - Package manager in K8S
 
Kubernetes security
Kubernetes securityKubernetes security
Kubernetes security
 
What is Platform as a Product? Clues from Team Topologies @ DevOps Porto meet...
What is Platform as a Product? Clues from Team Topologies @ DevOps Porto meet...What is Platform as a Product? Clues from Team Topologies @ DevOps Porto meet...
What is Platform as a Product? Clues from Team Topologies @ DevOps Porto meet...
 
Kubernetes Helm: Why It Matters
Kubernetes Helm: Why It MattersKubernetes Helm: Why It Matters
Kubernetes Helm: Why It Matters
 

Similar to Digging into helm

decapod cncg seoul 2020
decapod cncg seoul 2020decapod cncg seoul 2020
decapod cncg seoul 2020Esther Kim
 
XECon2015 :: [1-5] 김훈민 - 서버 운영자가 꼭 알아야 할 Docker
XECon2015 :: [1-5] 김훈민 - 서버 운영자가 꼭 알아야 할 DockerXECon2015 :: [1-5] 김훈민 - 서버 운영자가 꼭 알아야 할 Docker
XECon2015 :: [1-5] 김훈민 - 서버 운영자가 꼭 알아야 할 DockerXpressEngine
 
내 입맞에 맞는 프로그래밍 언어로 Lambda 함수 만들기 :: 정창훈 - AWS Community Day 2019
내 입맞에 맞는 프로그래밍 언어로 Lambda 함수 만들기 :: 정창훈 - AWS Community Day 2019내 입맞에 맞는 프로그래밍 언어로 Lambda 함수 만들기 :: 정창훈 - AWS Community Day 2019
내 입맞에 맞는 프로그래밍 언어로 Lambda 함수 만들기 :: 정창훈 - AWS Community Day 2019AWSKRUG - AWS한국사용자모임
 
Hadoop security DeView 2014
Hadoop security DeView 2014Hadoop security DeView 2014
Hadoop security DeView 2014Gruter
 
Kubernetes on GCP
Kubernetes on GCPKubernetes on GCP
Kubernetes on GCPDaegeun Kim
 
[GitOps] Argo CD on GKE (v0.9.2).pdf
[GitOps] Argo CD on GKE (v0.9.2).pdf[GitOps] Argo CD on GKE (v0.9.2).pdf
[GitOps] Argo CD on GKE (v0.9.2).pdfJo Hoon
 
20141229 dklee docker
20141229 dklee docker20141229 dklee docker
20141229 dklee dockerDK Lee
 
[오픈소스컨설팅]쿠버네티스를 활용한 개발환경 구축
[오픈소스컨설팅]쿠버네티스를 활용한 개발환경 구축[오픈소스컨설팅]쿠버네티스를 활용한 개발환경 구축
[오픈소스컨설팅]쿠버네티스를 활용한 개발환경 구축Ji-Woong Choi
 
docker on GCE ( JIRA & Confluence ) - GDG Korea Cloud
docker on GCE ( JIRA & Confluence ) - GDG Korea Clouddocker on GCE ( JIRA & Confluence ) - GDG Korea Cloud
docker on GCE ( JIRA & Confluence ) - GDG Korea CloudJude Kim
 
Cloud-Barista 제3차 오픈 컨퍼런스 : CB-Spider - 멀티 클라우드 인프라 연동(Multi-Cloud Infrastruc...
Cloud-Barista 제3차 오픈 컨퍼런스 : CB-Spider - 멀티 클라우드 인프라 연동(Multi-Cloud Infrastruc...Cloud-Barista 제3차 오픈 컨퍼런스 : CB-Spider - 멀티 클라우드 인프라 연동(Multi-Cloud Infrastruc...
Cloud-Barista 제3차 오픈 컨퍼런스 : CB-Spider - 멀티 클라우드 인프라 연동(Multi-Cloud Infrastruc...Cloud-Barista Community
 
ARCUS offline meeting 2015. 05. 20 1회
ARCUS offline meeting 2015. 05. 20 1회ARCUS offline meeting 2015. 05. 20 1회
ARCUS offline meeting 2015. 05. 20 1회JaM2in
 
Maxscale 소개 1.1.1
Maxscale 소개 1.1.1Maxscale 소개 1.1.1
Maxscale 소개 1.1.1NeoClova
 
[오픈소스컨설팅] Docker를 활용한 Gitlab CI/CD 구성 테스트
[오픈소스컨설팅] Docker를 활용한 Gitlab CI/CD 구성 테스트[오픈소스컨설팅] Docker를 활용한 Gitlab CI/CD 구성 테스트
[오픈소스컨설팅] Docker를 활용한 Gitlab CI/CD 구성 테스트Ji-Woong Choi
 
Nginx Https 적용하기.pptx
Nginx Https 적용하기.pptxNginx Https 적용하기.pptx
Nginx Https 적용하기.pptxwonyong hwang
 
AWS Kubernetes 서비스 자세히 살펴보기 (정영준 & 이창수, AWS 솔루션즈 아키텍트) :: AWS DevDay2018
AWS Kubernetes 서비스 자세히 살펴보기 (정영준 & 이창수, AWS 솔루션즈 아키텍트) :: AWS DevDay2018AWS Kubernetes 서비스 자세히 살펴보기 (정영준 & 이창수, AWS 솔루션즈 아키텍트) :: AWS DevDay2018
AWS Kubernetes 서비스 자세히 살펴보기 (정영준 & 이창수, AWS 솔루션즈 아키텍트) :: AWS DevDay2018Amazon Web Services Korea
 
Front-end Development Process - 어디까지 개선할 수 있나
Front-end Development Process - 어디까지 개선할 수 있나Front-end Development Process - 어디까지 개선할 수 있나
Front-end Development Process - 어디까지 개선할 수 있나JeongHun Byeon
 
Terraform을 이용한 Infrastructure as Code 실전 구성하기 :: 변정훈::AWS Summit Seoul 2018
 Terraform을 이용한 Infrastructure as Code 실전 구성하기 :: 변정훈::AWS Summit Seoul 2018 Terraform을 이용한 Infrastructure as Code 실전 구성하기 :: 변정훈::AWS Summit Seoul 2018
Terraform을 이용한 Infrastructure as Code 실전 구성하기 :: 변정훈::AWS Summit Seoul 2018Amazon Web Services Korea
 

Similar to Digging into helm (20)

decapod cncg seoul 2020
decapod cncg seoul 2020decapod cncg seoul 2020
decapod cncg seoul 2020
 
XECon2015 :: [1-5] 김훈민 - 서버 운영자가 꼭 알아야 할 Docker
XECon2015 :: [1-5] 김훈민 - 서버 운영자가 꼭 알아야 할 DockerXECon2015 :: [1-5] 김훈민 - 서버 운영자가 꼭 알아야 할 Docker
XECon2015 :: [1-5] 김훈민 - 서버 운영자가 꼭 알아야 할 Docker
 
내 입맞에 맞는 프로그래밍 언어로 Lambda 함수 만들기 :: 정창훈 - AWS Community Day 2019
내 입맞에 맞는 프로그래밍 언어로 Lambda 함수 만들기 :: 정창훈 - AWS Community Day 2019내 입맞에 맞는 프로그래밍 언어로 Lambda 함수 만들기 :: 정창훈 - AWS Community Day 2019
내 입맞에 맞는 프로그래밍 언어로 Lambda 함수 만들기 :: 정창훈 - AWS Community Day 2019
 
Hadoop security DeView 2014
Hadoop security DeView 2014Hadoop security DeView 2014
Hadoop security DeView 2014
 
Kubernetes on GCP
Kubernetes on GCPKubernetes on GCP
Kubernetes on GCP
 
Kafka slideshare
Kafka   slideshareKafka   slideshare
Kafka slideshare
 
[GitOps] Argo CD on GKE (v0.9.2).pdf
[GitOps] Argo CD on GKE (v0.9.2).pdf[GitOps] Argo CD on GKE (v0.9.2).pdf
[GitOps] Argo CD on GKE (v0.9.2).pdf
 
20141229 dklee docker
20141229 dklee docker20141229 dklee docker
20141229 dklee docker
 
[오픈소스컨설팅]쿠버네티스를 활용한 개발환경 구축
[오픈소스컨설팅]쿠버네티스를 활용한 개발환경 구축[오픈소스컨설팅]쿠버네티스를 활용한 개발환경 구축
[오픈소스컨설팅]쿠버네티스를 활용한 개발환경 구축
 
docker on GCE ( JIRA & Confluence ) - GDG Korea Cloud
docker on GCE ( JIRA & Confluence ) - GDG Korea Clouddocker on GCE ( JIRA & Confluence ) - GDG Korea Cloud
docker on GCE ( JIRA & Confluence ) - GDG Korea Cloud
 
Cloud-Barista 제3차 오픈 컨퍼런스 : CB-Spider - 멀티 클라우드 인프라 연동(Multi-Cloud Infrastruc...
Cloud-Barista 제3차 오픈 컨퍼런스 : CB-Spider - 멀티 클라우드 인프라 연동(Multi-Cloud Infrastruc...Cloud-Barista 제3차 오픈 컨퍼런스 : CB-Spider - 멀티 클라우드 인프라 연동(Multi-Cloud Infrastruc...
Cloud-Barista 제3차 오픈 컨퍼런스 : CB-Spider - 멀티 클라우드 인프라 연동(Multi-Cloud Infrastruc...
 
ARCUS offline meeting 2015. 05. 20 1회
ARCUS offline meeting 2015. 05. 20 1회ARCUS offline meeting 2015. 05. 20 1회
ARCUS offline meeting 2015. 05. 20 1회
 
Maxscale 소개 1.1.1
Maxscale 소개 1.1.1Maxscale 소개 1.1.1
Maxscale 소개 1.1.1
 
[오픈소스컨설팅] Docker를 활용한 Gitlab CI/CD 구성 테스트
[오픈소스컨설팅] Docker를 활용한 Gitlab CI/CD 구성 테스트[오픈소스컨설팅] Docker를 활용한 Gitlab CI/CD 구성 테스트
[오픈소스컨설팅] Docker를 활용한 Gitlab CI/CD 구성 테스트
 
Nginx Https 적용하기.pptx
Nginx Https 적용하기.pptxNginx Https 적용하기.pptx
Nginx Https 적용하기.pptx
 
AWS Kubernetes 서비스 자세히 살펴보기 (정영준 & 이창수, AWS 솔루션즈 아키텍트) :: AWS DevDay2018
AWS Kubernetes 서비스 자세히 살펴보기 (정영준 & 이창수, AWS 솔루션즈 아키텍트) :: AWS DevDay2018AWS Kubernetes 서비스 자세히 살펴보기 (정영준 & 이창수, AWS 솔루션즈 아키텍트) :: AWS DevDay2018
AWS Kubernetes 서비스 자세히 살펴보기 (정영준 & 이창수, AWS 솔루션즈 아키텍트) :: AWS DevDay2018
 
Front-end Development Process - 어디까지 개선할 수 있나
Front-end Development Process - 어디까지 개선할 수 있나Front-end Development Process - 어디까지 개선할 수 있나
Front-end Development Process - 어디까지 개선할 수 있나
 
K8s in action02
K8s in action02K8s in action02
K8s in action02
 
Lam pstack
Lam pstackLam pstack
Lam pstack
 
Terraform을 이용한 Infrastructure as Code 실전 구성하기 :: 변정훈::AWS Summit Seoul 2018
 Terraform을 이용한 Infrastructure as Code 실전 구성하기 :: 변정훈::AWS Summit Seoul 2018 Terraform을 이용한 Infrastructure as Code 실전 구성하기 :: 변정훈::AWS Summit Seoul 2018
Terraform을 이용한 Infrastructure as Code 실전 구성하기 :: 변정훈::AWS Summit Seoul 2018
 

Recently uploaded

JMP 기능의 확장 및 내재화의 핵심 JMP-Python 소개
JMP 기능의 확장 및 내재화의 핵심 JMP-Python 소개JMP 기능의 확장 및 내재화의 핵심 JMP-Python 소개
JMP 기능의 확장 및 내재화의 핵심 JMP-Python 소개JMP Korea
 
JMP가 걸어온 여정, 새로운 도약 JMP 18!
JMP가 걸어온 여정, 새로운 도약 JMP 18!JMP가 걸어온 여정, 새로운 도약 JMP 18!
JMP가 걸어온 여정, 새로운 도약 JMP 18!JMP Korea
 
데이터 분석 문제 해결을 위한 나의 JMP 활용법
데이터 분석 문제 해결을 위한 나의 JMP 활용법데이터 분석 문제 해결을 위한 나의 JMP 활용법
데이터 분석 문제 해결을 위한 나의 JMP 활용법JMP Korea
 
실험 설계의 평가 방법: Custom Design을 중심으로 반응인자 최적화 및 Criteria 해석
실험 설계의 평가 방법: Custom Design을 중심으로 반응인자 최적화 및 Criteria 해석실험 설계의 평가 방법: Custom Design을 중심으로 반응인자 최적화 및 Criteria 해석
실험 설계의 평가 방법: Custom Design을 중심으로 반응인자 최적화 및 Criteria 해석JMP Korea
 
JMP를 활용한 가속열화 분석 사례
JMP를 활용한 가속열화 분석 사례JMP를 활용한 가속열화 분석 사례
JMP를 활용한 가속열화 분석 사례JMP Korea
 
공학 관점에서 바라본 JMP 머신러닝 최적화
공학 관점에서 바라본 JMP 머신러닝 최적화공학 관점에서 바라본 JMP 머신러닝 최적화
공학 관점에서 바라본 JMP 머신러닝 최적화JMP Korea
 
(독서광) 인간이 초대한 대형 참사 - 대형 참사가 일어날 때까지 사람들은 무엇을 하고 있었는가?
(독서광) 인간이 초대한 대형 참사 - 대형 참사가 일어날 때까지 사람들은 무엇을 하고 있었는가?(독서광) 인간이 초대한 대형 참사 - 대형 참사가 일어날 때까지 사람들은 무엇을 하고 있었는가?
(독서광) 인간이 초대한 대형 참사 - 대형 참사가 일어날 때까지 사람들은 무엇을 하고 있었는가?Jay Park
 
JMP를 활용한 전자/반도체 산업 Yield Enhancement Methodology
JMP를 활용한 전자/반도체 산업 Yield Enhancement MethodologyJMP를 활용한 전자/반도체 산업 Yield Enhancement Methodology
JMP를 활용한 전자/반도체 산업 Yield Enhancement MethodologyJMP Korea
 

Recently uploaded (8)

JMP 기능의 확장 및 내재화의 핵심 JMP-Python 소개
JMP 기능의 확장 및 내재화의 핵심 JMP-Python 소개JMP 기능의 확장 및 내재화의 핵심 JMP-Python 소개
JMP 기능의 확장 및 내재화의 핵심 JMP-Python 소개
 
JMP가 걸어온 여정, 새로운 도약 JMP 18!
JMP가 걸어온 여정, 새로운 도약 JMP 18!JMP가 걸어온 여정, 새로운 도약 JMP 18!
JMP가 걸어온 여정, 새로운 도약 JMP 18!
 
데이터 분석 문제 해결을 위한 나의 JMP 활용법
데이터 분석 문제 해결을 위한 나의 JMP 활용법데이터 분석 문제 해결을 위한 나의 JMP 활용법
데이터 분석 문제 해결을 위한 나의 JMP 활용법
 
실험 설계의 평가 방법: Custom Design을 중심으로 반응인자 최적화 및 Criteria 해석
실험 설계의 평가 방법: Custom Design을 중심으로 반응인자 최적화 및 Criteria 해석실험 설계의 평가 방법: Custom Design을 중심으로 반응인자 최적화 및 Criteria 해석
실험 설계의 평가 방법: Custom Design을 중심으로 반응인자 최적화 및 Criteria 해석
 
JMP를 활용한 가속열화 분석 사례
JMP를 활용한 가속열화 분석 사례JMP를 활용한 가속열화 분석 사례
JMP를 활용한 가속열화 분석 사례
 
공학 관점에서 바라본 JMP 머신러닝 최적화
공학 관점에서 바라본 JMP 머신러닝 최적화공학 관점에서 바라본 JMP 머신러닝 최적화
공학 관점에서 바라본 JMP 머신러닝 최적화
 
(독서광) 인간이 초대한 대형 참사 - 대형 참사가 일어날 때까지 사람들은 무엇을 하고 있었는가?
(독서광) 인간이 초대한 대형 참사 - 대형 참사가 일어날 때까지 사람들은 무엇을 하고 있었는가?(독서광) 인간이 초대한 대형 참사 - 대형 참사가 일어날 때까지 사람들은 무엇을 하고 있었는가?
(독서광) 인간이 초대한 대형 참사 - 대형 참사가 일어날 때까지 사람들은 무엇을 하고 있었는가?
 
JMP를 활용한 전자/반도체 산업 Yield Enhancement Methodology
JMP를 활용한 전자/반도체 산업 Yield Enhancement MethodologyJMP를 활용한 전자/반도체 산업 Yield Enhancement Methodology
JMP를 활용한 전자/반도체 산업 Yield Enhancement Methodology
 

Digging into helm

  • 2. Step Helm 개념 Helm 사용 Helm 개발 Helm 호스팅 Helm 운영
  • 4. Helm? “Helm is the best way to find, share, and use software built for Kubernetes” [https://helm.sh]
  • 5. Helm ● Kubernetes를 위한 패키지 관리 툴 //Kubetnetes $ helm install stable/mysql //Homebrew $ brew install mysql //Apt $ apt-get install mysql-server //Yum $ yum install mysql-server
  • 6. Chart ● Helm에서 애플리케이션 패키징을 하기 위해 사용하는 형식 ● Chart는 Kubernetes resource의 집합
  • 8. //Helm $ helm install stable/mysql MySQL Server (Deployment) Persistent Volume (PVC) /etc/mysql/conf.d (Configmap) Password (Secret) Access Endpoint (Service) //Kubernetes yaml $ kubectl create -f deployment.yaml $ kubectl create -f svc.yaml $ kubectl create -f pvc.yaml $ kubectl create -f secret.yaml $ kubectl create -f configmap.yaml #1 Manage Complexity
  • 9. #2 Easy Updates ● Upgrade 명령을 사용하여 설정이나 버전을 쉽게 업데이트 $ helm upgrade mysql-release stable/mysql --set mysqlRootPassword="password" $ helm upgrade mysql-release stable/mysql --version x.x.x
  • 10. #3 Simple Sharing $ helm package demoPackage Share Download $ mv demo-0.1.0.tgz stable $ helm repo index stable --url https://example.github.io/my-charts/stable $ helm repo add my-charts https://example.github.io/my-charts $ helm install my-charts/demo
  • 11. #4 Rollback ● Rollback 명령을 사용하여 이전 버전 또는 특정 버전으로 쉽게 복구 $ helm history REVISION UPDATED STATUS CHART DESCRIPTION 1 Thu Aug 15 00:49:37 2018 SUPERSEDED mysql-5.0.1 Install complete ... 10 Thu Aug 16 00:49:37 2018 DEPLOYED mysql-5.0.10 Upgrade complete $ helm rollback mysql [REVISION_NUMBER]
  • 13. 5
  • 14. #1 Search #2 Install #3 Upgrade #4 Rollback #5 Delete
  • 15. #1 Search ● Helm을 최초 설치하면 Kubernetes official repository에 기본적으로 연동 $ helm repo list NAME URL stable https://kubernetes-charts.storage.googleapis.com local http://127.0.0.1:8879/charts $ helm search NAME CHART VERSION APP VERSION DESCRIPTION stable/wordpress 2.1.10 4.9.8 Web publishing platform for building... stable/jenkins 0.16.19 2.121.2 Open source continuous integration... stable/mariadb 4.3.3 10.1.35 Fast, reliable, scalable, and easy to... stable/mysql 0.8.3 5.7.14 Fast, reliable, scalable, and easy to... … $ helm search mysql NAME CHART VERSION APP VERSION DESCRIPTION stable/mysql 0.8.3 5.7.14 Fast, reliable, scalable, and easy... stable/mysqldump 0.1.0 5.7.21 A Helm chart to help backup... stable/mariadb 4.3.3 10.1.35 Fast, reliable, scalable, and easy...
  • 16. #1 Search ● Inspect 명령으로 상세 정보 출력 $ helm inspect stable/mariadb appVersion: 10.1.35 description: Fast, reliable, scalable, and easy to use open-source relational database system. MariaDB Server is intended for mission-critical, heavy-load production systems as well as for embedding into mass-deployed software. Highly available MariaDB cluster. engine: gotpl home: https://mariadb.org icon: https://bitnami.com/assets/stacks/mariadb/img/mariadb-stack-220x234.png keywords: - mariadb - mysql - database - sql - prometheus
  • 17. #2 Install ● Install 명령으로 원하는 chart를 바로 설치 # helm install [REPO_NAME/CHART_NAME] --name [RELEASE_NAME] --namespace [NAMESPACE] $ helm install stable/mariadb NAME: willing-armadillo LAST DEPLOYED: Mon Oct 1 15:01:04 2018 NAMESPACE: default STATUS: DEPLOYED RESOURCES: ==> v1/Secret NAME TYPE DATA AGE willing-armadillo-mariadb Opaque 2 0s ==> v1/ConfigMap NAME DATA AGE willing-armadillo-mariadb-master-init-scripts 1 0s ... ==> v1/Service NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE willing-armadillo-mariadb ClusterIP 10.3.255.79 <none> 3306/TCP 0s ... ==> v1beta1/StatefulSet NAME DESIRED CURRENT AGE willing-armadillo-mariadb-master 1 0 0s willing-armadillo-mariadb-slave 1 0 0s
  • 18. #2 Install ● Notes에 애플리케이션을 사용하기 위한 가이드 출력 ... NOTES: Please be patient while the chart is being deployed Tip: Watch the deployment status using the command: kubectl get pods -w --namespace default -l release=willing-armadillo ... Administrator credentials: Username: root Password : $(kubectl get secret --namespace default willing-armadillo-mariadb -o jsonpath="{.data.mariadb-root- password}" | base64 --decode) To connect to your database 1. Run a pod that you can use as a client: kubectl run willing-armadillo-mariadb-client --rm --tty -i --image docker.io/bitnami/mariadb:10.1.35-debian-9 -- namespace default --command -- bash 2. To connect to master service (read/write): mysql -h willing-armadillo-mariadb.default.svc.cluster.local -uroot -p my_database … $ kubectl get secret --namespace default willing-armadillo-mariadb -o jsonpath="{.data.mariadb-root-password}" | base64 -- decode JYHQDJY7Im
  • 19. #3 Upgrade ● Upgrade 명령을 통해 설정이나 버전을 업데이트 $ helm list NAME REVISION UPDATED STATUS CHART NAMESPACE willing-armadillo 1 Mon Oct 1 15:01:04 2018 DEPLOYED mariadb-4.3.3 default $ helm upgrade willing-armadillo --set rootUser.password=”admin” stable/mariadb Release "willing-armadillo" has been upgraded. Happy Helming! LAST DEPLOYED: Mon Oct 1 15:42:55 2018 NAMESPACE: default STATUS: DEPLOYED … Administrator credentials: Username: root Password : $(kubectl get secret --namespace default willing-armadillo-mariadb -o jsonpath="{.data.mariadb-root- password}" | base64 --decode) … $ kubectl get secret --namespace default willing-armadillo-mariadb -o jsonpath="{.data.mariadb-root-password}" | base64 --decode ”admin”
  • 20. #4 Rollback ● Rollback 명령을 사용하여 이전 버전 또는 특정 버전으로 쉽게 복구 $ helm list NAME REVISION UPDATED STATUS CHART NAMESPACE willing-armadillo 2 Mon Oct 1 15:42:55 2018 DEPLOYED mariadb-4.3.3 default $ helm history willing-armadillo REVISION UPDATED STATUS CHART DESCRIPTION 1 Mon Oct 1 15:01:04 2018 SUPERSEDED mariadb-4.3.3 Install complete 2 Mon Oct 1 15:42:55 2018 DEPLOYED mariadb-4.3.3 Upgrade complete $ helm rollback willing-armadillo 1 Rollback was a success! Happy Helming! $ helm history willing-armadillo REVISION UPDATED STATUS CHART DESCRIPTION 1 Mon Oct 1 15:01:04 2018 SUPERSEDED mariadb-4.3.3 Install complete 2 Mon Oct 1 15:42:55 2018 SUPERSEDED mariadb-4.3.3 Upgrade complete 3 Mon Oct 1 16:18:04 2018 DEPLOYED mariadb-4.3.3 Rollback to 1 $ kubectl get secret --namespace default willing-armadillo-mariadb -o jsonpath="{.data.mariadb-root-password}" | base64 -- decode JYHQDJY7Im
  • 21. #5 Delete ● Delete 명령을 사용하여 설치된 Kubernetes 리소스 삭제 $ helm list NAME REVISION UPDATED STATUS CHART NAMESPACE willing-armadillo 2 Mon Oct 1 15:42:55 2018 DEPLOYED mariadb-4.3.3 default # “--purge” 옵션을 주면 release name 까지 삭제. 아니면 list에는 남아있음. $ helm del --purge willing-armadillo release "willing-armadillo" deleted # StatefulSet에서 “volumeClaimTemplates”을 통해 생성된 volume은 helm 삭제 후에도 남아있음. (make by design) # https://github.com/helm/charts/blob/master/stable/mariadb/templates/master-statefulset.yaml $ kubectl get pvc NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE data-w...-mariadb-master-0 Bound pvc-d24.. 8Gi RWO standard 1h data-w...-mariadb-slave-0 Bound pvc-d25.. 8Gi RWO standard 1h
  • 22. [참고] Helm & Tiller 설치 ● Helm을 사용하기 위해서는 Tiller와 Helm Client를 설치 필요 ○ Tiller : Helm의 서버로 일반적으로 Kubernetes cluster에 설치 ○ Helm client : Helm 명령어를 실행하기 위한 CLI ● 설치 방법은 아래 블로그 참고 ○ https://yunsangjun.github.io/blog/helm/2018/05/27/installing-helm.html
  • 24. Helm chart 생성 및 구조 #1 ● Create 명령으로 Helm chart sample 생성 # helm create [CHART_NAME] $ helm create demo Creating demo demo/ .helmignore # 형상관리에서 제외할 파일이나 디렉토리 목록 Chart.yaml # Chart의 정보를 저장 charts # 이 chart에서 의존성을 가지고 있는 chart가 위치 templates # Kubernetes 리소스의 템플릿 파일(deployment, service, ingress 등의 yaml) values.yaml # 이 helm chart의 기본 설정 값을 저장. templates yaml 파일에서 사용 ● Sample chart 구조
  • 25. Helm chart 생성 및 구조 #2 ● values.yaml 과 templates 구조 $ cat values.yaml replicaCount: 1 image: repository: nginx tag: stable pullPolicy: IfNotPresent nameOverride: "" fullnameOverride: "" service: type: ClusterIP port: 80 ingress: enabled: false ... $ cat templates/service.yaml apiVersion: v1 kind: Service metadata: name: {{ include "demo.fullname" . }} labels: app.kubernetes.io/name: {{ include "demo.name" . }} helm.sh/chart: {{ include "demo.chart" . }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} spec: type: {{ .Values.service.type }} ports: - port: {{ .Values.service.port }} targetPort: http protocol: TCP name: http selector: app.kubernetes.io/name: {{ include "demo.name" . }} app.kubernetes.io/instance: {{ .Release.Name }}
  • 26. Helm chart validation ● Lint 명령으로 Helm chart의 문법적인 오류 체크 $ helm lint demo ==> Linting ./ [INFO] Chart.yaml: icon is recommended [ERROR] templates/: render error in "demo/templates/deployment.yaml": template: demo/templates/deployment.yaml:11:22: executing "demo/templates/deployment.yaml" at <.Values.replica.coun...>: can't evaluate field count in type interface {} Error: 1 chart(s) linted, 1 chart(s) failed $ cat demo/templates/deployment.yaml ... spec: replicas: {{ .Values.replica.count }} => .Values.replicaCount로 수정 필요 $ cat demo/values.yaml ... replicaCount: 1
  • 27. Helm chart package ● Package 명령으로 Helm chart package $ ls -all total 3 drwxr-xr-x 7 sangjunyun staff 224 10 3 15:56 . drwxr-xr-x 41 sangjunyun staff 1312 10 3 11:49 .. drwxr-xr-x 7 sangjunyun staff 224 10 3 12:01 demo $ helm package demo Successfully packaged chart and saved it to: PATH/demo-0.1.0.tgz $ ls -all total 3 drwxr-xr-x 7 sangjunyun staff 224 10 3 15:56 . drwxr-xr-x 41 sangjunyun staff 1312 10 3 11:49 .. drwxr-xr-x 7 sangjunyun staff 224 10 3 12:01 demo -rw-r--r-- 1 sangjunyun staff 2608 10 3 12:01 demo-0.1.0.tgz
  • 28. Helm chart template ● Template 명령으로 Kubernetes 리소스 파일이 어떻게 생성될 지 미리 확인 $ helm template demo > output.yaml $ cat output.yaml --- # Source: demo/templates/service.yaml apiVersion: v1 kind: Service metadata: name: RELEASE-NAME-demo .. --- # Source: demo/templates/deployment.yaml apiVersion: apps/v1beta2 kind: Deployment metadata: name: RELEASE-NAME-demo ...
  • 29. Helm chart simulate ● Install 명령에 “--dry-run --debug” 옵션을 붙여 Helm install 시뮬레이션 $ helm install demo --dry-run --debug ... NAME: lame-sasquatch … --- # Source: demo/templates/service.yaml apiVersion: v1 kind: Service metadata: name: lame-sasquatch-demo … --- # Source: demo/templates/deployment.yaml apiVersion: apps/v1beta2 kind: Deployment metadata: name: lame-sasquatch-demo …
  • 31. Helm chart repository ● 내가 만든 Helm chart를 다른 사용자에게 공유하기 위해서는 Helm repository 가 필요 ● Official repository(https://github.com/helm/charts)에 Contribution하는 방법과 자체 repository를 사용하는 두 가지 방식 있음 ● 자체 repository는 크게 3가지 형태로 지원(웹 서버 기능 필요) ○ Github Pages ○ Object Storage(GCS, AWS S3, ICOS 등) ○ Ordinary Web Servers(Nginx, Apache)
  • 32. Helm chart repository with Github Pages #1 ● 쉽고 무료로 사용할 수 있는 방법 ● Github Pages는 웹 서버 기능을 지원함 1. Github에 Repository 생성(여기서는 my-charts라고 가정) 2. Github Page 설정 Repository -> Settings -> Github Pages > Source > master branch 선택 > Save 선택 (설정 완료 후 나타나는 https://example.github.io/my-charts/ 주소가 웹 서버 주소
  • 33. Helm chart repository with Github Pages #2 3. git repository checkout 및 stable 디렉토리 생성 $ git checkout https://github.com/example/my-charts.git $ cd my-charts & mkdir stable 4. helm 파일을 stable 디렉토리에 복사(앞에서 생성한 demo-0.1.0.tgz 사용) $ mv FILE_PATH/demo-0.1.0.tgz stable 5. Index 파일 생성. stable 디렉토리 하위에 index.yaml 파일 생성됨 # helm repo index [INDEX_FILE_PATH] --url [CHART_REPO_URL] $ helm repo index stable --url https://example.github.io/my-charts/stable 6. 변경사항 git에 commit $ git add --all & git commit -m 'init' & git push origin master 7. Chart repository 주소에 접속해 index 파일 확인 https://example.github.io/my-charts/stable/index.yaml
  • 34. Helm chart repository with Github Pages #3 apiVersion: v1 entries: demo: - apiVersion: v1 appVersion: "1.0" created: 2018-10-03T12:14:26.693334507+09:00 description: A Helm chart for Kubernetes digest: c677efc778b455ad3b9d53c03d37cf0002d067ac80da35d0921672a77f3c9bc3 name: demo urls: - https://example.github.io/my-charts/stable/demo-0.1.0.tgz version: 0.1.0 generated: 2018-10-03T12:14:26.690034532+09:00 8. Index 파일의 helm chart 패키지 다운로드 확인 https://example.github.io/my-charts/stable/demo-0.1.0.tgz [참고] 샘플 helm repository https://github.com/YunSangJun/my-charts
  • 35. Helm chart 공유 및 사용 #1 ● 준비된 helm chart와 repository를 다른 사용자들이 추가 및 사용 1. helm repository 추가 # helm repo add [REPO_NAME] [REPO_URL] $ helm repo add my-charts https://example.github.io/my-charts/stable 2. 추가한 repository 확인 $ help repo list NAME URL ... my-charts https://example.github.io/my-charts/stable 3. repository에서 chart 검색 $ helm search my-charts NAME CHART VERSION APP VERSION DESCRIPTION my-charts/demo 0.1.0 1.0 A Helm chart for Kubernetes
  • 36. Helm chart 공유 및 사용 #2 4. chart 사용하기 $ helm install my-charts/demo NAME: flippant-narwhal LAST DEPLOYED: Wed Oct 3 15:11:52 2018 NAMESPACE: default STATUS: DEPLOYED RESOURCES: ==> v1beta2/Deployment NAME AGE flippant-narwhal-demo 0s … NOTES: 1. Get the application URL by running these commands: export POD_NAME=$(kubectl get pods --namespace default -l "app.kubernetes.io/name=demo,app.kubernetes.io/instance=flippant-narwhal" -o jsonpath="{.items[0].metadata.name}") echo "Visit http://127.0.0.1:8080 to use your application" kubectl port-forward $POD_NAME 8080:80
  • 38. Multi Cloud & Cluster? ● Kubernetes로 만든 애플리케이션 어떻게 Multi Cloud & Cluster에 배포? $ cat pvc.yaml kind: PersistentVolumeClaim spec: storageClassName: [???] storageClassName: gp2 storageClassName: ibm-file-bronze storageClassName: standard storageClassName: default
  • 39. Kubernetes? ● Kubernetes 에서는 변수 치환 기능을 제공할 계획 없음. (make by design) https://github.com/kubernetes/kubernetes/issues/52787
  • 40. Helming! ● Helm $ export STORAGE_CLASS = gp2 | ibm-file-bronze | standard | azurefile $ helm install stable/mariadb --set master.persistence.storageClass="${STORAGE_CLASS}"
  • 41. Spinnaker + Helm ● Spinnaker의 Helm bake 기능을 활용과 연계 https://www.spinnaker.io/guides/user/kubernetes-v2/deploy-helm/
  • 42. Monocular + Helm ● Monocular와 Helm repository를 연계해 앱 마켓플레이스 활용 https://github.com/helm/monocular
  • 44. Chart의 설정 변경 #1 매개변수 사용 ● Chart source repository 문서의 설정 정보를 참고하여 설정 변경 $ helm install stable/mariadb --set image.tag=x.x.x https://github.com/helm/charts/tree/master/stable/mariadb
  • 45. Chart의 설정 변경 #2 파일 사용 ● yaml file 형태로 설정 변경도 가능. Chart의 values.yaml의 형식을 참고해서 작 성 $ cat values.yaml image: tag: x.x.x ... $ helm install stable/mariadb -f values.yaml
  • 47. Helm chart contribution ● 내가 만든 애플리케이션을 kubernetes helm repository에 배포하고 싶다면?
  • 48. Tips for contribution 1. Kubernetes helm code repository fork 2. 아래 가이드 참고하여 contributor 서명 후 commit a. https://github.com/helm/charts/blob/master/CONTRIBUTING.md 3. “helm create”로 만들어진 최신 버전 chart를 참고하여 내가 만든 chart 검토 4. Guidelines을 참고하여 내가 만든 chart 검토 a. https://github.com/helm/charts/blob/master/REVIEW_GUIDELINES.md 5. 내가 만든 chart를 incubator 디렉토리에 commit 6. Pull request!
  • 49. 참고자료 Helm 참고 자료 ● 블로그 : https://yunsangjun.github.io/blog/ Kubernetes 참고 자료 ● 블로그 : http://tech.cloudz-labs.io/
  • 50. Q & A