Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Optimizing Kubernetes deployments with Helm

247 views

Published on

Introduction to Helm, the package manager for Kubernetes.

Published in: Software
  • Be the first to comment

  • Be the first to like this

Optimizing Kubernetes deployments with Helm

  1. 1. Erwin de Gier - Trifork Amsterdam Optimizing Kubernetes deployments with Helm @erwindeg github.com/erwindeg edegier.nl
  2. 2. Project deliveries EAR WAR JAR Docker Images YML
  3. 3. Redis Master (Container) Redis Slave (Container) PHP Webserver (Container) PHP Webserver (Container) PHP Webserver (Container) Redis Slave (Container) Redis Master (Service) Frontend (Service) Redis Master (Service)
  4. 4. source: http://helm.sh
  5. 5. source: https://blog.hasura.io/draft-vs-gitkube-vs-helm-vs-ksonnet-vs-metaparticle-vs-skaffold-f5aa9561f948
  6. 6. Prerequisites • Connection to a Kubernetes Cluster • Docker Edge with Kubernetes • Mini-Kube • Hosted Kubernetes (GKE, AWS) • Installation of Helm (homebrew / download)
  7. 7. https://github.com/erwindeg/k8s-helm
  8. 8. $ kubectl config current-context
 docker-for-desktop
 $ helm init
 Tiller (the Helm server-side component) has been installed into your Kubernetes Cluster.
 Happy Helming! $ git clone https://github.com/erwindeg/k8s-helm
 $ cd k8s-helm
 $ helm install --name helm-gb-chart --namespace helm-gb ./helm_chart_guestbook
 NAME: helm-gb-chart
 LAST DEPLOYED: Fri Apr 20 15:44:13 2018
 NAMESPACE: helm-gb
 STATUS: DEPLOYED
  9. 9. NAME READY STATUS RESTARTS frontend-788d978f9b-bwm5p 1/1 Running 0 frontend-788d978f9b-hxmj6 1/1 Running 0 frontend-788d978f9b-mpvk5 1/1 Running 0 redis-master-7747787588-wp5cr 1/1 Running 0 redis-slave-865486c9df-8mcx5 1/1 Running 0 redis-slave-865486c9df-pnk5m 1/1 Running 0 $ kubectl get pods --namespace helm-gb
  10. 10. NAME TYPE CLUSTER-IP PORT(S) 
 frontend NodePort 10.107.212.37 80:32080/TCP
 redis-master ClusterIP 10.106.134.71 6379/TCP
 redis-slave ClusterIP 10.108.147.227 6379/TCP $ kubectl get svc --namespace helm-gb
  11. 11. $ helm list
 NAME REVISION UPDATED STATUS CHART 
 helm-gb-chart 1 Fri Apr 20 15:44:13 2018 DEPLOYED Guestbook-Chart-1.0.0
 
 $ helm upgrade helm-gb-chart helm_chart_guestbook --set /frontend.image=harshals/gb-frontend:1.1
 Release "helm-gb-chart" has been upgraded. Happy Helming! 
 $ helm list
 NAME REVISION UPDATED STATUS CHART
 helm-gb-chart 2 Fri Apr 20 16:05:51 2018 DEPLOYED Guestbook-Chart-1.0.0
  12. 12. $ helm history helm-gb-chart
 REVISION UPDATED STATUS CHART DESCRIPTION 1 Fri Apr 20 15:44:13 2018 SUPERSEDED Guestbook-Chart-1.0.0 Install complete 2 Fri Apr 20 16:05:51 2018 DEPLOYED Guestbook-Chart-1.0.0 Upgrade complete $ helm rollback helm-gb-chart 1 Rollback was a success! Happy Helming! $ helm history helm-gb-chart
 REVISION UPDATED STATUS CHART DESCRIPTION
 1 Fri Apr 20 15:44:13 2018 SUPERSEDED Guestbook-Chart-1.0.0 Install complete
 2 Fri Apr 20 16:05:51 2018 SUPERSEDED Guestbook-Chart-1.0.0 Upgrade complete
 3 Mon Apr 23 08:49:15 2018 DEPLOYED Guestbook-Chart-1.0.0 Rollback to 1
  13. 13. source: https://blog.hasura.io/draft-vs-gitkube-vs-helm-vs-ksonnet-vs-metaparticle-vs-skaffold-f5aa9561f948 https://github.com/kubernetes/charts
  14. 14. Dependencies
  15. 15. Gitlab CI Docker Registry Kubernetes helm upgrade —install $release-name $chartname —set image.tag=$branch_commit-hash $branch_commit-hash push
  16. 16. Gitlab CI Docker Registry Kubernetes helm upgrade $release-name $chartname $branch_commit-hash push Chart Repository upgrade upload
  17. 17. Alternatives • Kubectl • Terraform Kubernetes provider
  18. 18. Conclusion • Manage complex applications • Versioning and updates • Rollback • Sharing

×