Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.

Managing Docker Containers In A Cluster - Introducing Kubernetes

1.583 Aufrufe

Veröffentlicht am

Containerising your applications with Docker gets more and more attraction. While managing your Docker containers on your developer machine or on a single server is not a big hassle, it can get uncomfortable very quickly when you want to deploy your containers in a cluster, no matter if in the cloud or on premises. How do you provide high availability, scaling and monitoring? Fortunately there is a rapidly growing ecosystem around docker, and there are tools available which support you with this. In this session I want to introduce you to Kubernetes, the Docker orchestration tool started and open sourced by Google. Based on the experience with their data centers, Google uses some interesting declarative concepts like pods, replication controllers and services in Kubernetes, which I will explain to you. While Kubernetes still is a quite young project, it reached its first stable version this summer, thanks to many contributions by Red Hat, Microsoft, IBM and many more.

Veröffentlicht in: Software

Managing Docker Containers In A Cluster - Introducing Kubernetes

  1. 1. @slintes#Devoxx #Kubernetes Managing Docker Containers In A Cluster - Introducing Kubernetes Marc Sluiter Luminis Technologies
  2. 2. @slintes#Devoxx #Kubernetes Who am I? • Marc Sluiter • Software Engineer @ Luminis Technologies • Java developer for 14 years • Working on Amdatu and INAETICS
  3. 3. @slintes#Devoxx #Kubernetes Motivation • Microservices • decoupled, modular application components • Containers • host os independent packaging • Cloud • virtual or bare metal pool of resources for running the containers
  4. 4. @slintes#Devoxx #Kubernetes Docker • easy to use on dev machine • how to handle container lifecycle in a cluster?
  5. 5. @slintes#Devoxx #Kubernetes Kubernetes • Greek for "helmsman" or “pilot" • schedules, runs and manages containers in a cluster of virtual or physical machines • declarative approach: • try permanently to reach the declared cluster state
  6. 6. @slintes#Devoxx #Kubernetes Kubernetes • started by Google in 2014 • based on over 10 years experience (“Borg”) • first release in Juli 2015 • donated to Cloud Native Computing Foundation • 100% Open Source • Go
  7. 7. @slintes#Devoxx #Kubernetes Concepts: Pods?! • smallest deployable unit • small group of tightly coupled containers • shared network and data volumes • routable IP address • multiple pods per node
  8. 8. @slintes#Devoxx #Kubernetes multiple container usecases • sidecar containers • ambassador containers • adapter containers • but often just one container
  9. 9. @slintes#Devoxx #Kubernetes Pod declaration apiVersion: v1 kind: Pod metadata: name: myAppPod labels: name: myAppPod version: v1.2 spec: containers: - name: master image: myCompany/myImage:v1.2 ports: - containerPort: 1234
  10. 10. @slintes#Devoxx #Kubernetes Concepts: Replication Controllers • runs x copies of a pods • starts or kill pods if necessary • handle pod failures • health checks • Up- and downscaling
  11. 11. @slintes#Devoxx #Kubernetes Replication Controller cont. • rolling updates • blue / green or canary deployments
  12. 12. @slintes#Devoxx #Kubernetes Replication Controller declaration apiVersion: v1 kind: ReplicationController metadata: name: myAppReplicationController labels: name: myApp spec: replicas: 1 selector: name: myAppPod version: v1.2 template: <embedded pod declaration>
  13. 13. @slintes#Devoxx #Kubernetes Concepts: Services • pods are mortal! • services provide a permanent virtual IP • proxy traffic to selected pods • simple load balancing
  14. 14. @slintes#Devoxx #Kubernetes Service declaration apiVersion: v1 kind: Service metadata: name: myAppService spec: ports: - port: 8888 targetPort: 1234 selector: name: myApp
  15. 15. @slintes#Devoxx #Kubernetes kubectl $ kubectl create -f myAppController.yaml $ kubectl get rc CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS myAppRC master myImage name=myAppPod,… 1 $ kubectl get pods NAME READY STATUS RESTARTS AGE myAppRC-dz33o 1/1 Running 0 42s $ kubectl create -f myAppService.yaml $ kubectl get services NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE myAppService <none> 1234/TCP name=myApp 32s
  16. 16. @slintes#Devoxx #Kubernetes Kubernetes architecture • Master • API server • Controller • Scheduler • Workers • Kubelet • Proxy • State only in etcd!
  17. 17. @slintes#Devoxx #Kubernetes More features • Resource limits • Secrets • Monitoring (cAdvisor) • Logging / Debugging • kubectl logs… • kubectl exec… • Authentication • new in V1.1, released this week: • Jobs • DaemonSets • Autoscaling based on CPU Usage • Ingress (HTTP Load Balancing) • Deployments (declarative rolling updates)
  18. 18. @slintes#Devoxx #Kubernetes K8s in production? • Apache Stratos • Red Hat Openshift & Fabric8 • CoreOS Tectonic • Deis
  19. 19. @slintes#Devoxx #Kubernetes Kubernetes @ Luminis Amdatu Kubernetes Java Client http://bit.ly/KubeJavaClient
  20. 20. @slintes#Devoxx #Kubernetes Questions?
  21. 21. @slintes#Devoxx #Kubernetes Thank you!
  22. 22. @slintes#Devoxx #Kubernetes Links... http://kubernetes.io @kubernetesio https://github.com/kubernetes http://www.luminis.eu http://luminis-technologies.com http://www.amdatu.org http://www.inaetics.org