Application Delivery and Release Management Honestbee @vincentdesmet with Containers, Kubernetes and Helm
Grocery and Food delivery
Honestbee We are Hiring DevOps!
Overview Context & overview of Containers (Docker) - Container Orchestration (Kubernetes) - Managing Releases (Helm) - CI/CD ~ Demo (Drone) -
Agile Evolution Today ~2000 Loosely Coupled Monolithic Services Rapidly Slow updated changing Many Small Servers Big Servers Reference: http://docker.com
Containers / VMs AppA AppB AppB AppA Bins / Libs Bins/Libs Bins/Libs Bins / Libs Guest OS Guest OS Container Runtime Interface Host OS Hypervisor Infrastructure Infrastructure
Docker containers • Packages up software binaries and dependencies • Isolates software from each other Container • Container is a standard format • Easily portable across environment • Allows ecosystem to develop around its standard Reference: http://docker.com
Docker Concepts Docker Image The basis of a Docker container Docker Container The standard unit in which the application service resides Docker Engine Creates, ships and runs Docker containers deployable on physical or virtual host locally, in a datacenter or cloud service provider Docker Registry On-premises registry for image storing and collaboration
Docker Tools: BUILD, SHIP, RUN
Container Orchestration Mesos - Kubernetes - Docker Swarm - ... -
More than just packing and Isolation Scheduling : Where should the containers run? - Resource Optimisation : How much resources does each container - really need? Lifecycle and health : Keep containers running despite failures - Discovery : How can I connect to the containers? - Monitoring : What’s happening with the containers? - Auth{n,z} : Control who can do what with the containers? - Aggregate : Compose set of containers into jobs - Scaling : Handle higher load by adding more instances - … - Source
"κυβερνήτης" (kubernetes) is KUBERNETES Greek for "pilot" or "helmsman of ship"
WHAT IS KUBERNETES? •Container orchestrator •Runs and manages containers •Supports multiple cloud & bare-metal environments •100% Open Source written in Go •Built on decades of experience of running containers at Google •First project hosted by CNCF (Accepted on Mar. 11 2016) Container packaged Dynamically scheduled (Micro) Service oriented
CONCEPTS: PODS Container Foo Container Bar Namespaces: - Net - IPC - … volumes
k8s - High Level View
k8s - High Level View
k8s - High Level View Run X Replicas = 2 Memory = 4Gi CPU = 2.5
k8s - High Level View Which node?
k8s - High Level View X n u R Run X
k8s - High Level View Pull X
k8s - High Level View X status X status
LABELS app : my-app app : my-app role : master role : master track: stable track: canary app : my-app app : my-app role : worker role : worker track: stable track: canary
SELECTORS app : my-app app : my-app role : master role : master track: stable track: canary app : my-app app : my-app role : worker role : worker track: stable track: canary app : my-app
SELECTORS app : my-app app : my-app role : master role : master track: stable track: canary app : my-app app : my-app role : worker role : worker track: stable track: canary app : my-app role : worker
SELECTORS app : my-app app : my-app role : master role : master track: stable track: canary app : my-app app : my-app role : worker role : worker track: stable track: canary app : my-app track: canary
REPLICA SETS - Desired State: Replica Set: - replicas: 1 + - selector: - app: my-app - version: 1.0 - Pod Specification - Replica Count - Label Selector
REPLICA SETS Replica Set: - replicas: 2 + - selector: - app: my-app - version: 1.0
REPLICA SETS Replica Set: - replicas: 4 + - selector: - app: my-app - version: 1.0
SERVICES - de-couple discovery from application Think of: - Define how to access pods - Dynamic Routing Table - Act as a proxy (Virtual IP - stable for DNS) Service: - nodePort: 30128 - selector: - app: my-app - version: 1.0
+ DEPLOYMENTS Replica Set: - Manage updates with Deployment resources - replicas: 2 + - selector: - app: my-app - version: 1.0 Service: - nodePort: 30128 - selector: - app: my-app
Deployment: - strategy: + - rollingUpdate UPDATES Replica Set: - replicas: 4 + - selector: - app: my-app - version: 1.0 Service: - nodePort: 30128 - selector: - app: my-app
Deployment: - strategy: + - rollingUpdate UPDATES Replica Set: Replica Set: - replicas: 4 + - replicas: 1 + - selector: - selector: - app: my-app - app: my-app - version: 1.0 - version: 2.0 Service: - nodePort: 30128 - selector: - app: my-app
Deployment: - strategy: + - rollingUpdate UPDATES Replica Set: Replica Set: - replicas: 3 + - replicas: 1 + - selector: - selector: - app: my-app - app: my-app - version: 1.0 - version: 2.0 Service: - nodePort: 30128 - selector: - app: my-app
Deployment: - strategy: + - rollingUpdate UPDATES Replica Set: Replica Set: - replicas: 3 + - replicas: 2 + - selector: - selector: - app: my-app - app: my-app - version: 1.0 - version: 2.0 Service: - nodePort: 30128 - selector: - app: my-app
Deployment: - strategy: + - rollingUpdate UPDATES Replica Set: Replica Set: - replicas: 2 + - replicas: 2 + - selector: - selector: - app: my-app - app: my-app - version: 1.0 - version: 2.0 Service: - nodePort: 30128 - selector: - app: my-app
Deployment: - strategy: + - rollingUpdate UPDATES Replica Set: Replica Set: - replicas: 2 + - replicas: 3 + - selector: - selector: - app: my-app - app: my-app - version: 1.0 - version: 2.0 Service: - nodePort: 30128 - selector: - app: my-app
Deployment: - strategy: + - rollingUpdate UPDATES Replica Set: Replica Set: - replicas: 1 + - replicas: 3 + - selector: - selector: - app: my-app - app: my-app - version: 1.0 - version: 2.0 Service: - nodePort: 30128 - selector: - app: my-app
Deployment: - strategy: + - rollingUpdate UPDATES Replica Set: Replica Set: - replicas: 1 + - replicas: 4 + - selector: - selector: - app: my-app - app: my-app - version: 1.0 - version: 2.0 Service: - nodePort: 30128 - selector: - app: my-app
Deployment: - strategy: + - rollingUpdate UPDATES Replica Set: Replica Set: - replicas: 0 + - replicas: 4 + - selector: - selector: - app: my-app - app: my-app - version: 1.0 - Version: 2.0 Service: - nodePort: 30128 - selector: - app: my-app
Deployment: - strategy: + - rollingUpdate UPDATES Replica Set: - replicas: 4 + - selector: - app: my-app - Version: 2.0 Service: - nodePort: 30128 - selector: - app: my-app
Deployment: - strategy: + - rollingUpdate CONFIGMAPS + ConfigMap: - sample.yaml: | env: production cache: true max_threads: 8 Service: - nodePort: 30128 - selector: - app: my-app
Deployment: - strategy: + - rollingUpdate SECRETS + Secret: - sample.yaml: | key: *** db_user: *** db_pw: *** Service: - nodePort: 30128 - selector: - app: my-app
Kubernetes Deployments Multiple resource types - ConfigMaps - Secrets - Services - … - Based on serializable Manifests - Managing these bundles is a challenge in the long run, can be improved
Challenges Collaboration 1. a. Sharing Manifest files, trust? b. Iterating c. Best Practices Managing Releases 2. a. Define package b. Tweaking ~ Multiple copies & variations c. Migrating
Helm: Package Manager Collaboration with Google, Bitnami, Deis and others - Deis/Helm -> Kubernetes/Helm - Architecture: - Client: Helm - Server: Tiller -
Helm core values Aim for the Apt/Yum/Homebrew User Experience - Ensure collaboration - Reproducible releases - Shareable Packages -
Kubeapps.com
Chart, Repositories, Releases Chart : “Package”, “Bundle” - Repository : Package Repository - Release : Installed Chart (same chart can be installed multiple times) -
Basic Architecture Client - Server
Review using helm Install charts (creates a release) - helm install - List releases - helm ls - Upgrade release - helm upgrade - View release history - helm history - Bootstrap charts - helm create -
Integration with CI/CD
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 -
Mean time to Dopamine Experience RoR promise: - Write a Blog in 15 minutes
Draft Accelerate time from app source code to Kubernetes deployment -
More Info https://youtu.be/QNx9-UjTVXA
Recommend
More recommend