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

Kubernetes für .NET Anwendungsentwickler

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.

6848c06ef647ab606c668cc5264c0fc9?s=128

Thorsten Hans

February 17, 2021
Tweet

Transcript

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

  2. Consultant @ Thinktecture #Azure #Kubernetes #CloudNative #Terraform thorsten.hans@thinktecture.com thinktecture.com thorsten-hans.com

    @ThorstenHans Thorsten Hans
  3. What will you see today - Journey to Cloud-Native -

    Containerize .NET Applications - Patterns and Practices for .NET devs Preview
  4. 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
  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. 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
  7. 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
  8. 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
  9. Kubernetes Master Kubernetes Node Pool 1 Kubernetes Worker Node Kubernetes

    Worker Node Birds-View Kubernetes Architecture
  10. 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
  11. 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
  12. 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
  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. 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
  15. 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
  16. Azure Kubernetes Service - Provision an AKS cluster - Connect

    the cluster to ACR Demo
  17. 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
  18. • 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
  19. BUILD FOR LINUX Containerization of .NET workloads

  20. • 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
  21. • 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
  22. https://12factor.net/ • Adopt the twelve-factor app manifest • Focus on

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

    cloud-native - Containerize .NET applications Demo
  24. 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
  25. • 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
  26. Running .NET Applications in Kubernetes - Work with the Kubernetes

    Cluster - Create Application Configuration - Create Deployment for the Application - Expose Application Demo
  27. Available on GitHub thns.io/basta-spring-2021 https://github.com/thinktecture/basta-spring-2021-kubernetes-for-net-devs Repsitory

  28. Q&A If you have further questions: shoot me a mail

    at thorsten.hans@thinktecture.com / thorsten.hans@gmail.com or tweet at @ThorstenHans