DevOps With Kubernetes And Helm

Transcription

DevOps withKubernetes andHelmJessica DeenCloud Developer Advocate

HELLO!I am Jessica DeenI am here because I love technology andcommunity.I focus heavily on Linux, OSS, DevOps andContainers.I love Disney and CrossFit/Fitness.You can find me at @jldeen on GitHub,Twitter, and Instagram.

DisclaimerThe next 60 minutes will NOT makeyou an expert, but it will:-Get you thinkingShow you what’s possibleGive you some sample code for you to getstarted on your own time

GOING DIGITAL1 million/hournew devicescoming onlineby 202012 years60% computingaverage age of S&P in the public cloud500 corporationsby 2025by 2020

developersI need to create applicationsat a competitive rate withoutworrying about ITNew applications run smoothlyon my machine but malfunctionon traditional IT serversMy productivity and applicationinnovation become suspendedwhen I have to wait on IT

ITI need to manage serversand maintain compliancewith little disruptionI’m unsure of how to integrateunfamiliar applications, and Irequire help from developersI’m unable to focus on bothserver protection andapplication compliance

IT stress ginnovation

Cloud is a new way to think about a datacenterServersServices

DevOps: The Three StageConversationPeopleProcessProducts

DevOps is the union of people,process, and products to enablecontinuous delivery of value toour end users.-Donovan Brownhttp://bit.ly/WhatIs-DevOps

Key DevOps PracticesInfrastructure omated abilityMonitoringLoad Testing &Auto ScaleAutomatedRecovery (Rollback& Roll Forward)

DevOps BenefitsIT Performance Metrics201520162017DeploymentFrequency30x morefrequent200x morefrequent46x morefrequentLead Time forChanges200x faster2,555x faster440x fasterMean Time toRecover(MTTR)168x faster24x faster96x faster3x lower (1/3as likely)5x lower (1/5as likely)Change FailureRateSource: https://puppetlabs.com

DevelopersOperationsEnable ‘write-once, run-anywhere’ appsEnables microservice architecturesGreat for dev/test of apps and servicesProduction realismGrowing Developer CommunityPortability, Portability, PortabilityStandardized development, QA, and prodenvironmentsAbstract differences in OS distributionsand underlying infrastructureHigher compute densityEasily scale-up and scale-down inresponse to changing business needsDevOps

What is a Container?Not a real thing. An application delivery mechanism withprocess isolation based on several Linux kernel features.Namespaces (what aprocess can see)Cgroups (what a processcan use)v PIDv Memoryv Mountv Networkv UTSv IPCv Userv Cgroupv CPUv Blkiov Cpuacctv Cpusetv Devicesv Net prio

What isv Open Source Container Runtimev Mac, Linux, Windows Supportv Command Line Toolv “Dockerfile” formatv The Docker image format with layeredfilesystem

Docker Layered Filesystem

Docker Layered Filesystem

Virtualization versus ual machineContainerApplication XYZApplicationApp dependenciesDependenciesGuest OSCVMVMVMVMVMVMCDependency 1CCDependency 2Hypervisor 2Docker EngineHypervisor 1Host OSHost OSHardwareHardwareHardwareType 1Type 2C

The container advantageFastiterationAgiledeliveryFor ntFor ITElasticbursting

Demo

What did we just do?Kubernetes PipelineBuildPackageDeployTestKubernetes Repository

Container Orchestration:Kubernetes

What is Kubernetes?Open source container orchestrator that automatesdeployment, scaling, and management of applications.Features include:v Automatic bin packingv Self-healingv Horizontal scalingv Service discoveryv Load balancingv Designed by Googlev Based on theirsystem used torun BILLIONS ofcontainers perweekv Automated rollouts and rollbacks v Over 2,300contributorsv Secret and configurationmanagementv Graduated from CNCF

Who is using Kubernetes?

Azure Kubernetes Service(AKS)

Your Kubernetes ClusterManaged by Azure

