Delivering Kubernetes Apps with Helm - Schedschd.ws/hosted_files/cnkc16/66/Helm KubeCon...

37
Delivering Kubernetes Apps with Helm Matt Butcher @technosophos Michelle Noorali @michellenoorali Adnan Abdulhussein @prydonius

Transcript of Delivering Kubernetes Apps with Helm - Schedschd.ws/hosted_files/cnkc16/66/Helm KubeCon...

Delivering Kubernetes Apps with Helm

Matt Butcher @technosophosMichelle Noorali @michellenooraliAdnan Abdulhussein @prydonius

https://flic.kr/p/74GbQz

Kubernetes’ tools let you build your furniture from scratch.

Most of us don’t want to build our furniture from scratch

We need a tool to manage a group of resources as one unit.

The Package Manager for KubernetesPackages == Charts

ChartsAre application definitionsConsist of metadata, k8s resources, & a readme

Download Binary or Use Homebrew$ brew cask install helm

Getting Started Is Simple$ helm init

Helm & TillerLike peanut butter & jelly

Tiller

● in-cluster component● Lives his life inside k8s as a pod● helps manage releases in your cluster

○ Release = installation of a Kubernetes Chart

Kubernetes

TillerHelm Client

gRPC

Install Apps On k8sQuickly

Upgrade Your AppWithout thinking twice

Delete Your AppJust for fun

Your First Chart$ helm create myapp

myapp├── Chart.yaml├── README.md├── charts├── templates└── values.yaml

Chart Metadataname: mariadbversion: 0.5.2description: Chart for MariaDBkeywords:- mariadb- mysql- database- sqlhome: https://mariadb.orgsources:- https://github.com/bitnami/bitnami-docker-mariadbmaintainers:- name: Bitnami email: [email protected]: gotpl

myapp├── Chart.yaml├── README.md├── charts├── templates│ ├── deployment.yaml│ └── svc.yaml└── values.yaml

● Kubernetes resources

● Templated using the Go template engine

Templates

myapp├── Chart.yaml├── README.md├── charts├── templates└── values.yaml

persistence: enabled: true storageClass: generic accessMode: ReadWriteOnce size: 8Gi

Configuration{{- if .Values.persistence.enabled }}kind: PersistentVolumeClaimapiVersion: v1spec: accessModes: - {{ .Values.persistence.accessMode | quote }} resources: requests: storage: {{ .Values.persistence.size | quote }}{{- end }}

myapp├── Chart.yaml├── README.md├── charts├── templates└── values.yaml

persistence: enabled: true storageClass: generic accessMode: ReadWriteOnce size: 8Gi

Configuration

$ helm install -f myvalues.yaml ./myapp

$ helm install --set persistence.size=5Gi \ ./myapp

myapp├── Chart.yaml├── README.md├── charts├── templates│ └── NOTES.txt└── values.yaml

Chart Docs● README

○ Short description of the Chart

○ Prerequisites or requirements

○ Detail customization options and defaults

● NOTES.txt

○ Any relevant post-installation information for

the Chart

○ Instructions on how to access the application or

service provided by the Chart

myapp├── Chart.yaml├── README.md├── charts│ └── mariadb-0.5.2.tgz├── requirements.yaml├── templates└── values.yaml

dependencies:- name: mariadb version: 0.5.2 repository: http://storage.googleapis.com/kubernetes-charts

Dependencies

$ helm dependencies update

Chart Best Practices

Self-contained

Modularized

Reusable

Reproducible

Configurable

Curated, production-ready applicationsSource: github.com/kubernetes/charts$ helm install stable/wordpress

Chart Repositories

● Over basic HTTP

$ helm serve

$ helm repo add my-charts http://localhost:8879

● Package a Chart and add it to the local chart repository

$ helm package foo --save

$ helm search foo

local/foo-0.1.0.tgz

5 Ways Helm Helps Teams

Get started quickly with existing charts

Build your own charts, and easily share them

Manage application lifecycle over time

Fit releases to your existing tools and process (not vice versa)

Let the cluster be the collaborative center for your releases

Helm Community

● Over 60 contributors● 1 year old● Slack channel: Kubernetes/#Helm● Public dev meetings: Thursdays @ 9:30

pacific● Weekly updates & demos at SIG-Apps

meetings: Mondays @ 9am pacific

Join us!

Thank You!