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

Kubernetes für .NET Anwendungsentwickler

Thorsten Hans
February 17, 2021

Kubernetes für .NET Anwendungsentwickler

Sie möchten Ihre .NET-Core-Anwendung in Kubernetes betreiben und lernen, wie Sie das Potential des Containerorchestrators nutzen können? Dann besuchen Sie diesen Talk von Kubernetes- und Cloud-Native-Experte Thorsten Hans. Sie werden nicht nur den praktischen Umgang mit Kubernetes aus Sicht des Entwicklers lernen, sondern auch, wie Sie Patterns und Praktiken nutzen, um Ihre .NET-Core-Anwendungen optimal in Containern zu betreiben.

Thorsten Hans

February 17, 2021
Tweet

More Decks by Thorsten Hans

Other Decks in Technology

Transcript

  1. What will you see today - Journey to Cloud-Native -

    Containerize .NET Applications - Patterns and Practices for .NET devs Preview
  2. 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
  3. 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
  4. 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
  5. 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
  6. 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
  7. 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
  8. 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
  9. 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
  10. 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
  11. 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
  12. 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
  13. 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
  14. • 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
  15. • 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
  16. • 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
  17. https://12factor.net/ • Adopt the twelve-factor app manifest • Focus on

    • Configuration • Process • Port binding • Logging • Concurrency The 12 Factor Manifest
  18. Running .NET Applications in Kubernetes - Optimize .NET applications for

    cloud-native - Containerize .NET applications Demo
  19. 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
  20. • 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
  21. Running .NET Applications in Kubernetes - Work with the Kubernetes

    Cluster - Create Application Configuration - Create Deployment for the Application - Expose Application Demo