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.
2. @slintes#Devoxx #Kubernetes
Who am I?
• Marc Sluiter
• Software Engineer @
Luminis Technologies
• Java developer for 14
years
• Working on Amdatu and
INAETICS
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. @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. @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
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)
amdatu - components for modular java applications based on OSGi
inaetics - research project about modular, dynamic, scalable, secure and distributed applications
why do I want to talk about managing containers in the cloud?
everybody talks about micro services nowadays
containers provide a nice packaging method for deploying them into the cloud
Managing containers in a cluster manually is a no go
Google came up early with Kubernetes
declarative approach:
not: deploy and start these 2 containers on that node
but: I want to have these 2 containers running somewhere in the cluster
- at Google everything runs in containers, 2 billion starts each week
- CNCF belongs to Linux Foundation
- open community, open design, open to ideas
- KubeCon in SF this week sold out with 500 attendees
sidecar containers: extend /enhance the main container
ambassador container: proxy to the outside world, e.g. to a mongo cluster
adapter container: standardize and normalize output, e.g. monitoring/logging
-> modular and reusable components
docker run + metadata, esp. labels
health checks: check if docker container is running, or sth implementation specific, e.g. via http or in-container command execution
scaling during runtime
metadata + number of replicas + pod selector
but: - what about SSL, redirects, rewrites?
- how can that fixed IP be reached?
-> use your own or cloud loadbalancer/proxy for public services, use k8s services for internal communication
metadata + portmapping + rc selector
ip address of service can be fetched via API or through env variables
command line interface
API Server: REST / kubectl
Controller: what pods should be started
Scheduler: where should they be started
Kubelet: start the container Proxy: service
Resource limits: restart when exceeding, helps scheduling
Secrets: store and access configuration data in a secure way
Authentication: secure API server with certs or username / password
Jobs: run containers where you expect termination
Kubernetes is used already by many other projects, like…
-> yes, it’s production ready
Cloud RTI - commercial offering about kubernetes based application hosting with excellent support by our engineers
dashboard with centralised logging also from your frontend