openshift
container orchestration
kubernetes
architecture
key concepts
dockerfile
image
registry
kubernetes
deployment code, tooling
dockerfile
S2I
ocr
openshift
deployment code
image stream
registry
dockerfile
image
registry
kubernetes
deployment code, tooling
SWARM
clustering
scheduling
load balancing
fault tolerance
scaling
app deployment
battle hardened
open
community
features
complex
zero to dev
non native
clustering
scheduling
load balancing
fault tolerance
scaling
app deployment
Feature | Concept |
---|---|
Colocation | Pods |
Scaling/Fault Tolerance | replication controllers, replica sets |
Load Balancing | Services |
App Deployment, Rollbacks | deployments, rolling-updates |
Stateful Apps | stateful sets/ pet sets |
configs, secrets | config sets, secrets |
app health checks | liveness, readiness |
logs and storage | |
monitoring |
openshift
Project A
Project B
Project C
stack = project
openshift
Project A
Project B
Project C
stack = project
kubernetes
Project A
Project B
Project C
quota
users and roles
network policies
container
container
nginx
fsync
nginx
fsync
container
container
container
pod
debian
centos
nginx
fsync
eth0
10.0.4.25
process/pid namespace
root filesystem namespace
network namespace
hostname /uts namespace
volumes
fsync
dst: /var/www/html
dst: /data
hostname = pod-xxx
PI Version
ind
etadata
pec
apiVersion: v1
kind: Pod
metadata:
name: vote
labels:
app: voting
role: ui
tier: front
env: dev
spec:
containers:
- name: vote
image: schoolofdevops/vote:latest
ports:
- containerPort: 80
app
replication controller
v1
v2
strategy
deployment / deployment config
deployment config (dc)
replication controller
pod spec
strategy
openshift
deploymen (deploy)
replicaSet
pod spec
strategy
kubernetes
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: frontend-canary
namespace: mogambo
spec:
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 1
maxSurge: 1
replicas: 3
minReadySeconds: 40
revisionHistoryLimit: 4
paused: false
template:
metadata:
name: frontend
labels:
tier: "1"
app: frontend
env: dev
release: canary
spec:
containers:
- name: frontend
image: schoolofdevops/frontend:v2.0
ports:
- containerPort: 8079
protocol: TCP
replicaSet
strategy
pod spec
1
2
3
replication controllers
2
replication controllers
labels:
app: carts version: v2.1 env: dev
labels:
app: ui version: v5.0 env: dev
selector:
app: carts env: dev
replicationController
selector:
app: carts env: dev
replicaSet
selector:
app: carts env: dev version: [v1,v2, v3]
set based ( A AND B AND (x or y) )
A AND B AND C
Release Strategy
v1
v2
Rolling
Recreate
custom
svc.k8s.io
app.project1.svc.cluster.local
10.30.45.76
app:80
Service
Endpoints
Cluster IP
Nodeport
Load Balancer
ExtIP
host:80
host:30000
cloud
with selectors
ELB
L4
L4
L4
L7
Route
ui.xyz.com
api.xyz.com
xyz.com/carts
DNS
api
deplyoment config
project
service, route
ConfigMaps and Secrets
Persistent Volumes
Network and CNI
Network Policies
RBAC
Horizontal Pod Autoscaler
Additional Controllers
1
2
3
e.g. Monitoring/Logging Agents
app.xyz.com
app.svc.ns.cluster
app.svc.ns.cluster
kubectl
Scheduler
API Server
Controllers Manager
etcd
kubelet
kube-proxy
Master
Node 1
Node 2
Docker
kubelet
kube-proxy
Docker
etcd
managers
High Available Design
etcd
etcd
LB
kubectl, ui, api clients
storage
log mgmt
monitoring
nodes