Slide 1

Slide 1 text

Kubernetes für .NET-Entwickler Thorsten Hans @ThorstenHans Consultant

Slide 2

Slide 2 text

Consultant @ Thinktecture #Azure #Kubernetes #CloudNative #Terraform [email protected] thinktecture.com thorsten-hans.com @ThorstenHans Thorsten Hans

Slide 3

Slide 3 text

What will you see today - Journey to Cloud-Native - Containerize .NET Applications - Patterns and Practices for .NET devs Preview

Slide 4

Slide 4 text

What we will cover today • Introduction • What is Kubernetes and why should you care? • Azure Kubernetes Service (AKS) - Fully managed Kubernetes clusters for everyone • Containerization of .NET workloads • Moving .NET workloads to Kubernetes Talking Points

Slide 5

Slide 5 text

What we will cover today • Introduction • What is Kubernetes and why should you care? • Azure Kubernetes Service (AKS) - Fully managed Kubernetes clusters for everyone • Containerization of .NET workloads • Moving .NET workloads to Kubernetes Talking Points

Slide 6

Slide 6 text

A journey towards cloud-native Cloud-Native application maturity Cloud Ready •No dependency on filesystem •Executed on virtualized hardware •Executed as self-contained images Cloud Friendly •A set of loosely coupled components •Service discovery •Embraces the 12-factor app principles Cloud Resilient •Resilient design & fault tolerance •Metrics and monitoring is built-in •Runs anywhere - aka. infrastructure agnostic Cloud Native •scales dynamically based on different metrics •dynamic infrastructure mutation without service downtime

Slide 7

Slide 7 text

What we will cover today • Introduction • What is Kubernetes and why should you care? • Azure Kubernetes Service (AKS) - Fully managed Kubernetes clusters for everyone • Containerization of .NET workloads • Moving .NET workloads to Kubernetes Talking Points

Slide 8

Slide 8 text

What is it and why should you care? § Container Orchestrator initially founded at Google § now maintained by Cloud Native Computing Foundation (CNCF) § Cloud-Agnostic application platform § Abstracts away all hardware-stuff from developers and DevOps ppl. § Elasticity § Your application components can scale § Your cluster can scale § Container Lifecycle Management Kubernetes

Slide 9

Slide 9 text

Kubernetes Master Kubernetes Node Pool 1 Kubernetes Worker Node Kubernetes Worker Node Birds-View Kubernetes Architecture

Slide 10

Slide 10 text

Kubernetes Master Kubernetes Node Pool 1 Kubernetes Worker Node Kubernetes Worker Node Birds-View Kubernetes Architecture Kubernetes Node Pool 2 Kubernetes Worker Node Kubernetes Worker Node

Slide 11

Slide 11 text

Kubernetes Master Kubernetes Node Pool 1 Kubernetes Worker Node Kubernetes Worker Node Birds-View Kubernetes Architecture Kubernetes Node Pool 2 Kubernetes Worker Node Kubernetes Worker Node

Slide 12

Slide 12 text

Kubernetes Master Kubernetes Node Pool 1 Kubernetes Worker Node Kubernetes Worker Node Birds-View Kubernetes Architecture Kubernetes Node Pool 2 Kubernetes Worker Node Kubernetes Worker Node Azure Container Instances

Slide 13

Slide 13 text

What we will cover today • Introduction • What is Kubernetes and why should you care? • Azure Kubernetes Service (AKS) - Fully managed Kubernetes clusters for everyone • Containerization of .NET workloads • Moving .NET workloads to Kubernetes Talking Points

Slide 14

Slide 14 text

AKS § Fully managed Kubernetes cluster § Easy cluster administration § Cluster scaling / Upgrading Kubernetes versions / IAM § Azure Portal, Azure CLI, Azure PoSh Modules § Govern and harden your Kubernetes in one place § Seamless integration with Azure services § Cost efficient – you pay just for your Worker-Nodes § Since April 2020, you can pay a fee to get SLA Azure Kubernetes Service

Slide 15

Slide 15 text

Seamless Azure Integration § Kubernetes Load-Balancer will spin up an Azure Load-Balancer § Mount Azure Files Shares and Disks as Volumes § Consume Docker Images from Azure Container Registry § Use other Azure PaaS offerings like Azure Redis, Azure SQL, Azure Cosmos DB § Get Container Insights using Azure Monitor § Protect applications using Azure Security Center and Azure Policies AKS and Azure Integration

Slide 16

Slide 16 text

Azure Kubernetes Service - Provision an AKS cluster - Connect the cluster to ACR Demo

Slide 17

Slide 17 text

What we will cover today • Introduction • What is Kubernetes and why should you care? • Azure Kubernetes Service (AKS) - Fully managed Kubernetes clusters for everyone • Containerization of .NET workloads • Moving .NET workloads to Kubernetes Talking Points

Slide 18

Slide 18 text

• Not all .NET superpowers are required to build cloud-native apps • Embrace Orchestrator responsibilities • Volume mounting • Configuration data • Network communication • Log processing • Integrate with the orchestrator • Support probes (aka health checks) • Specify resource utilization Containerization of .NET workloads

Slide 19

Slide 19 text

BUILD FOR LINUX Containerization of .NET workloads

Slide 20

Slide 20 text

• AppConfiguration • Environment variable Provider (AddEnvironmentVariables) • Key-Per-File Provider (AddKeyPerFile) • Logging • Log to STDOUT and STDERR (AddConsole) • Application Logs can still go to engines like Azure Monitor • Integrate with metrics engines like Prometheus using Prometheus.AspNetCore Containerization of .NET workloads

Slide 21

Slide 21 text

• Health Checks • Provide dedicated endpoints for Readiness and Liveness probes (AddHealthChecks) • Resource Utilization • Identify CPU and Memory requirements • Define limits – which resource utilization is not ”normal” or considered as “unhealthy” • Network Configuration • HTTPS is NOT in the responsibility of your application • Remove things like UseHttpsRedirection Containerization of .NET workloads

Slide 22

Slide 22 text

https://12factor.net/ • Adopt the twelve-factor app manifest • Focus on • Configuration • Process • Port binding • Logging • Concurrency The 12 Factor Manifest

Slide 23

Slide 23 text

Running .NET Applications in Kubernetes - Optimize .NET applications for cloud-native - Containerize .NET applications Demo

Slide 24

Slide 24 text

What we will cover today • Introduction • What is Kubernetes and why should you care? • Azure Kubernetes Service (AKS) - Fully managed Kubernetes clusters for everyone • Containerization of .NET workloads • Moving .NET workloads to Kubernetes Talking Points

Slide 25

Slide 25 text

• Deployment as Code • Plain old YAML manifests • YAML manifests with Kustomize • Package Managers like Helm 3 (https://helm.sh) • GitOps with Flux2 or Argo CD Moving .NET workloads to Kubernetes

Slide 26

Slide 26 text

Running .NET Applications in Kubernetes - Work with the Kubernetes Cluster - Create Application Configuration - Create Deployment for the Application - Expose Application Demo

Slide 27

Slide 27 text

Available on GitHub thns.io/basta-spring-2021 https://github.com/thinktecture/basta-spring-2021-kubernetes-for-net-devs Repsitory

Slide 28

Slide 28 text

Q&A If you have further questions: shoot me a mail at [email protected] / [email protected] or tweet at @ThorstenHans