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

2015 Spring IO Barcelona - Spring-Boot Microservices, Container, Kubernetes How To

2015 Spring IO Barcelona - Spring-Boot Microservices, Container, Kubernetes How To

Ray Tsang

May 04, 2015
Tweet

More Decks by Ray Tsang

Other Decks in Technology

Transcript

  1. @saturnism #springio15 #kubernetes Spring Boot + Groovy + Microservices? Remember

    Josh’s Tweet? https://twitter.com/starbuxman/status/580517687006216193
  2. @saturnism #springio15 #kubernetes Old way: Shared machines kernel libs app

    app app No isolation No namespacing Common libs Highly coupled apps and OS app
  3. @saturnism #springio15 #kubernetes App Server libs app app app app

    Old way: Java No isolation No namespacing Common libs - shouldn’t really happen in Java apps...
  4. @saturnism #springio15 #kubernetes Old way: Virtual machines Good isolation Expensive

    and inefficient Still highly coupled to the guest OS Hard to manage app libs kernel libs app app kernel app libs libs kernel kernel
  5. @saturnism #springio15 #kubernetes Link containers docker run -ti --rm --link

    redis:redis --link helloworldservice:helloworldservice, -p 8080:8080 helloworld-ui-demo:latest
  6. @saturnism #springio15 #kubernetes More than one... libs app kernel libs

    app libs app libs app libs app kernel libs app libs app libs app libs app kernel libs app libs app libs app
  7. @saturnism #springio15 #kubernetes Enter Kubernetes Greek for “Helmsman”; also the

    root of the word “Governor” • Container orchestrator • Runs Docker containers • Supports multiple cloud and bare- metal environments • Inspired and informed by Google’s experiences and internal systems • Open source, written in Go Manage applications, not machines
  8. @saturnism #springio15 #kubernetes Kubernetes cluster libs app kernel libs app

    libs app libs app libs app kernel libs app libs app libs app libs app kernel libs app libs app libs app Kubernetes Master
  9. @saturnism #springio15 #kubernetes Open source community Version 0.16 Hosted on

    GitHub 327+ contributors 10,000+ commits 7,000+ GitHub stars CoreOS HP IBM Mesosphere Microsoft Project Partners Pivotal Red Hat SaltStack VMWare kubernetes.io
  10. @saturnism #springio15 #kubernetes Pod Group of containers Live and die

    together Shared network interface Pod App Log Collector ...
  11. @saturnism #springio15 #kubernetes Pod networking Pod IPs are routable •

    Docker default is private IP Pods can reach each other without NAT • even across nodes No brokering of port numbers This is a fundamental requirement • several SDN solutions
  12. @saturnism #springio15 #kubernetes Labels Label anything Name-value pair Make your

    own Pod App Log Collector ... type = Frontend version = 1.0
  13. @saturnism #springio15 #kubernetes Replication controllers Replication Controller Replicas → 2

    Pod App Log Collector ... type = Frontend version = 1.0 Pod App Log Collector ... type = Frontend version = 1.0
  14. @saturnism #springio15 #kubernetes Replication controllers Replication Controller Replicas → 1

    Pod App Log Collector ... type = Frontend version = 1.0 Pod App Log Collector ... type = Frontend version = 1.0
  15. @saturnism #springio15 #kubernetes Replication controllers node 1 f0118 node 3

    node 4 node 2 d9376 b0111 a1209 Replication Controller - Desired = 4 - Current = 4
  16. @saturnism #springio15 #kubernetes Replication controllers node 1 f0118 node 3

    node 4 node 2 d9376 b0111 a1209 Replication Controller - Desired = 4 - Current = 4
  17. @saturnism #springio15 #kubernetes Replication controllers node 1 f0118 node 3

    node 4 b0111 a1209 Replication Controller - Desired = 4 - Current = 3
  18. @saturnism #springio15 #kubernetes Replication controllers node 1 f0118 node 3

    node 4 a1209 Replication Controller - Desired = 4 - Current = 4 b0111 c9bad
  19. @saturnism #springio15 #kubernetes Services Replication Controller Replicas → 2 Pod

    frontend Pod type = Frontend version = 1.0 Pod type = Frontend version = 1.0 Service Label selectors: version = 1.0 type = Frontend
  20. @saturnism #springio15 #kubernetes Vagrant export KUBERNETES_PROVIDER=vagrant curl -sS https://get.k8s.io |

    bash Google Container Engine - Alpha http://cloud.google.com/container-engine http://kubernetes.io/gettingstarted/
  21. @saturnism #springio15 #kubernetes Clean up disk spaces Every image, layer,

    and, even containers litters docker rm $(docker ps -a -q) docker rmi $(docker images -q --filter dangling=true)