Unstoppable Cloud Infrastructure
with OpenShift and Kubernetes
Jan Kleinert • Josh Wood
[email protected] • [email protected]
March 22, 2019
Slide 2
Slide 2 text
@jankleinert / @joshixisjosh9
Jan Kleinert
Developer Advocate, Red Hat
twitter: @jankleinert
github.com/jankleinert
Hello!
Josh Wood
Developer Advocate, Red Hat
twitter: @joshixisjosh9
github.com/joshix
2
Slide 3
Slide 3 text
@jankleinert / @joshixisjosh9
3
What is Kubernetes and why do we need it?
Basic resource types
What is OpenShift?
Build, automate, iterate, collaborate
What we’ll cover
Slide 4
Slide 4 text
@jankleinert / @joshixisjosh9
Why do we need Kubernetes?
4
Slide 5
Slide 5 text
No content
Slide 6
Slide 6 text
No content
Slide 7
Slide 7 text
No content
Slide 8
Slide 8 text
@jankleinert / @joshixisjosh9
8
What is Kubernetes?
Slide 9
Slide 9 text
@jankleinert / @joshixisjosh9
9
Kubernetes is...
An open source platform for running
container-based workloads and
managing them at scale
Slide 10
Slide 10 text
@jankleinert / @joshixisjosh9
10
Kubernetes provides...
An API
API object primitives include these attributes:
kind
apiVersion
metadata
spec
status
Slide 11
Slide 11 text
@jankleinert / @joshixisjosh9
11
Basic K8s Terminology
1. Control Plane
2. Node
3. Pod
4. Deployment
5. Service
Slide 12
Slide 12 text
@jankleinert / @joshixisjosh9
12
Control Plane
● The control plane implements loop(s), checking that actual state
== desired state
● Controller - any control plane member implementing state
reconciliation
● The default control plane schedules Pods onto cluster Nodes
Slide 13
Slide 13 text
@jankleinert / @joshixisjosh9
13
Node
● Node: a host machine where
containers run
● Each Node runs kubelet, the K8s
agent
Slide 14
Slide 14 text
@jankleinert / @joshixisjosh9
14
Pod
● A group of one or more
co-located containers
● Minimum unit of scale
● Pods run on Nodes,
Replicas across them
kind: Pod
apiVersion: v1
metadata:
creationTimestamp:
name: hello-k8s
labels:
run: hello-k8s
spec:
containers:
- name: hello-k8s
image: jkleinert/raleigh-dogparks:v1
ports:
- containerPort: 8080
resources: {}
@jankleinert / @joshixisjosh9
23
What is OpenShift?
Slide 24
Slide 24 text
@jankleinert / @joshixisjosh9
24
Registry
Route
Deployment
Configuration
Build
Configuration
Persistent
Volume Claim Ingress
Service
Persistent
Volume
Replication
Controller*
Pod
Image Stream
Kubernetes
and OpenShift
Slide 25
Slide 25 text
@jankleinert / @joshixisjosh9
25
Build
Build and deploy container images
Slide 26
Slide 26 text
@jankleinert / @joshixisjosh9
26
Slide 27
Slide 27 text
@jankleinert / @joshixisjosh9
27
Slide 28
Slide 28 text
@jankleinert / @joshixisjosh9
28
Source to Image
Combines source repos and operationally-
maintained builder images to produce
application images
Slide 29
Slide 29 text
@jankleinert / @joshixisjosh9
29
Source to Image
Available as a standalone project, for use with Jenkins or
other external builder processes:
github.com/openshift/source-to-image
Slide 30
Slide 30 text
@jankleinert / @joshixisjosh9
30
Automate
git push to deploy
Slide 31
Slide 31 text
@jankleinert / @joshixisjosh9
31
Slide 32
Slide 32 text
@jankleinert / @joshixisjosh9
32
Iterate
Slide 33
Slide 33 text
@jankleinert / @joshixisjosh9
33
oc rsync
Useful for testing changes prior to a commit
Copies files to a container; use the --watch flag to
continuously sync
oc rsync --exclude='node_modules*' . YOUR_PODNAME:
Slide 34
Slide 34 text
@jankleinert / @joshixisjosh9
34
odo (OpenShift Do)
A developer-focused command line tool for fast, iterative
development on OpenShift
https://github.com/redhat-developer/odo
https://learn.openshift.com/introduction/developing-with-odo/
Slide 35
Slide 35 text
@jankleinert / @joshixisjosh9
35
Collaborate
Share and replicate your success
Slide 36
Slide 36 text
@jankleinert / @joshixisjosh9
36
Service Catalog & Brokers
Slide 37
Slide 37 text
@jankleinert / @joshixisjosh9
37
Templates as Installers
Install a template into the current project, making it easier to reuse:
oc create -f template.json
Slide 38
Slide 38 text
@jankleinert / @joshixisjosh9
38
Templates as Installers
Create an application from an installed template, from a file, or from
a URL:
oc new-app -f template.json
Slide 39
Slide 39 text
@jankleinert / @joshixisjosh9
39
Multi-service App Example
Node.js and MongoDB multi-service app
oc create -f https://raw.githubusercontent.com/
openshift-roadshow/nationalparks-js/master/
nationalparks-js.json