2 /
HESHAM AMIN
http://heshamamin.com/
@heshamamin
https://plus.google.com/+HeshamAmin
https://www.linkedin.com/in/heshamaamin/
 Docker container = Process
 Not a complete application (Usually)
3
 Maintaining a desired number of running containers
 Service discovery
 Load Balancing
 Scaling
 Rolling updates
 Rollback
 Management
 Resource optimization
4
Swarm
Kubernetes
 Open source (Go)
 Started by Google
 Supported on GKE, Azure Container Service
 …But can run on others (AWS / On-premises)
 Local development (Minikube)
6
7
Node
Master(s)
API
Proxy
Node
Node
Kubelet
Elastic Load
Balancing
Amazon
VPC
Virtual or
Physical
machines
Worker Node is
a machine that
hosts the
containers
Master node
control workers
10
 The smallest logical unit of deployment
 Collection of containers
 Usually one
 Share IP and port space (localhost)
 Not durable
11
12
apiVersion: v1
kind: Pod
metadata:
name: pod-example
labels:
env: test
spec:
containers:
- image: nginx
name: nginx
 Abstraction which defines a logical set of Pods and a policy by which to access
them.
 Internal and external access
 This set of Pods are determined using selectors.
13
14
kind: Service
apiVersion: v1
metadata:
# Unique key of the Service instance
name: service-example
spec:
ports:
# Accept traffic sent to port 80
- name: http
port: 80
targetPort: 80
selector:
# Loadbalance traffic across Pods matching
# this label selector
app: nginx
# Create an HA proxy in the cloud provider
# with an External IP address - *Only supported
# by some cloud providers*
type: LoadBalancer
 Declarative desired state of Replica Sets
 Support scaling and autoscaling
 Can be rolled-back
15
16
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
# Unique key of the Deployment instance
name: deployment-example
spec:
# 3 Pods should exist at all times.
replicas: 3
# Keep record of 2 revisions for rollback
revisionHistoryLimit: 2
template:
metadata:
labels:
# Apply this label to pods and default
# the Deployment label selector to this value
app: nginx
spec:
containers:
-name: nginx
# Run this image
image: nginx:1.10
 Ensure a specified number of Pods is running at any time
 Used for scaling
17
 Group of Stateful Pods.
 Stable, unique network identifiers.
 Stable, persistent storage.
18
 Scope for names. Names of resources are unique within a namespace.
 A way for managing resource quotas:
 Number of objects
 Memory
 CPU Cores
 Used for large clusters.
19
21 /
HESHAM AMIN
http://heshamamin.com/
@heshamamin
https://plus.google.com/+HeshamAmin
https://www.linkedin.com/in/heshamaamin/

Kubernetes talk at DDDSydney 2017