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

Kubernetes, Azure & Dotnet - What's it all about?

Kubernetes, Azure & Dotnet - What's it all about?

Introduction to Kubernetes
Covers origin and capabilities of Kubernetes and should be a good introduction to the basics for anyone even non .NET devs.

Video of shorter version of talk: http://bit.ly/k8s-ndc

Shahid Iqbal

March 29, 2019
Tweet

More Decks by Shahid Iqbal

Other Decks in Technology

Transcript

  1. @shahiddev Very brief intro Freelance hands-on consultant working on .NET,

    Azure & Kubernetes Developer/Architect in .NET for +10yrs based in the UK Microsoft MVP Co-organiser of the MK.net meetup in the UK @shahiddev on Twitter https://www.linkedin.com/in/shahiddev/ https://sessionize.com/shahid-iqbal https://blog.headforcloud.com
  2. @shahiddev Agenda Kubernetes overview Creating clusters and deploying apps Demos

    Managed Kubernetes providers Demos Hybrid clusters Planning for Kubernetes
  3. @shahiddev Key takeaways A good understanding of the Kubernetes architecture

    and key concepts Confidence to create clusters and deploy applications Launching pad to go away and learn more Caveat: Not a Docker tutorial – won’t go into details of creating containers
  4. @shahiddev Kubernetes features Container orchestration Horizontal scaling Rolling deployments and

    rollbacks Self healing Service discovery and load balancing Batch execution (jobs) …
  5. @shahiddev Kubernetes components Networking – CNI/CNM ReplicaSets Ingress (L7 LB)

    Monitoring Readiness/health-checking Config maps Storage (PV/PVC) Daemonsets Statefulsets Namespaces RBAC Helm Pod Autoscaling Secrets
  6. @shahiddev Control plane Node(s) Worker Node Worker Node Worker Node

    API High-level architecture Management/Control plane UI/CLI Windows nodes GA! (K8s 1.14)
  7. @shahiddev Anatomy of a control plane node etcd API Server

    Scheduler Controller manager Cloud Controller manager Kubectl UI
  8. @shahiddev Pods Localhost Node Pod Pod • Containers within a

    pod that share resources • Can communicate over localhost • Are deployed/scaled as a unit
  9. @shahiddev Kubernetes Manifest files YAML or JSON files Defines application

    structure/resources Desired state Containers = application Manifest = “infrastructure/configuration as code” Should be in source control
  10. @shahiddev Kubernetes Configuration files “kubectl run - -image=<img> - -port=<port>

    - -dry-run –o yaml > myfile.yaml” http://bit.ly/k8s-yaml
  11. @shahiddev Accessing applications Node 1 Node 2 Node 3 Service

    (172.176.24.76) app:hw 10.0.1.5 app:hw 10.0.1.8 app:hw 10.0.1.12 app:app2 10.0.1.6 Client cluster app:app2 10.0.1.7
  12. @shahiddev Accessing applications Node 1 Node 2 Service (172.176.24.76) app:hw

    10.0.1.5 app:hw 10.0.1.8 app:hw 10.0.1.14 app:app2 10.0.1.6 Client cluster app:app2 10.0.1.7
  13. @shahiddev Accessing applications Node 1 Node 2 Node 3 Service

    (172.176.24.76) (where label=app:hw) app:hw 10.0.1.5 app:hw 10.0.1.8 app:hw 10.0.1.12 app:app2 10.0.1.6 app:app2 10.0.1.7
  14. @shahiddev Service types LoadBalancer Expose service publicly (relies on hosting

    infrastructure) ClusterIP Assign it an internal cluster IP only – not public NodePort Port on each node which can route to service ExternalName Maps to a CNAME record (i.e. external service)
  15. @shahiddev Ingress Allows for routing using a single entry point

    into the cluster Routing to different applications based on rules Single SSL termination point (depending on SSL cert type) May be preferable vs multiple LoadBalancer services Implemented by variety of providers – ngnix, haproxy etc More advanced control -> Service Mesh
  16. @shahiddev Host name based routing using Ingress Node 1 Node

    2 Node 3 app1 svc app:app1 app:app1 app:app2 cluster app:app2 Load Balancer app2 svc Ingress controller Public IP app1.mydomain.com Host: app1.mydomain.com
  17. @shahiddev Host name based routing using Ingress Node 1 Node

    2 Node 3 app1 svc app:app1 app:app1 app:app2 cluster app:app2 Load Balancer app2 svc Ingress controller Public IP app2.mydomain.com Host: app2.mydomain.com
  18. @shahiddev Helm De facto application package manager for Kubernetes “Apt-get/chocolatey

    of Kubernetes” Parameterise settings and re-use settings Packages == Charts Kubeapps Hub – repository of public charts for common apps/services Package your applications as Helm charts
  19. @shahiddev Rolling updates Zero downtime rolling updates Blue/Green updates Rollback

    *Rolling updates with complex data/schema changes still challenging.
  20. @shahiddev Speed of rollout vs service capacity Max unavailable number

    of old pods taken offline during update Max surge number of new pods created alongside existing pods during update *(number or %)
  21. @shahiddev Managed Kubernetes Providers Azure Kubernetes Service • Control plane

    is handled by provider • Removes significant overhead of running K8s cluster • Free control plane node(s) – except EKS Google Kubernetes Engine
  22. @shahiddev Azure Kubernetes Service - AKS Management nodes not visible

    (and not charged) Lose flexibility to run feature flags/startup params Supports multiple K8s versions with option to upgrade clusters Integration into existing Vnets RBAC using Azure AD* Cluster autoscaling* Nodes are auto-patched (but not restarted) Windows node pools (private preview) *preview features
  23. @shahiddev Azure Kubernetes Service - AKS //create resource group az

    group create -n hfck8sRG -l westeurope //create cluster az aks create -n hfck8s -g hfck8sRG / -k 1.12.6 //k8s version / -c 3 //node count
  24. @shahiddev Microsoft support for Kubernetes Contribute to K8s project Acquisition

    of Deis Brendan Burns - K8s co-founder works there More tooling for .NET developers coming Helm, Draft, Brigade, Azure Dev Spaces
  25. @shahiddev Single platform for all .NET apps Hybrid clusters (linux

    + windows worker nodes) “Legacy” full .NET framework apps & .NET core apps on single platform Single CI/CD approach Simplify evolving architecture to microservices by removing complexity around “plumbing”
  26. @shahiddev Unified platform for evolving architecture Node 1 Node 2

    Node 3 myapp svc app:myapp app:myapp app:orders cluster Load Balancer orders svc Ingress controller Public IP myapp.com path: myapp.com Node 4 app:orders
  27. @shahiddev Unified platform for evolving architecture Node 1 Node 2

    Node 3 myapp svc app:myapp app:myapp app:orders cluster Load Balancer orders svc Ingress controller Public IP myapp.com/orders path: myapp.com/orders Node 4 app:orders
  28. @shahiddev Hybrid clusters Windows nodes in private preview on AKS

    Expect public preview soon AKS-Engine on Azure can create hybrid clusters (not managed)
  29. @shahiddev Planning for Kubernetes Don’t get sucked into the K8s

    hype Focus on basics Develop 12-factor style apps (logging/readiness/health-checks) Clear plan for architecture/microservices Writing/migrating to .NET core CI/CD pipelines Containerise “legacy” .NET applications into Windows Containers Don’t forget container and cluster security Consider GitOps – beware of “pet” clusters
  30. @shahiddev Summary Kubernetes is mature and feature rich container orchestration

    platform Many large organisations are betting on it as their platform of the future Windows support is gaining traction Microsoft is heavily invested in it Tooling/support for .NET developers will make the adoption even easier
  31. @shahiddev Where can I go to learn more? http://www.katacoda.com https://kubernetes.io/docs/home

    Kubernetes up & running By Kelsey Hightower, Brendan Burns, Jo Beda
  32. Shahid Iqbal | Freelance consultant @shahiddev Thank You! Slides: http://bit.ly/k8s-azure-dotnet

    @shahiddev on Twitter https://www.linkedin.com/in/shahiddev/ https://blog.headforcloud.com