09-08-2020 Fellow Cloud 1
LeveragingHelmtomanage
KubernetesDeployments
About Speaker
Works as DevOps Engineer
https://github.com/manoj8928/
#docker #k8s #devsecops #cloud #automation
https://medium.com/@manoj.bhagwat60
@manoj8928
09-08-2020 Fellow Cloud 2
Agenda
• k8s App Deployment Methods
• k8s Deployment Challenges
• What is Helm ?
• Helm: Brief Architecture
• Helm Files Structure
• Live Demo
• Best practices of Helm
09-08-2020 Fellow Cloud 3
k8s Application Deployment File
09-08-2020 Fellow Cloud 4
ApplicationDeploymentMethods
• blue/green: New version alongside old version then switching at one point; Rollout/Rollback
• canary: Release a new version to few users and then decide full rollout based on result
• a/b testing: Feature testing based on statistics; dark deployment that users are unaware of update
• rolling: Update new version one after another slowly with no downtime
• recreate: Create a new one and kill the old one; best for development environments
• shadow: Both versions are running parallel with not impacting other; mocking services
09-08-2020 Fellow Cloud 5
k8sDeployment/AutomationTools
• Kubectl – Create, manage and deploy k8s artifacts - https://kubernetes.io/docs/reference/kubectl/
• Kustomize - A template-free way to customize application configuration - https://kustomize.io/
• CNAB - Cloud Native Application Bundling - https://cnab.io/
• Skaffold - building, pushing and deploying your application - https://skaffold.dev/
• Spinnakar – Multi cloud continous delivery - https://www.spinnaker.io/
• Kudo - Universal declarative Operator - https://kudo.dev
• Kompose – Move docker file to k8s objects - http://kompose.io/
• Draft – Streamlined k8s Deployment - https://draft.sh/
• Brigade – Event driven scripting for k8s - https://brigade.sh/
• Kashti – Visualization Dashboard for Brigade - https://github.com/brigadecore/kashti
• Jenkin - k8s plugin & Jenkin X - https://github.com/jenkinsci/kubernetes-plugin
• Github - Marketplace for tools - https://github.com/marketplace/category/continuous-integration
• Helm – The package manager for k8s - https://helm.sh/
09-08-2020 Fellow Cloud 6
Life without Helm
• Write Kubernetes manifests by hand
• Do this every time you need to release anything
• Figure out your own sharing
• Tweak resources by hand
• Use kubectl to manage these manifests
09-08-2020 Fellow Cloud 7
What is Helm?
Helm is a package manager, helps you manage Kubernetes applications — define, install, and upgrade even
the most complex Kubernetes application
• Helm is like apt or yum in Linux World
• Why do we need a package manager?
• Application focused Better control
• Container version handling - upgrade/rollback
• Manage dependencies
• Reproducible and shareable
• Helm initially started with Deis (now with Microsoft) & then Google Deployment Manger team joined to
create helm2.
Helm is now in CNCF Incubation project - https://helm.sh/
09-08-2020 Fellow Cloud 8
Helm: Architecture
Helm Client, a command line tool with the
following responsibilities
• Interacting with the Tiller server
• Sending charts to be installed
• Upgrading or uninstalling of existing releases
• Managing repositories
Tiller Server, an in-cluster server with the following
responsibilities:
• Interacts with the Helm client
• Interfaces the Kubernetes API server
• Combining a chart and configuration to build a
release
• Installing charts and tracking the release
• Upgrading and uninstalling charts
09-08-2020 Fellow Cloud 9
Charts, Repositories, Releases
Helm Commands
• Init: Set up Helm for the first time (helm init)
• Install: Install a chart (helm install alpine)
• Get, Status, List: Find out about charts (helm list)
• Repo Add, List, Remove, Index: Manage your helm repositories
• Search: Search repos for charts
• Create, Package: Create and package new charts
09-08-2020 Fellow Cloud 10
Demo Time
• Deploy sample application using kubectl method
• Deploy app using helm3
• Release new version of sample application using
Helm
09-08-2020 Fellow Cloud 11
Best Practices
• Create Chart for each (micro)service; keep it in same Git repository
• Learn and practice Go Template language (and Sprig template library)
• Use Helm hooks to control release flow
• Use helm test to validate releases
• Host your own Helm repository for private charts; just serve index.html and packaged charts (can be hosted
on AWS S3, Google Storage, GH pages, or other web server)
• Manage environments with multiple Values files
• (!) Do not commit secrets into GitHub; or encrypt secrets with sops or similar tool
• Follow community Helm best practices and conventions: take a look at docs and Kubernetes/charts
examples
• Use helm template plugin to debug Helm Charts; or use --dry-run flag
09-08-2020 Fellow Cloud 12
More About Helm
CNCF SIG Helm -
• https://www.cncf.io/announcement/2019/09/12/cloud-native-computing-foundation-announces-
application-delivery-sig/
GitHub Repo Link:
• http://github.com/kubernetes/helm
Official Documentation
• https://helm.readthedocs.io/en/latest/architecture/#helm-classic-architecture
Helm
• https://helm.sh
09-08-2020 Fellow Cloud 13
09-08-2020 Fellow Cloud 14

