Delivering Kubernetes Apps with Helm Michelle Noorali - - PowerPoint PPT Presentation

delivering kubernetes apps with helm
SMART_READER_LITE
LIVE PREVIEW

Delivering Kubernetes Apps with Helm Michelle Noorali - - PowerPoint PPT Presentation

Delivering Kubernetes Apps with Helm Michelle Noorali @michellenoorali Adnan Abdulhussein @prydonius Adam Reese @areese Agenda Intro to Kubernetes Intro to Helm Helm Demo Chart Package and Repositories Lessons learned


slide-1
SLIDE 1

Delivering Kubernetes Apps with Helm

Michelle Noorali @michellenoorali Adnan Abdulhussein @prydonius Adam Reese @areese

slide-2
SLIDE 2

Agenda

  • Intro to Kubernetes
  • Intro to Helm
  • Helm Demo
  • Chart Package and Repositories
  • Lessons learned
slide-3
SLIDE 3

Kubernetes

Production-Grade Container Orchestration Platform Google does it, so can you Integrates with GCE, AWS, Azure, OpenStack, etc. Backed by a large open source community

slide-4
SLIDE 4

Kubernetes Objects

Pods are the smallest deployable units of computing

slide-5
SLIDE 5

No pet cows

slide-6
SLIDE 6

Services

Pods will come and go, but services will never leave you

slide-7
SLIDE 7

Example: Kubernetes resource

apiVersion: extensions/v1beta1 kind: Deployment metadata: name: nginx-deployment spec: minReadySeconds: 5 template: metadata: labels: app: nginx spec: containers:

  • name: nginx

image: nginx:1.7.9 ports:

  • containerPort: 80
slide-8
SLIDE 8

Moar YAML

apiVersion: extensions/v1beta1 kind: Deployment metadata: name: newbie-bobcat-jenkins labels: heritage: "Tiller" release: "newbie-bobcat" chart: "jenkins-0.1.14" component: "newbie-bobcat-jenkins-master" spec: replicas: 1 strategy: type: RollingUpdate selector: matchLabels: component: "newbie-bobcat-jenkins-master" template: metadata: labels: heritage: "Tiller" release: "newbie-bobcat" chart: "jenkins-0.1.14" component: "newbie-bobcat-jenkins-master" annotations: spec: securityContext: runAsUser: 0 containers:
  • name: newbie-bobcat-jenkins
image: "gcr.io/kubernetes-charts-ci/jenkins-master-k8s:v0.6.0" imagePullPolicy: "Always" args: [ "--argumentsRealm.passwd.$(ADMIN_USER)=$(ADMIN_PASSWORD)", "--argumentsRealm.roles.$(ADMIN_USER)=admin"] env:
  • name: JAVA_OPTS
value: ""
  • name: ADMIN_PASSWORD
valueFrom: secretKeyRef: name: newbie-bobcat-jenkins key: jenkins-admin-password
  • name: ADMIN_USER
valueFrom: secretKeyRef: name: newbie-bobcat-jenkins key: jenkins-admin-user ports:
  • containerPort: 8080
name: http
  • containerPort: 50000
name: slavelistener resources: requests: cpu: "200m" memory: "256Mi" volumeMounts:
  • mountPath: /var/jenkins_home
name: jenkins-home readOnly: false
  • mountPath: /var/jenkins_config
name: jenkins-config readOnly: true volumes:
  • name: jenkins-config
configMap: name: newbie-bobcat-jenkins
  • name: jenkins-home
emptyDir: {}
slide-9
SLIDE 9

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

Kubernetes’ tools let you build your furniture from scratch.

slide-10
SLIDE 10

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

slide-11
SLIDE 11
slide-12
SLIDE 12

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

slide-13
SLIDE 13
slide-14
SLIDE 14

The Package Manager for Kubernetes

Packages == Charts

slide-15
SLIDE 15

Charts

  • Are application definitions
  • Consist of...

○ Metadata ○ Kubernetes resource definitions ○ Documentation

  • Live in chart repositories
slide-16
SLIDE 16

Let’s take Helm for a spin

slide-17
SLIDE 17

Grab Helm on Github

github.com/kubernetes/helm

slide-18
SLIDE 18

Getting Started is Simple

$ helm init

slide-19
SLIDE 19

Helm & Tiller

Like peanut butter & jelly

slide-20
SLIDE 20

Tiller

  • Server-side component component
  • Stores the state of your app deployments
  • Helps manage app deployments in your cluster

Kubernetes Tiller Helm Client gRPC

slide-21
SLIDE 21

Demo

[link here]

slide-22
SLIDE 22

We saw how...

  • Kubernetes manifests are painful
  • Helm makes this easier
  • Installed a chart
slide-23
SLIDE 23
slide-24
SLIDE 24

github.com/kubernetes/charts

slide-25
SLIDE 25
  • Ready-to-deploy apps

○ Up-to-date ○ Secure

  • Community contributed
  • Define best practices

Official Chart Repository

slide-26
SLIDE 26

Your First Chart

$ helm create myapp

slide-27
SLIDE 27

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

Navigating a Chart

slide-28
SLIDE 28

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

Templates

+ Go templating

slide-29
SLIDE 29

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

image: mycompany/myapp:1.0.0 imagePullPolicy: IfNotPresent service: port: 80

Configuration

apiVersion: extensions/v1beta1 kind: Deployment spec: template: spec: containers:

  • name: {{ .Chart.Name }}

image: "{{ .Values.image }}" imagePullPolicy: {{ .Values.imagePullPolicy }} ports:

  • containerPort: {{ .Values.service.port }}

templates/deployment.yaml values.yaml

slide-30
SLIDE 30

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

Configuration

$ helm install --set service.port=8080 \ ./myapp $ helm install -f myvalues.yaml ./myapp

image: mycompany/myapp:1.0.0 imagePullPolicy: IfNotPresent service: port: 80

values.yaml

slide-31
SLIDE 31

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

dependencies:

  • name: mariadb

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

Dependencies

$ helm dependencies update

requirements.yaml

slide-32
SLIDE 32

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

Chart Docs

slide-33
SLIDE 33

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

Chart Metadata

name: mariadb version: 0.5.2 description: Chart for MariaDB keywords:

  • mariadb
  • mysql
  • database
  • sql

home: https://mariadb.org sources:

  • https://github.com/bitnami/bitnami-docker-mariadb

maintainers:

  • name: Bitnami

email: containers@bitnami.com engine: gotpl

slide-34
SLIDE 34
  • github.com/kubernetes/helm docs
  • $ helm repo add mycompany charts.mycompany.com
  • $ helm install mycompany/myapp

Host Your Very Own Charts

slide-35
SLIDE 35

Helm Today

  • Over 100 contributors
  • Over 1.5 years old
  • First project to graduate from Kubernetes Incubator

Join us!

slide-36
SLIDE 36
  • Timing is everything
  • Making it dance
  • Finding our users
  • Past iterations

Lessons Learned/Helm History

slide-37
SLIDE 37

Lessons Learned: Official Charts Repository

  • Influx of submissions
  • Version conflicts
  • Mass changes
  • Inconsistent configurations
slide-38
SLIDE 38

Improvements: Official Charts Repository

  • Labeling PRs
  • Milestones
  • Weekly Maintainer Syncs
slide-39
SLIDE 39

Charts 2.0

  • Functional testing
  • Common/Base chart
slide-40
SLIDE 40

Thank You!

Slack channel with 1000 members Kubernetes/#Helm Public dev meetings Thursdays @ 9:30 pacific Weekly updates & demos at SIG-Apps meetings Mondays @ 9am pacific