Package Manager in K8S
Piotr Perzyna - 03/21/2018
Agenda
● What is HELM?
○ 4 Words to know
● How to use it?
● Why teams HELM?
What is HELM?
HELM is a package manager like . . . . . . . . for kubernetes app.
● npm
● brew
● pip
● apt
● yum
Simple chart
$ helm create application
application/
values.yml # A YAML file containing sample
values
chart.yaml # A YAML file containing information about the
chart
README.md # OPTIONAL: A human-readable README file
requirements.yaml # OPTIONAL: A YAML file listing
charts/ # OPTIONAL: A directory containing depends
charts.
templates/ # OPTIONAL: A directory of
templates K8S manifest
deployment.yml # EXAMPLE
configmap.yml # EXAMPLE
secrets.yml # EXAMPLE
service.yml # EXAMPLE
Sample chart
service.yml
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.name }}
namespace: {{ .Values.namespace }}
labels:
app: {{ .Values.name }}
release: {{ .Release.Name }}
spec:
type: {{ .Values.service.type }}
ports:
- protocol: TCP
port: {{ .Values.service.port }}
targetPort: 8000
selector:
app: {{ .Values.name }}
release: {{ .Release.Name }}
values.yml
namespace: default
name: application
image:
repository: 10clouds/application
tag: latest
pullPolicy: IfNotPresent
service:
type: NodePort
port: 80
env:
DJANGO_DEBUG: ‘1’
…
…
…
4 Words to know!
chart
templated K8S manifest
charts repository
registry of charts
+
chart + value = release
tiller
pod to manage releases
1 2
3 4
Manage charts
Install
$ helm install -n release-name -f values.yml ./application
LIST
$ helm list --all
NAME VERSION UPDATED STATUS CHART
release-name 1 10:00 21/03/2018 DEPLOYED application-1.0.0
production 44 09:15 21/03/2018 DELETED another_app-1.0.0
UPDATE
$ helm upgrade --recreate-pods -f values.yml --set image.tag=123 release-name ./application
ROLLBACK
$ helm rollback --recreate-pods release-name <version>
Why teams HELM?
● easy install
● app portability
● versionable
● easy rollbacks
● templatable
● better then kubectl apply -f
Q&A
THE END
Thank you for your attention!
Piotr Perzyna, 10Clouds

Helm - Package manager in K8S

  • 1.
    Package Manager inK8S Piotr Perzyna - 03/21/2018
  • 2.
    Agenda ● What isHELM? ○ 4 Words to know ● How to use it? ● Why teams HELM?
  • 3.
    What is HELM? HELMis a package manager like . . . . . . . . for kubernetes app. ● npm ● brew ● pip ● apt ● yum
  • 4.
    Simple chart $ helmcreate application application/ values.yml # A YAML file containing sample values chart.yaml # A YAML file containing information about the chart README.md # OPTIONAL: A human-readable README file requirements.yaml # OPTIONAL: A YAML file listing charts/ # OPTIONAL: A directory containing depends charts. templates/ # OPTIONAL: A directory of templates K8S manifest deployment.yml # EXAMPLE configmap.yml # EXAMPLE secrets.yml # EXAMPLE service.yml # EXAMPLE
  • 5.
    Sample chart service.yml apiVersion: v1 kind:Service metadata: name: {{ .Values.name }} namespace: {{ .Values.namespace }} labels: app: {{ .Values.name }} release: {{ .Release.Name }} spec: type: {{ .Values.service.type }} ports: - protocol: TCP port: {{ .Values.service.port }} targetPort: 8000 selector: app: {{ .Values.name }} release: {{ .Release.Name }} values.yml namespace: default name: application image: repository: 10clouds/application tag: latest pullPolicy: IfNotPresent service: type: NodePort port: 80 env: DJANGO_DEBUG: ‘1’ … … …
  • 6.
    4 Words toknow! chart templated K8S manifest charts repository registry of charts + chart + value = release tiller pod to manage releases 1 2 3 4
  • 7.
    Manage charts Install $ helminstall -n release-name -f values.yml ./application LIST $ helm list --all NAME VERSION UPDATED STATUS CHART release-name 1 10:00 21/03/2018 DEPLOYED application-1.0.0 production 44 09:15 21/03/2018 DELETED another_app-1.0.0 UPDATE $ helm upgrade --recreate-pods -f values.yml --set image.tag=123 release-name ./application ROLLBACK $ helm rollback --recreate-pods release-name <version>
  • 8.
    Why teams HELM? ●easy install ● app portability ● versionable ● easy rollbacks ● templatable ● better then kubectl apply -f
  • 9.
  • 10.
    THE END Thank youfor your attention! Piotr Perzyna, 10Clouds