Leveraging Helm to manage Deployments on Kubernetes

  • 1.
    09-08-2020 Fellow Cloud1 LeveragingHelmtomanage KubernetesDeployments
  • 2.
    About Speaker Works asDevOps Engineer https://github.com/manoj8928/ #docker #k8s #devsecops #cloud #automation https://medium.com/@manoj.bhagwat60 @manoj8928 09-08-2020 Fellow Cloud 2
  • 3.
    Agenda • k8s AppDeployment Methods • k8s Deployment Challenges • What is Helm ? • Helm: Brief Architecture • Helm Files Structure • Live Demo • Best practices of Helm 09-08-2020 Fellow Cloud 3
  • 4.
    k8s Application DeploymentFile 09-08-2020 Fellow Cloud 4
  • 5.
    ApplicationDeploymentMethods • blue/green: Newversion alongside old version then switching at one point; Rollout/Rollback • canary: Release a new version to few users and then decide full rollout based on result • a/b testing: Feature testing based on statistics; dark deployment that users are unaware of update • rolling: Update new version one after another slowly with no downtime • recreate: Create a new one and kill the old one; best for development environments • shadow: Both versions are running parallel with not impacting other; mocking services 09-08-2020 Fellow Cloud 5
  • 6.
    k8sDeployment/AutomationTools • Kubectl –Create, manage and deploy k8s artifacts - https://kubernetes.io/docs/reference/kubectl/ • Kustomize - A template-free way to customize application configuration - https://kustomize.io/ • CNAB - Cloud Native Application Bundling - https://cnab.io/ • Skaffold - building, pushing and deploying your application - https://skaffold.dev/ • Spinnakar – Multi cloud continous delivery - https://www.spinnaker.io/ • Kudo - Universal declarative Operator - https://kudo.dev • Kompose – Move docker file to k8s objects - http://kompose.io/ • Draft – Streamlined k8s Deployment - https://draft.sh/ • Brigade – Event driven scripting for k8s - https://brigade.sh/ • Kashti – Visualization Dashboard for Brigade - https://github.com/brigadecore/kashti • Jenkin - k8s plugin & Jenkin X - https://github.com/jenkinsci/kubernetes-plugin • Github - Marketplace for tools - https://github.com/marketplace/category/continuous-integration • Helm – The package manager for k8s - https://helm.sh/ 09-08-2020 Fellow Cloud 6
  • 7.
    Life without Helm •Write Kubernetes manifests by hand • Do this every time you need to release anything • Figure out your own sharing • Tweak resources by hand • Use kubectl to manage these manifests 09-08-2020 Fellow Cloud 7
  • 8.
    What is Helm? Helmis a package manager, helps you manage Kubernetes applications — define, install, and upgrade even the most complex Kubernetes application • Helm is like apt or yum in Linux World • Why do we need a package manager? • Application focused Better control • Container version handling - upgrade/rollback • Manage dependencies • Reproducible and shareable • Helm initially started with Deis (now with Microsoft) & then Google Deployment Manger team joined to create helm2. Helm is now in CNCF Incubation project - https://helm.sh/ 09-08-2020 Fellow Cloud 8
  • 9.
    Helm: Architecture Helm Client,a command line tool with the following responsibilities • Interacting with the Tiller server • Sending charts to be installed • Upgrading or uninstalling of existing releases • Managing repositories Tiller Server, an in-cluster server with the following responsibilities: • Interacts with the Helm client • Interfaces the Kubernetes API server • Combining a chart and configuration to build a release • Installing charts and tracking the release • Upgrading and uninstalling charts 09-08-2020 Fellow Cloud 9
  • 10.
    Charts, Repositories, Releases HelmCommands • Init: Set up Helm for the first time (helm init) • Install: Install a chart (helm install alpine) • Get, Status, List: Find out about charts (helm list) • Repo Add, List, Remove, Index: Manage your helm repositories • Search: Search repos for charts • Create, Package: Create and package new charts 09-08-2020 Fellow Cloud 10
  • 11.
    Demo Time • Deploysample application using kubectl method • Deploy app using helm3 • Release new version of sample application using Helm 09-08-2020 Fellow Cloud 11
  • 12.
    Best Practices • CreateChart for each (micro)service; keep it in same Git repository • Learn and practice Go Template language (and Sprig template library) • Use Helm hooks to control release flow • Use helm test to validate releases • Host your own Helm repository for private charts; just serve index.html and packaged charts (can be hosted on AWS S3, Google Storage, GH pages, or other web server) • Manage environments with multiple Values files • (!) Do not commit secrets into GitHub; or encrypt secrets with sops or similar tool • Follow community Helm best practices and conventions: take a look at docs and Kubernetes/charts examples • Use helm template plugin to debug Helm Charts; or use --dry-run flag 09-08-2020 Fellow Cloud 12
  • 13.
    More About Helm CNCFSIG Helm - • https://www.cncf.io/announcement/2019/09/12/cloud-native-computing-foundation-announces- application-delivery-sig/ GitHub Repo Link: • http://github.com/kubernetes/helm Official Documentation • https://helm.readthedocs.io/en/latest/architecture/#helm-classic-architecture Helm • https://helm.sh 09-08-2020 Fellow Cloud 13
  • 14.