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

Leinen los: .NET Core Deployment mit Kubernetes...

Leinen los: .NET Core Deployment mit Kubernetes in Azure #netdc18

Deploying .NET Core Services in Azure AKS at https://dotnet-developer-conference.de 2018

Alexander Zeitler

November 28, 2018
Tweet

More Decks by Alexander Zeitler

Other Decks in Programming

Transcript

  1. Leinen los: .NET Core Deployment mit Kubernetes in Azure Alexander

    Zeitler .NET Developer Conference, 28.11.2018
  2. Alexander Zeitler CEO / Cloud Solution Architect at PDMLab •

    Microsoft MVP / ASP.NET 2004 - 2018 • ASP.NET Web API Advisor since 2011 • Microsoft Azure Advisor since 2014 • Organizer of Azure Meetup Karlsruhe • Using Docker since 2013 https://pdmlab.com [email protected] @lxztlr Leinen los: .NET Core Deployment mit Kubernetes in Azure 2
  3. Agenda • Azure AKS mit Azure DevOps • Kubernetes •

    Azure AKS • Building Cloud Native .NET Core Services 3 Leinen los: .NET Core Deployment mit Kubernetes in Azure
  4. Agenda • Azure AKS mit Azure DevOps • Kubernetes •

    Azure AKS • Building Cloud Native .NET Core Services 4 Leinen los: .NET Core Deployment mit Kubernetes in Azure
  5. Agenda • Azure AKS mit Azure DevOps • Kubernetes •

    Azure AKS • Building Cloud Native .NET Core Services 6 Leinen los: .NET Core Deployment mit Kubernetes in Azure
  6. Kubernetes Greek for "Helmsman" The person who steers a ship

    7 Leinen los: .NET Core Deployment mit Kubernetes in Azure
  7. k8s Architecture HTTPS Db Messaging Log Auth KV LB Orders

    10 Leinen los: .NET Core Deployment mit Kubernetes in Azure
  8. k8s Architecture HTTPS Db Messaging Log Auth KV LB Orders

    11 Leinen los: .NET Core Deployment mit Kubernetes in Azure
  9. k8s Architecture HTTPS Db Messaging Log Auth KV LB Orders

    Node 2 Node 3 12 Node 1 Leinen los: .NET Core Deployment mit Kubernetes in Azure
  10. k8s Architecture { /* App */ } Master Node Node

    Node Node Node Pods Pods Pods 13 Leinen los: .NET Core Deployment mit Kubernetes in Azure
  11. k8s Architecture Master Node Node Node Linux Linux Linux Linux

    ENV ENV ENV ENV 14 Leinen los: .NET Core Deployment mit Kubernetes in Azure
  12. k8s Masters Master Linux ENV apiserver CM KV kube-apiserver Front

    end to control plane REST-API JSON (manifest files) KV-Store persistent state config of the cluster Uses etcd Controller Manager Node Controller Endpoints Controller Namespace Controller kube-scheduler watches apiserver Assigns work to nodes 16 Leinen los: .NET Core Deployment mit Kubernetes in Azure
  13. k8s Masters Master apiserver KV Node Node Node kubectl Commands

    (JSON) CM 17 Leinen los: .NET Core Deployment mit Kubernetes in Azure
  14. k8s Nodes Node Linux ENV K Kubelet kubernetes agent registers

    node with cluster watches apiserver instantiates pods reports to master endpoint at port :10225 /spec /healthz /pods CR P Container Runtime pull images start / stop containers Docker or rkt kube-proxy Networking Assign IP to Pod All containers in a Pod share IP LB across Pods in services 19 Leinen los: .NET Core Deployment mit Kubernetes in Azure
  15. k8s Pods Pod Environment Namespaces Network stack ... n Containers

    trnsprt link net IPC mount 21 Leinen los: .NET Core Deployment mit Kubernetes in Azure
  16. Pods are atomic containers not up == pod n/a 22

    Leinen los: .NET Core Deployment mit Kubernetes in Azure
  17. Pod lifecycle born - alive - dead 23 Leinen los:

    .NET Core Deployment mit Kubernetes in Azure
  18. Unit of scale Swarm Pod 25 Leinen los: .NET Core

    Deployment mit Kubernetes in Azure
  19. Desired State Master apiserver KV Node kubectl Manifest file (YAML)

    CM 3 x nginx Pod nginx Node Pod nginx Node Pod nginx Desired State: OK 27 Leinen los: .NET Core Deployment mit Kubernetes in Azure
  20. Desired State Master apiserver KV Node kubectl Manifest file (YAML)

    CM 3 x nginx Pod nginx Node Pod nginx Node Pod nginx Desired State: FAILED 28 Leinen los: .NET Core Deployment mit Kubernetes in Azure
  21. Desired State Master apiserver KV Node kubectl Manifest file (YAML)

    CM 3 x nginx Pod nginx Node Pod nginx Desired State: OK Pod nginx 29 Leinen los: .NET Core Deployment mit Kubernetes in Azure
  22. k8s Services Pod 10.244.2.4 Pod 10.244.2.5 Pod 10.244.2.6 Pod 10.244.2.7

    Pod 10.244.2.8 Service 10.244.2.10 DNS: upstream.myapp 31 Leinen los: .NET Core Deployment mit Kubernetes in Azure
  23. k8s Labels Pod 10.244.2.4 Pod 10.244.2.5 Pod 10.244.2.6 Pod 10.244.2.7

    Pod 10.244.2.8 Service 10.244.2.10 DNS: upstream.myapp p p p p p db db lb p 33 Leinen los: .NET Core Deployment mit Kubernetes in Azure
  24. k8s Deployments • Manifest files (YAML) • Rolling updates +

    rollbacks • Multiple concurrent versions • blue-green-deployment • Canary releases 35 Leinen los: .NET Core Deployment mit Kubernetes in Azure
  25. Agenda • Azure AKS mit Azure DevOps • Kubernetes •

    Azure AKS • Building Cloud Native .NET Core Services 36 Leinen los: .NET Core Deployment mit Kubernetes in Azure
  26. Agenda • Azure AKS mit Azure DevOps • Kubernetes •

    Azure AKS • Building Cloud Native .NET Core Services 40 Leinen los: .NET Core Deployment mit Kubernetes in Azure
  27. Building Cloud Native .NET Core Services • Resilience and Reliability

    • Retry-Pattern • Circuit-Breaker • Graceful Shutdown • Monitoring + Logging + Tracing + Healthchecks instead of production debugging • Use correlation • Azure ApplicationInsights • ELK/EFK • Jaeger Tracing • Prometheus • Chaos Engineering: Break things on purpose! • Gremlin 41 Leinen los: .NET Core Deployment mit Kubernetes in Azure
  28. Resources Links • Samples/Instructions: https://github.com/PDMLab/aks-netcore-netdc18 • Slides: https://speakerdeck.com/alexzeitler Images •

    .NET Bot: https://github.com/dotnet/swag/tree/master/dotnet-bot • Pirate Black Icons Vectors: https://www.vecteezy.com/vector-art/87240-pirate-black-icons-vectors 44 Leinen los: .NET Core Deployment mit Kubernetes in Azure