6. Running apps on a VM vs Docker Container
Infrastructure
Virtual Machines
7. Running apps on a VM vs Docker Container
Infrastructure
Virtual Machines
Host OS
8. Running apps on a VM vs Docker Container
Infrastructure
Virtual Machines
Host OS
Hypervisor
9. Running apps on a VM vs Docker Container
Infrastructure
Virtual Machines
Host OS
Hypervisor
Guest
OS
Guest
OS
Guest
OS
Guest
OS
10. Running apps on a VM vs Docker Container
Infrastructure
Virtual Machines
Host OS
Hypervisor
Guest
OS
Guest
OS
Guest
OS
Guest
OS
bins/libs bins/libs bins/libs bins/libs
11. Running apps on a VM vs Docker Container
Infrastructure
Virtual Machines
Host OS
Hypervisor
Guest
OS
Guest
OS
Guest
OS
Guest
OS
bins/libs bins/libs bins/libs bins/libs
App App App App
12. Running apps on a VM vs Docker Container
Infrastructure
Virtual Machines
Host OS
Hypervisor
Guest
OS
Guest
OS
Guest
OS
Guest
OS
bins/libs bins/libs bins/libs bins/libs
App App App App
Infrastructure
Docker Containers
13. Running apps on a VM vs Docker Container
Infrastructure
Virtual Machines
Host OS
Hypervisor
Guest
OS
Guest
OS
Guest
OS
Guest
OS
bins/libs bins/libs bins/libs bins/libs
App App App App
Infrastructure
Host OS
Docker Containers
14. Running apps on a VM vs Docker Container
Infrastructure
Virtual Machines
Host OS
Hypervisor
Guest
OS
Guest
OS
Guest
OS
Guest
OS
bins/libs bins/libs bins/libs bins/libs
App App App App
Infrastructure
Host OS
Docker Daemon
Docker Containers
15. Running apps on a VM vs Docker Container
Infrastructure
Virtual Machines
Host OS
Hypervisor
Guest
OS
Guest
OS
Guest
OS
Guest
OS
bins/libs bins/libs bins/libs bins/libs
App App App App
Infrastructure
Host OS
Docker Daemon
bins/libs bins/libs bins/libs bins/libs
Docker Containers
16. Running apps on a VM vs Docker Container
Infrastructure
Virtual Machines
Host OS
Hypervisor
Guest
OS
Guest
OS
Guest
OS
Guest
OS
bins/libs bins/libs bins/libs bins/libs
App App App App
Infrastructure
Host OS
Docker Daemon
bins/libs bins/libs bins/libs bins/libs
App App App App
Docker Containers
19. K8S
Kubernetes is an open source
container orchestration system that
helps to automate deployment,
scaling, and management of
containerized applications.
22. Small group of containers and
volume
Tightly coupled
● The atom of replication
and placement
Logical host for containers
● Echo pod get an IP address
● Share data: localhost,
volume, IPC, etc.
K8S POD
23. Storage automatically attached
to a Pod
● Local storage
● Cloud block storage
○ AWS EBS, GCE persistent
● Cluster storage
○ NSF, Gluster
○ iSCSI, Cinder
● Special volumes
○ Git repo, secret
K8S Volume
24. Ensures N copies of Pod
● If too few, start new one
● If too many, kill some
Enables self-healing
Facilitates auto scaling
K8S Replication Controller
25. Group of pods thats work
together
DNS name
Load balanced: name map to a
stable virtual IP
Decoupled from Pods and
Replication controllers
K8S Service
26. Secrets: Tokens, credentials,
certs, etc.
Don’t put them in a container
image.
Inject them as virtual volume
into pods
● Not backed into images nor
pod config
● Kept in memory, never
touches disk
K8S Secret
27. Multi tenancy in K8S
is namespace has its own
● Resources (Pods, Services,
etc.)
● Policies (who can or
cannot perform an action
in their tenancy)
● Constrain (how much
quota, etc.)
K8S Namespace
28. 12-factor says config comes from
the environment.
● Should not be baked into Docker
image
ConfigMap inject config as a virtual
volume into the Pods
● Late binding, live update
(atomic)
● Also available as env vars
K8S ConfigMap
29. Services are assumed L4
Ingress in L7
Ingress maps HTTP/HTTPS
incoming traffic to backend
services
● By host headers
● By URL paths
K8S Ingress
38. Rolling update too imperative
Deployment manage RC
changes for you
● Kubectl edit /apply is all
you need
Aggregate stats
Can have multiple updates
inflight
K8S Deployment
39. How to run pod in every
node? Or subset of nodes?
Daemonset
● Like ReplicationController
● Do one thing
● Don’t overload
Which node is a selector
K8S Daemonset
40. Give Pods time to clean up
Catch SIGTERM, clean-up exit
ASAP
Pods status Terminating
30 seconds by default
● Finish inflight operation
● Flush to disk
● Log state
K8S Graceful Termination
41. Automatically scale RCs to a
target utilization
● CPU utilization for now
Operate within user-defined
min/max bound
Set it and forget it
K8S Horizontal Pod Autoscaler
43. ● Draft
● Gitkube
● Helm
● Ksonnet
● Skaffold
● Metaparticle
● Ballerina
Tools and framework for K8S
44. ● Draft
● Gitkube
● Helm
● Ksonnet
● Skaffold
● Metaparticle
● Ballerina
Tools and framework for K8S
● deploy code to k8s cluster
(automates build-push-deploy)
● deploy code in draft-pack
supported languages without
writing dockerfile or k8s manifests
● needs draft cli, helm cli, tiller on
cluster, local docker, docker
registry
45. ● Draft
● Gitkube
● Helm
● Ksonnet
● Skaffold
● Metaparticle
● Ballerina
Tools and framework for K8S
● deploy code to k8s cluster
(automates build-push-deploy)
● git push to deploy, no dependencies
on your local machine
● needs dockerfile, k8s manifests in
the git repo, gitkube on cluster
46. ● Draft
● Gitkube
● Helm
● Ksonnet
● Skaffold
● Metaparticle
● Ballerina
Tools and framework for K8S
● deploy and manage charts
(collection of k8s objects defining
an application) on a k8s cluster
● ready made charts for many
common applications, like mysql,
mediawiki etc.
● needs helm cli, tiller on cluster,
chart definition locally or from a
repo
47. ● Draft
● Gitkube
● Helm
● Ksonnet
● Skaffold
● Metaparticle
● Ballerina
Tools and framework for K8S
● define k8s manifests in jsonnet,
deploy them to k8s cluster
● reusable components for common
patterns and stacks, like
deployment+service, redis
● needs jsonnet knowledge, ksonnet
cli
48. ● Draft
● Gitkube
● Helm
● Ksonnet
● Skaffold
● Metaparticle
● Ballerina
Tools and framework for K8S
● deploy code to k8s cluster
(automates build-push-deploy)
● watches source code and triggers
build-push-deploy when change
happens, configurable pipeline
● needs skaffold cli, dockerfile, k8s
manifests, skaffold manifest in
folder, local docker, docker registry
49. ● Draft
● Gitkube
● Helm
● Ksonnet
● Skaffold
● Metaparticle
● Ballerina
Tools and framework for K8S
● deploy your code in metaparticle
supported languages to k8s
(automates build-push-deploy)
● define containerizing and deploying
to k8s in the language itself, in an
idiomatic way, without writing
dockerfile or k8s yaml
● needs metaparticle library for
language, local docker
50. ● Draft
● Gitkube
● Helm
● Ksonnet
● Skaffold
● Metaparticle
● Ballerina
Tools and framework for K8S
● Generate docker images, k8s artifacts
depending on annotation defined in
the code.
● Support many Kubernetes
functionalities like; all kind of
Kubernetes services, deployment,
ingress, secrets, persistent volumes,
config maps, liveness probe and
horizontal pod autoscaling.