Share
Embed
Azure Container Services - Operate containerized applications professionally
My slides from the AKS / Kubernetes session at Global Azure Bootcamp in Saarbruecken. #GlobalAzureBootcamp
Thorsten Hans
April 21, 2018
Transcript
37 slides
-
What you’ll see • Docker • Azure Container Registry (ACR)
• Kubernetes • Azure Container Services (AKS) What you won’t see • Introduction for frameworks like • Angular • .NET Core -
• Docker • Azure Container Registry • Kubernetes • Azure
Container Services • Recap Talking Points -
ACR § Private Docker registry based on Docker Registry 2.0
§ Fully managed Azure Service § Seamless integration with Docker CLI § Available in three SKUs (Basic, Standard Premium) § Provides webhooks for further automation like Continuous Deployment (CD) Azure Container Registry -
Get access to your Azure Container Registry § Azure AD-based
login mechanism for regular usage § Tokens requested by Azure CLI will be used to authenticate with ACR § Headless Authentication using Azure AD Service Principals § Used by Orchestrators or other Services § Admin Account § Designed for Single User scenarios § Should be disabled on all (pre)-production ACRs Authentication -
Assign permissions in the context of ACR § RBAC can
be applied to § Azure AD users § Service Principals § Available roles § Reader (pull images) § Contributor (pull and push images) § Owner (pull and push images / assign roles to other users) Authorization -
Feature Comparison Basic Standard Premium Storage 10 GB 100 GB
500 GB Max read Ops. per Minute 1.000 300.000 10.000.000 Max write Ops. per Minute 100 500 2.000 Max download bandwidth 30 MBps 60 MBps 100 MBps Max upload bandwidth 10 MBps 20 MBps 50 MBps Webhooks 2 10 100 Geo Replication Not supported Not supported In Preview ACR SKUs -
Using Azure CLI # Create a new ResourceGroup az group
create --name tt-demo --location westeurope # Create a new ACR inside of the tt-demo Resource Group az acr create --resource-group tt-demo --name ttdemo --sku Standard Create a new Azure Container Registry -
Using Azure CLI # Login to ttdemo ACR az acr
login --name ttdemo ACR Authentication -
Using Docker CLI # pull nginx from public docker hub
docker pull nginx:alpine # re-tag the image to have prefix matching our ACR instance docker tag nginx:alpine ttdemo.azurecr.io/demo/nginx:alpine # push the image docker push ttdemo.azurecr.io/demo/nginx:alpine Pushing an image to ACR -
How much is ACR? ACR pricing § Azure Container Registry
§ Prices are shown for Azure region West Europe § Bandwidth § Regular Azure Bandwidth costs has to be added on top § https://thns.io/2FQkVDs Basic Standard Premium Price per Day 0,141 € 0,562 € 1,406 € Price per extra GB Storage and Day 0,003 € 0,003 € 0,003 € -
Open-Source Container Orchestrator § Initially founded by Google / now
maintained by CNCF (Cloud Native Computing Foundation) § Successor of Google’s Borg § Original Codename Seven (https://en.wikipedia.org/wiki/Seven_of_Nine) § Greek for pilot or helmsman of a ship § Written in go Kubernetes -
What is k8s § Container platform § Runs Docker containers
§ Takes care about Networking / Isolation of applications § Abstracting hardware from the developer § Cloud-Agnostic § Container Lifecycle Management § Deployment, Rolling Upgrades, Scaling, Load-Balancing Kubernetes -
The concept of desired state In Kubernetes you describe your
deployment by using code. You define a desired state like “I want 5 instances of this Docker image”. Kubernetes ensures that actual state is always matching your desired state. So there will always be 5 instances of the requested Docker image. If the cluster is facing hardware issues, k8s spins up new instances of the Docker image on a different node till the actual state is again matching the desired state. Kubernetes -
Deployment as Code § All Kubernetes building blocks are created
using code § YAML or JSON can be used § YAML is almost industry standard for Kubernetes § Deployment Code goes to Source Control § Continuous Deployment triggered by Source Control hooks § git push webhook Kubernetes -
AKS § Fully managed Kubernetes cluster § Frictionless operation of
containerized apps § Easy to scale-out, upgrade, replicate § Seamless integration with other Azure resources § Self healing for k8s Masters § Cost efficient – you pay for your Nodes Azure Container Services -
AKS § Currently in technical preview (April 2018) § Preview
is only available in the following Regions § East US, West Europe, Central US, Canada Central, Canada East § Service quotas and limits* § Max 100 nodes per cluster § Max 110 pods per node § Max 20 clusters per subscription * Due to preview, can be increased by creating an Azure Service Request Azure Container Services -
Azure AKS § K8s Load Balancer will spin up an
Azure Load Balancer § Easily mount Azure Files Shares and Disks as Volumes § Consume Docker Images from Azure Container Registry § Communicate with other Azure Resources like Redis, SQL Azure § Traffic inside the same region is always free AKS Azure Integration -
Using Azure CLI # Create a resource group az group
create --name thh-demo --location westeurope --tags @{resp="THH"} # Create a Service Principal az ad sp create-for-rbac --name thh-demo-aks-sp --skip-assignment # Will print something like { "appId": "7248f250-0000-0000-0000-dbdeb8400d85", # --> identifier ($SP-ID) "displayName": "thh-demo-aks-sp", "name": "http://thh-demo-aks-sp", "password": "77851d2c-0000-0000-0000-cb3ebc97975a", # --> client secret ($SP_PWD) "tenant": "72f988bf-0000-0000-0000-2d7cd011db47“ } Prepare a new AKS Cluster -
Using Azure CLI # Create a AKS Cluster az aks
create --name thh-demo-aks --resource-group thh-demo --location westeurope --service-principal $SP-ID --client-secret $SP_PWD --node-count 3 --node-vm-size Standard_DS1_v2 --tags @{resp="THH"} Create a new AKS Cluster -
Using Azure CLI # Scale-Out an AKS Cluster (increase Node
count to 5) az aks scale --name thh-demo-aks --resource-group thh-demo --node-count 5 Scale-Out an AKS Cluster -
Using Azure CLI # Scale-In an AKS Cluster (reduce Node
count to 1) az aks scale --name thh-demo-aks --resource-group thh-demo --node-count 1 Scale-In an AKS Cluster -
Using Azure CLI # Get current k8s version az aks
get-upgrades --name thh-demo-aks --resource-group thh-demo --output table # Name ResourceGroup MasterVersion NodePoolVersion Upgrades # ------- --------------- --------------- ----------------- -------------- # thh... thh-demo 1.9.1 1.9.1, 1.9.2, 1.9.6 Get AKS Cluster Upgrades -
Using Azure CLI # Start k8s upgrade az aks upgrade
--name thh-demo-aks --resource-group thh-demo --kubernetes-version 1.9.6 Upgrade an AKS Cluster