Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Kubernetes & Helm Tech Talk

Kubernetes & Helm Tech Talk

Tech Talk about Kubernetes and Helm

vincentdesmet

March 09, 2017

Transcript

49 slides
  1. Linux Host CONTAINERS Container foo rails server -b 0.0.0.0 usr/src/app/

    ├── Gemfile ├── Gemfile.lock ├── Rakefile ├── app │ ├── api │ └── ... └── bins / libs ...
  2. LABELS app : my-app role : master track: stable app

    : my-app role : worker track: stable app : my-app role : worker track: canary app : my-app role : master track: canary
  3. SELECTORS app : my-app app : my-app role : master

    track: stable app : my-app role : worker track: stable app : my-app role : worker track: canary app : my-app role : master track: canary
  4. SELECTORS app : my-app role : worker app : my-app

    role : master track: stable app : my-app role : worker track: stable app : my-app role : worker track: canary app : my-app role : master track: canary
  5. SELECTORS app : my-app track: canary app : my-app role

    : master track: stable app : my-app role : worker track: stable app : my-app role : worker track: canary app : my-app role : master track: canary
  6. CONTROL LOOPS Desired state Actual state pods: - foo -

    bar pods: - foo create “bar” Create
  7. REPLICA SETS + Replica Set: - replicas: 1 - selector:

    - app: my-app - version: 1.0 - Desired State: - Pod Specification - Replica Count - Label Selector
  8. SERVICES Service: - nodePort: 30128 - selector: - app: my-app

    - version: 1.0 - de-couple discovery from application - Define how to access pods - Act as a proxy (Virtual IP - stable for DNS) Think of: - Dynamic Routing Table
  9. CANARIES + Replica Set: - replicas: 2 - selector: -

    app: my-app - version: 1.0 Service: - nodePort: 30128 - selector: - app: my-app + Replica Set: - replicas: 1 - selector: - app: my-app - version: canary Think of: - Partially live the new version
  10. DEPLOYMENTS Service: - nodePort: 30128 - selector: - app: my-app

    + Replica Set: - replicas: 2 - selector: - app: my-app - version: 1.0 + - Manage updates with Deployment resources
  11. UPDATES Service: - nodePort: 30128 - selector: - app: my-app

    + Replica Set: - replicas: 4 - selector: - app: my-app - version: 1.0 + Deployment: - strategy: - rollingUpdate
  12. UPDATES Service: - nodePort: 30128 - selector: - app: my-app

    + + Replica Set: - replicas: 1 - selector: - app: my-app - version: 2.0 Replica Set: - replicas: 4 - selector: - app: my-app - version: 1.0 + Deployment: - strategy: - rollingUpdate
  13. UPDATES Service: - nodePort: 30128 - selector: - app: my-app

    + + Replica Set: - replicas: 1 - selector: - app: my-app - version: 2.0 Replica Set: - replicas: 3 - selector: - app: my-app - version: 1.0 + Deployment: - strategy: - rollingUpdate
  14. UPDATES Service: - nodePort: 30128 - selector: - app: my-app

    + + Replica Set: - replicas: 2 - selector: - app: my-app - version: 2.0 Replica Set: - replicas: 3 - selector: - app: my-app - version: 1.0 + Deployment: - strategy: - rollingUpdate
  15. UPDATES Service: - nodePort: 30128 - selector: - app: my-app

    + + Replica Set: - replicas: 2 - selector: - app: my-app - version: 2.0 Replica Set: - replicas: 2 - selector: - app: my-app - version: 1.0 + Deployment: - strategy: - rollingUpdate
  16. UPDATES Service: - nodePort: 30128 - selector: - app: my-app

    + + Replica Set: - replicas: 3 - selector: - app: my-app - version: 2.0 Replica Set: - replicas: 2 - selector: - app: my-app - version: 1.0 + Deployment: - strategy: - rollingUpdate
  17. UPDATES Service: - nodePort: 30128 - selector: - app: my-app

    + + Replica Set: - replicas: 3 - selector: - app: my-app - version: 2.0 Replica Set: - replicas: 1 - selector: - app: my-app - version: 1.0 + Deployment: - strategy: - rollingUpdate
  18. UPDATES Service: - nodePort: 30128 - selector: - app: my-app

    + Replica Set: - replicas: 4 - selector: - app: my-app - version: 2.0 Replica Set: - replicas: 1 - selector: - app: my-app - version: 1.0 + + Deployment: - strategy: - rollingUpdate
  19. UPDATES Service: - nodePort: 30128 - selector: - app: my-app

    + Replica Set: - replicas: 4 - selector: - app: my-app - Version: 2.0 Replica Set: - replicas: 0 - selector: - app: my-app - version: 1.0 + + Deployment: - strategy: - rollingUpdate
  20. UPDATES Service: - nodePort: 30128 - selector: - app: my-app

    + Replica Set: - replicas: 4 - selector: - app: my-app - Version: 2.0 + Deployment: - strategy: - rollingUpdate
  21. CONFIGMAPS Service: - nodePort: 30128 - selector: - app: my-app

    + + Deployment: - strategy: - rollingUpdate ConfigMap: - sample.yaml: | env: production cache: true max_threads: 8
  22. SECRETS Service: - nodePort: 30128 - selector: - app: my-app

    + + Deployment: - strategy: - rollingUpdate Secret: - sample.yaml: | key: *** db_user: *** db_pw: ***
  23. Recap - Multiple resource types - Deployments - Services -

    ConfigMaps - Secrets - … - Serializable Manifests (store as yaml) Managing these bundles is a challenge in the long run!
  24. Challenges 1. Collaboration a. Sharing Manifest files, trust? b. Iterating

    c. Best Practices 2. Managing Releases a. Define package b. Tweaking ~ Multiple copies & variations c. Migrating
  25. Helm: Package Manager - Collaboration with Google, Bitnami, Deis and

    others - Deis/Helm -> Kubernetes/Helm - Architecture: - Client: Helm - Server: Tiller - This talk: - Focused on writing charts
  26. Helm core values - Aim for the Apt/Yum/Homebrew UX -

    Ensure collaboration - Reproducible releases - Shareable Packages
  27. Chart, Repositories, Releases - Chart: “Package”, “Bundle” - Repository: Package

    Repository Evolving towards a registry (CoreOS) - Release: Installed Chart (same chart can be installed multiple times)
  28. Writing Charts - Templating and Release Management - More templating

    and User notes - Debugging and Troubleshooting features
  29. Review using helm - Install charts (creates a release) -

    helm install - List releases - helm ls - - Bootstrap charts - helm create
  30. More features - Upgrade Releases - helm upgrade <release> -

    Search Charts - helm search - KubeApps.com (Monocular - https://github.com/helm/monocular) - Manage Chart dependencies - requirements.yaml - helm dep up - Helm Plugins - Keybase: helm keybase sign/verify - GitHub: helm github push

More Decks by vincentdesmet

Other Decks in Programming