Why AKS?Easy to use:Easy to manage:v Fastest path to Kubernetes onAzurev Automated upgradesand patchingv I argue there are 2.5 commandsv Self-healing controlplanev Up and running with 3 simplecommandsv Easily scale thecluster up and downUses open APIs – 100% upstream Kubernetes

Getting Started with AKS az aks create -g myResourceGroup -n myCluster --generate-ssh-keys\ Running . az aks install-cliDownloading client to /usr/local/bin/kubectl . az aks get-credentials -g myResourceGroup -n myClusterMerged "myCluster" as current context . kubectl get dyAGE4m4m4mVERSIONv1.8.1v1.8.1v1.8.1

Managing an AKS Cluster az aks list –o -- urceGroup1.7.7-----------Succeeded az aks upgrade -g myResourceGroup -n myCluster –-kubernetes-version 1.8.1\ Running . kubectl get dyAGE12m8m3mVERSIONv1.8.1v1.8.1v1.8.1 az aks scale -g myResourceGroup -n myCluster --agent-count 10\ Running .

Kubernetes without AKSMaster VMMaster VMMaster VMControl PlaneAgent VMAgent VMAgent VMAgent VMAgent VMAgent VMAgent VMAgent VMAgent Pool

Kubernetes with AKSAgent VMAgent VMAgent VMAgent VMAgent VMAgent VMAgent VMAgent VMHosted ControlPlaneAgent Pool

Azure ContainerService (AKS)Release automation toolsSimplifying the Kubernetes experienceAzure ContainerInstances (ACI)Azure ContainerRegistryOpen ServiceBroker API (OSBA)ReleaseAutomation ToolsStreamlinedKubernetesdevelopmentThe packagemanager forKubernetesEvent-drivenscripting forKubernetesVisualizationdashboard forBrigade

HelmAzure ContainerService (AKS)The best way to find, share, and use softwarebuilt for KubernetesAzure ContainerInstances (ACI)Azure ContainerRegistryOpen ServiceBroker API (OSBA)ReleaseAutomation ToolsManage complexityEasy updatesSimple sharingRollbacksCharts can describecomplex apps; providerepeatable app installs, andserve as a single point ofauthorityTake the pain outof updates with inplace upgrades andcustom hooksCharts are easy toversion, share, and hoston public or privateserversUse helm rollbackto roll back to an olderversion of a releasewith ease

Azure ContainerService (AKS)HelmHelm Charts helps you define, install, and upgradeeven the most complex Kubernetes applicationservices cidbload balancercustomAzure ContainerInstances (ACI) Azure ContainerRegistryOpen ServiceBroker API (OSBA)ReleaseAutomation ToolsChart.yml

Azure ContainerService (AKS)Simple app development and deployment – intoany Kubernetes clusterAzure ContainerInstances (ACI)Azure ContainerRegistryOpen ServiceBroker API (OSBA)ReleaseAutomation ToolsSimplified developmentLanguage supportUsing two simple commands, developerscan now begin hacking on container-basedapplications without requiring Docker oreven installing Kubernetes themselvesDraft detects which language your app iswritten in, and then uses packs togenerate a Dockerfile and Helm Chartwith the best practices for that language

Demo

5 Kubernetes Best PracticesBuild small containersv Application architecturev Use Namespacesv Use helm chartsv RBACv Implement Health checksv Set requests and limitsv Be mindful of your servicesv Map external servicesv Don’t rely on load balancersv

THANKS!Resourcesaka.ms/devops/jaxlondon2018Any questions?You can find me at:@jldeen · jessica.deen@microsoft.com

DevOps Benefits IT Performance Metrics 2015 2016 2017 Deployment Frequency 30x more frequent 200x more frequent 46x more frequent Lead Time for Changes 200x faster 2,555x faster 440x faster Mean Time to Recover (MTTR) 168x faster 24x faster 96x faster Change Failure Rate 3x lower (