P R ACT IC A L IN T RO DUCT IO N TO O R CH EST R AT IO N :
K UBE R N E T E S/O P ENSH IFT
DH A H R A N DO CKER M EET U P
10T H NOV EM BER 2017
BY : WA LID S H A A R I
System engineer, passionate about Open source working for a large enterprise
with anti DevOps patterns. Recently working with network team on evaluating
Network Automation for multi vendor data center.
@walidshaari
walid.shaari@linux.com
https://www.linkedin.com/in/walidshaari/
https://medium.com/@walidshaari/
https://github.com/walidshaari/Kubernetes-Certified-Administrator
$oc whoami
RHCA IV
Thank you, our sponsor, TAM
Development LLC for hosting the
Dhahran Docker meetup.
Thank you Mustafa Dahab for
presenting TAM Development LLC
Rancher, and Docker in production.
3
Google	trends
4
5
Kubernetes	wining	
the	infrastructure	war
Open-source	system	for	automating	
deployment,	scaling,	and	management	
of	containerized	applications.
KUBERNETES
6
7
Borg
Mesos
Omega
Kubernetes
Hashicorp Nomad
Docker	swarm
Rancher	Cattle
15 years of experience of running production workloads at Google
8
Why	Invest	in	Kubernetes?
What	problems	Kubernetes/Openshift solve?
Use	Cases
PORTABILITY
9
AKS
RESILIENCY
10
ELASTICITY
11
https://cloudplatform.googleblog.com/2016/09/bringing-Pokemon-GO-to-life-on-Google-Cloud.html
BUILDING DISTRIBUTED PLATFORMS
12
Helm,	charts,	tiller	and	MonocularSERVERLESS	PLATFORMS
KubeApps.com
Istio
Rich	ECO	system	to	build	distributed	applications
Among more and more other use cases
13
https://kubernetes.io/case-studies/
14
GETTING STARTED
15
• Openshift is	an	opiniated Kubernetes	- you	can	use	Kubectl Kubernetes	client	to	interact	with	an	OpenShift
cluster
• Red	Hat	does	not	use	all	the	Kubernetes	abstractions	“Objects”,	however,	they	have	their	own	and	wrap	
around	standard	Kubernetes	objects.		e.g.	Openshift router	vs.	K8s	ingress	controller.
• Medium:	difference	between	kubernetes	and	openshift
Openshift relationship	to	Kubernetes
16
• Enhanced	Security
• Ease	of	deployments	in	different	scenarios	(e.g.	disconnected,	standalone,	HA,	Azure,	..etc)
• Enterprise	level	support
• Opinionated	architecture	and	out	of	the	box	platform
• Focus	on	what	is	more	important	e.g.	PaaS		FaaS not	CaaS
• Easy	plumbing	and	pipelines	for	developers	and	ops	alike.
• You	can	still	use	K8s	under	the	hood.
Why	Openshift not	Kubernetes?
Medium:	difference	between	kubernetes	and	openshift
K8S Cluster architecture
Openshift objects
Where	is	the	container	object?
19
minishift
https://docs.openshift.org/latest/minishift/getting-started/installing.html
Install	local	utilities:	kubectl and	minikube
https://kubernetes.io/docs/tasks/tools/install-kubectl/
Checkout	the	Kubernetes	docs
https://kubernetes.io/docs/home/
20
masters-imac:~	master$	minishift oc-env
export	PATH="/Users/master/.minishift/cache/oc/v3.6.0:$PATH"
#	Run	this	command	to	configure	your	shell:
#	eval $(minishift oc-env)
masters-imac:~	eval $(minishift oc-env)
minishift
21
masters-imac:~	master$	minishift oc-env
export	PATH="/Users/master/.minishift/cache/oc/v3.6.0:$PATH"
#	Run	this	command	to	configure	your	shell:
#	eval $(minishift oc-env)
masters-imac:~	eval $(minishift oc-env)
minishift
22
oc completion	bash	>	oc-completion.sh
source	oc-completion.sh
oc version
oc help
oc types
oc new-project
oc get	projects
oc get	namespaces
kubectl completion	bash	>	k8s-completion.sh
source	k8s-completion.sh
kubectl version
Kubectl help
Kubectl get	projects
Kubectl get	namespaces
Can	kubectl create	a	namespace	?	How	about	a	project?
Client	tools	demo
23
Pods	are	the	core	Kubernetes	Component
masters-imac:~ master$ oc run mypod --image=gcr.io/kuar-demo/kuard-amd64:1
deploymentconfig "mypod" created
masters-imac:~ master$ oc run myotherpod --image=gcr.io/kuar-demo/kuard-amd64:2
deploymentconfig "myotherpod" created
masters-imac:~ master$ kubectl get pods
NAME READY STATUS RESTARTS AGE
myotherpod-1-33xmq 0/1 ContainerCreating 0 2m
myotherpod-1-deploy 1/1 Running 0 2m
mypod-1-6p37m 1/1 Running 0 2m
masters-imac:~ master$ kubectl get pods
NAME READY STATUS RESTARTS AGE
myotherpod-1-33xmq 0/1 ContainerCreating 0 2m
myotherpod-1-deploy 1/1 Running 0 2m
mypod-1-6p37m 1/1 Running 0 2m
masters-imac:~ master$ oc get pods
NAME READY STATUS RESTARTS AGE
myotherpod-1-33xmq 1/1 Running 0 3m
mypod-1-6p37m 1/1 Running 0 4m
Pod
Kurad:1
Project/name	space
25
But	what	did	Openshift add	to	Docker	run?
masters-imac:~ master$ oc get all
NAME REVISION DESIRED CURRENT TRIGGERED BY
dc/myotherpod 1 1 1 config
dc/mypod 1 1 1 config
NAME DESIRED CURRENT READY AGE
rc/myotherpod-1 1 1 1 8m
rc/mypod-1 1 1 1 8m
NAME READY STATUS RESTARTS AGE
po/myotherpod-1-33xmq 1/1 Running 0 8m
po/mypod-1-6p37m 1/1 Running 0 8m
26
But	what	did	Openshift add	to	Docker	run?
masters-imac:~ master$ oc get rc
NAME DESIRED CURRENT READY AGE
rc/myotherpod-1 1 1 1 8m
rc/mypod-1 1 1 1 8m
Replication	Controllers	provides	extra	feature	to	pods	such	as	rolling	update:
$	kubectl rolling-update	NAME	[NEW_NAME]	--image=IMAGE:TAG
//	Update	pods	of	frontend-v1	using	new	replication	controller	data	in	frontend-v2.json.
$	kubectl rolling-update	frontend-v1	-f	frontend-v2.json
//	Update	pods	of	frontend-v1	using	JSON	data	passed	into	stdin.	
$	cat	frontend-v2.json	|	kubectl rolling-update	frontend-v1	-f	-
28
29
Is		my	Cluster	healthy	or	not?
30
Demo	time
31
What	is	next?
https://learn.openshift.com/
https://www.katacoda.com/courses/openshift
https://www.katacoda.com/courses/kubernetes
https://www.katacoda.com/courses/istio/deploy-istio-on-kubernetes
https://www.katacoda.com/courses/prometheus
https://kubernetes.io/
32
Ad-hoc	practical	demo

Docker Dhahran November 2017 meetup