Helm——Taylor Thomas,微软

本次演讲将探讨 Kubernetes 的包管理器 Helm 如何简化在 Kubernetes 上运行的应用程序的引导和管理。Kubernetes 包称为 Charts,它提供一种部署开箱即用的可配置应用程序或打包您自己的应用程序的方法。在本次以演示为主导的会议中,我们将展示如何使用 Helm 改善部署工作流程,创建和配置 Kubernetes Charts 的最佳实践,以及我们在构建 Helm 的过程中学到的经验教训。我们还会涉及下一个 Helm 主要版本的新功能。
展开查看详情

1.Take the Helm An Intro to Helm

2.An Acknowledgement

3.Helm, a package manager for Kubernetes

4.Helm: Core Concepts ● Chart - expert built recipe for installing an application ● Values - user supplied configuration ● Release - instance of Chart + Values that get deployed in Kubernetes

5.Prerequisites ● Download Helm & put it in your path ○ On a Mac: brew install kubernetes-helm ○ On Windows: choco install kubernetes-helm ○ Get the binary: https://github.com/helm/helm/releases/tag/v2.11.0 ● Grab a running Kubernetes cluster ○ Minikube: https://github.com/kubernetes/minikube/releases/tag/v0.30.0

6.$ helm init ● Configures your local environment ● Creates a pod called Tiller in your cluster

7.Tiller ● Server-side component ● Runs as a pod in the cluster ● Manages releases in your cluster Helm gRPC Tiller Client Kubernetes

8.Charts ● Are application definitions ● Consist of ○ Metadata ○ Kubernetes resource definitions ○ Configuration ○ Documentation ● Live in chart repositories

9.Where the Helm do I find charts? ● Lives at github.com/helm/charts ● Stable & Incubator repositories ● ~218 stable charts ● ~53 incubator charts

10.hub.kubeapps.com ● github.com/helm/monocular

11.Chart repositories ● Has an index.yaml file ● Any web server accessible via http(s)

12.Recap ● Helm is the client ● Tiller is the server ● Charts are the “package” ● Chart + Values = Release

13.Demo Time!

14.Chart your course

15.$ helm create <name>

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

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

18.Configuration values.yaml image: mycompany/myapp:1.0.0 imagePullPolicy: IfNotPresent myapp service: port: 80 ├── Chart.yaml templates/deployment.yaml ├── README.md apiVersion: extensions/v1beta1 kind: Deployment ├── charts spec: template: ├── templates spec: containers: └── values.yaml - name: {{ .Chart.Name }} image: "{{ .Values.image }}" └── requirements.yaml imagePullPolicy: {{ .Values.imagePullPolicy }} ports: - containerPort: {{ .Values.service.port }}

19. Configuration values.yaml image: mycompany/myapp:1.0.0 imagePullPolicy: IfNotPresent service: port: 80 Configure values on command line with the --set flag $ helm install --set service.port=8080 myapp/ Or pass in a new values file on command line with the -f flag $ helm install -f myvalues.yaml myapp

20.Dependencies requirements.yaml myapp dependencies: ├── Chart.yaml - name: mariadb version: 0.5.2 repository: http://storage.googleapis.com/kubernetes-charts ├── README.md ├── charts ├── templates └── values.yaml └── requirements.yaml

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

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

23.Want to become a Helmette?

24.Helm Community ● Lots of contributors (391 according to GitHub) ● Kubernetes slack channels: #helm-users, #helm-dev ● Weekly updates and demos at SIG Apps and the public Helm developer call (09:30 Pacific Time) ● Documentation at http://docs.helm.sh

25.Helpful Links ● Helm website: http://helm.sh ● Helm quickstart: https://docs.helm.sh/using_helm/#quickstart ● Helm documentation: https://docs.helm.sh ● Chart tips & tricks: https://youtu.be/16FU6U8eOdk?t=12m36s