Java Based Containers in Kubernetes
9/29/2016 @ Digital Measures
Pizza Consumption
Containers
What is a Container?
Docker containers wrap a piece of software in a complete filesystem that contains everything needed to run: code, runtime, system tools, system libraries – anything that can be installed on a server. This guarantees that the software will always run the same, regardless of its environment. (docker.com)
Advantages of Containers
Containers
File System & Storage
How Containers Work - File System
How Containers Work - Storage
Containers
Networking
How Containers Work - Networking
Awesome! ... So what is Kubernetes for?
Containers
At Scale
Working Together
Kubernetes gives you ALL OF THE ABOVE, out of the box!
Kubernetes
Concepts
Nodes
PODS
Labels
PODS - Example Pod
Spring Boot App
Logstash Service
nginx
/tmp
zlib
POD
CONTAINER
STORAGE VOLUME
Replica Set
Deployments
Deployments
Volumes
Persistent Volumes
Volumes & PersistentVolumes
Spring Boot App
Logstash Service
nginx
/ (emptyDir)
zlib
POD
CONTAINER
/tmp
/logs
Node
/ (hostPath)
/../docker
PersistentVolume
NFS/iSCSI
/zipped
REST APIs
Namespaces
Spring Boot App
Logstash Service
nginx
/ (emptyDir)
zlib
POD
CONTAINER
/tmp
/logs
Node
/ (hostPath)
/../docker
PersistentVolume
NFS/iSCSI
/zipped
Annotations
Annotations can be added to any Kubernetes object.
Annotations provided metadata that can be used by controller to do specific things to the cluster, or external resources.
Ingress
Spring Boot App
nginx
POD
DNS
Firewall / Load Balancer / TLS Termination
K8s API
Service my-service
Exposes Port 8080
To port 8080
Labels: app=my-app, env=qa
Expose port 940021
For pods with labels that match: app=my-app, env=qa
Ingress
Specify host�- qa.my-service.com
Specify Service
Any special annotations (TLS, TTL)
Service Mesh (Consul Connect)
Spring Boot App
nginx
POD
Exposes Port 8080
Labels: app=app-a, env=qa
Go App
nginx
POD
Exposes Port 8080
Labels: app=app-b, env=qa
Annotations:
Upstreams: app-b:4223
Consul Connect
Side Car
Side Car
Annotations:
Register: app-b:4223
localhost:4223
Thanks! Check out these interesting links
Providers
Getting Started Guides
Sources