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

Azure ACS and Kubernetes

Azure ACS and Kubernetes

Talk about Microservices, Docker and Kubernetes in Microsoft Azure. at .NET Usergroup Karlsruhe.
https://www.meetup.com/NET-User-Group-Karlsruhe/events/244451653/

Alexander Zeitler

November 16, 2017
Tweet

More Decks by Alexander Zeitler

Other Decks in Programming

Transcript

  1. Alexander Zeitler CEO / Cloud Solution Architect at PDMLab •

    Microsoft MVP / ASP.NET since 2004 • 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] @alexzeitler_ Azure ACS and Kubernetes: Microservices On Steroids 2
  2. Agenda • Microservices • Challenges • Docker • Azure ACS

    / Kubernetes • Azure AKS Azure ACS and Kubernetes: Microservices On Steroids 3
  3. Microservices is a variant of the service-oriented architecture (SOA) architectural

    style that structures an application as a collection of loosely coupled services. In a microservices architecture, services should be fine-grained and the protocols should be lightweight. The benefit of decomposing an application into different smaller services is that it improves modularity and makes the application easier to understand, develop and test. The benefit of decomposing an application into different smaller services is that it improves modularity and makes the application easier to understand, develop and test. It also parallelizes development by enabling small autonomous teams to develop, deploy and scale their respective services independently Microservices-based architectures enable continuous delivery and deployment. Azure ACS and Kubernetes: Microservices On Steroids Microservices 5
  4. • Web Front-End • Product Data Management (PDM) • Warehouse

    • Purchasing • Logistics • Payment • Billing • Identity Azure ACS and Kubernetes: Microservices On Steroids Example: E-Commerce 6
  5. • Focus on a single Domain • Two Pizza Rule

    • Autonomous • Small • Shared Nothing (Exclusive State) • Async Azure ACS and Kubernetes: Microservices On Steroids Principles 7
  6. • Cross Platform • Easier Replacement / Refactoring • Decoupled

    Deployment • Code Ownership Azure ACS and Kubernetes: Microservices On Steroids Advantages 8
  7. • Significant Operations Overhead • Substantial DevOps Skills Required •

    Implicit Interfaces • Duplication Of Effort • Distributed System Complexity • Asynchronicity Is Difficult! • Testability Challenges Azure ACS and Kubernetes: Microservices On Steroids Complexity 10
  8. • Fast • Reliable • Repeatable Azure ACS and Kubernetes:

    Microservices On Steroids Deployment 12
  9. Build Azure ACS and Kubernetes: Microservices On Steroids FROM ubuntu:16.04

    MAINTAINER Alexander Zeitler <[email protected]> RUN apt-get update RUN apt-get install -y nginx RUN echo 'Hi, I am your father...erm in your container' \>/usr/share/nginx/html/index.html CMD [ "nginx", "-g", "daemon off;" ] EXPOSE 80 26
  10. Ship Azure ACS and Kubernetes: Microservices On Steroids Image name

    <username>/<reponame> e.g. alexzeitler/nginx docker push docker pull https://hub.docker.com/ 27
  11. Run Azure ACS and Kubernetes: Microservices On Steroids docker run

    alexzeitler/nginx docker run ubuntu echo hello world 28
  12. Azure ACS and Kubernetes: Microservices On Steroids k8s Architecture HTTPS

    Db Messaging Log Auth KV LB Orders Node 2 Node 3 38 Node 1
  13. Azure ACS and Kubernetes: Microservices On Steroids k8s Architecture {

    /* App */ } Master Node Node Node Node Node Pods Pods Pods 39
  14. Azure ACS and Kubernetes: Microservices On Steroids k8s Architecture Master

    Node Node Node Linux Linux Linux Linux ENV ENV ENV ENV 40
  15. Azure ACS and Kubernetes: Microservices On Steroids 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 42
  16. Azure ACS and Kubernetes: Microservices On Steroids k8s Masters Master

    apiserver KV Node Node Node kubectl Commands (JSON) CM 43
  17. Azure ACS and Kubernetes: Microservices On Steroids 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 45
  18. Azure ACS and Kubernetes: Microservices On Steroids Desired State Master

    apiserver KV Node kubectl Manifest file (JSON/YAML) CM 3 x nginx Pod nginx Node Pod nginx Node Pod nginx Desired State: OK 47
  19. Azure ACS and Kubernetes: Microservices On Steroids Desired State Master

    apiserver KV Node kubectl Manifest file (JSON/YAML) CM 3 x nginx Pod nginx Node Pod nginx Node Pod nginx Desired State: FAILED 48
  20. Azure ACS and Kubernetes: Microservices On Steroids Desired State Master

    apiserver KV Node kubectl Manifest file (JSON/YAML) CM 3 x nginx Pod nginx Node Pod nginx Desired State: OK Pod nginx 49
  21. Azure ACS and Kubernetes: Microservices On Steroids k8s Pods Pod

    Environment Namespaces Network stack ... n Containers trnsprt link net IPC mount 52
  22. Azure ACS and Kubernetes: Microservices On Steroids k8s Scaling Pods

    Node Pod Node Pod Node Pod Node Pod Pod Pod Do Don’t 54
  23. Azure ACS and Kubernetes: Microservices On Steroids 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: db.myapp 59
  24. Azure ACS and Kubernetes: Microservices On Steroids 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: db.myapp p p p p p db db lb p 61
  25. Azure ACS and Kubernetes: Microservices On Steroids k8s Deployments •

    Manifest files (YAML/JSON) • Rolling updates + rollbacks • Multiple concurrent versions • blue-green-deployment • Canary releases 63
  26. AKS - Managed Kubernetes in Azure Azure ACS and Kubernetes:

    Microservices On Steroids az aks create –n myCluster –g myResourceGroup 66
  27. AKS - Visual Studio Connected Environment Azure ACS and Kubernetes:

    Microservices On Steroids https://www.hanselman.com/blog/AnnouncingVisualStudioAndKubernetesVisualStudioConnectedEnvironment.aspx 67
  28. Resources Links • Commands for ACS/ACR/kubectl: https://github.com/PDMLab/acs-kubernetes-talk • Sample App:

    https://github.com/Azure-Samples/azure-voting-app • Kubernetes: https://kubernetes.io/ • Rolling Updates in k8s: https://kubernetes.io/docs/tutorials/kubernetes-basics/update-intro/ Images • 17/a: https://upload.wikimedia.org/wikipedia/commons/c/c5/Britain_Delivers_the_Goods_in_Wartime-_Dock_Workers_in_Bristol,_England,_1940_D1224.jpg • 17/b: http://i1.wp.com/www.chinasmack.com/wp-content/uploads/2013/09/historical-shanghai-photos-early-20th-century-14.jpg • 19/a: https://homefaraway.files.wordpress.com/2012/04/april-24-2012-026.jpg • 19/b: https://upload.wikimedia.org/wikipedia/commons/4/4d/Locomotive_4700_with_a_container_train_at_Concordancia_de_Poceirao.jpg • 19/c: https://guardian.ng/wp-content/uploads/2016/03/trucks.jpg Azure ACS and Kubernetes: Microservices On Steroids 70