Slide 1

Slide 1 text

bit.ly/kubemaster1 dn.dev/openshift-workshop 1 OpenShift and Kubernetes Today’s slides are here: dn.dev/openshift-workshop Homework dn.dev/openshift-tutorial

Slide 2

Slide 2 text

dn.dev/kubemaster2 Josh Wood Principal Developer Advocate Formerly CoreOS Kubernetes Operators, O’Reilly 2020 OpenShift for Developers, O’Reilly 2021 [email protected]

Slide 3

Slide 3 text

dn.dev/openshift-workshop Developer Sandbox! Get free access for renewable 30 days to a self-service, cloud-hosted Kubernetes experience with Developer Sandbox for Red Hat OpenShift. https://developers.redhat.com/developer-sandbox

Slide 4

Slide 4 text

dn.dev/openshift-workshop Why developers care about Hybrid Cloud? Applications can easily be made highly scalable and available Platform looks the same wherever it runs - same APIs and rich UI Applications can be developed and deployed in the same way Clusters typically stretch across cloud AZ for data center resilience But what about load balancing and HA across clusters running in different cloud providers? - It would need multiple data centers to fail to halt your application! X X

Slide 5

Slide 5 text

dn.dev/openshift-workshop Why Kubernetes?

Slide 6

Slide 6 text

dn.dev/openshift-workshop Love Thy Mono Old School New School

Slide 7

Slide 7 text

dn.dev/openshift-workshop Container Technology Supporting Modern Apps workloads Cloud Native Portable and interoperable Mature technology

Slide 8

Slide 8 text

dn.dev/openshift-workshop CONTAINERS CLOUD INFRASTRUCTURE LINUX HOST (KERNEL) Container App Container App Container App Container App DEVELOPERS ● Cloud-native apps ● Simplified packaging ● Simplified testing IT OPERATIONS ● Consistent app deploys ● Automated app deploys ● Improved app performance ● Multi-cloud consistency BUSINESS LEADER ● Enable devops culture ● Enable hybrid cloud ● Reduce vm licensing costs ● Accelerate app-dev cycles

Slide 9

Slide 9 text

dn.dev/openshift-workshop DevOps Challenges - Multiple Containers ▪ How to scale? ▪ How to avoid port conflicts? ▪ How to manage them on multiple hosts? ▪ What happens if a host fails? ▪ How to keep them running continuously? ▪ How to update them? ▪ Rebuild Container Images?

Slide 10

Slide 10 text

dn.dev/openshift-workshop ▪ Greek for “Helmsman” ▪ Container orchestrator ▪ Supports multiple cloud and bare-metal environments ▪ Inspired by Google’s experience with containers ▪ Open source, written in Go ▪ Manage applications, not machines Meet Kubernetes

Slide 11

Slide 11 text

dn.dev/openshift-workshop What is Kubernetes?

Slide 12

Slide 12 text

dn.dev/openshift-workshop ✓ 1+ containers ✓ Single IP address ✓ Shared storage (ephemeral) ✓ Shared resources ✓ Shared lifecycle Kubernetes Terms - Pod

Slide 13

Slide 13 text

dn.dev/openshift-workshop ✓ The Desired State - replicas, pod template: health checks, resources, image Kubernetes Terms - Deployment/ReplicaSet

Slide 14

Slide 14 text

dn.dev/openshift-workshop ✓ Grouping of pods (acting as one) has stable virtual IP and DNS name Kubernetes Terms - Service

Slide 15

Slide 15 text

dn.dev/openshift-workshop ✓ Network available storage ✓ PVs and PVCs Kubernetes Terms - Persistent Volume

Slide 16

Slide 16 text

dn.dev/openshift-workshop ✓ Key/Value pairs associated with Kubernetes objects (env=production) Kubernetes Terms - Labels

Slide 17

Slide 17 text

dn.dev/openshift-workshop Kubernetes terms and concepts Control Plane The control plane implements loop(s), checking that actual state == desired state ● Controller - a control plane member implementing state reconciliation ● The default control plane schedules pods onto cluster Nodes

Slide 18

Slide 18 text

dn.dev/openshift-workshop Primary Node Node Istio proxy Node Node Node Node Dev Ops api etcd scheduler controllers Kubernetes Cluster - Nodes kubelet kubelet kubelet kubelet kubelet kubelet

Slide 19

Slide 19 text

dn.dev/openshift-workshop Dev Ops Kubernetes Cluster - Declarative

Slide 20

Slide 20 text

dn.dev/openshift-workshop Node Node Istio proxy Node Node Node Node Kubernetes Cluster - 4 Tomcats kubelet kubelet kubelet kubelet kubelet kubelet

Slide 21

Slide 21 text

dn.dev/openshift-workshop Node Node Istio proxy Node Node Node Node Kubernetes Cluster - Pod Fail kubelet kubelet kubelet kubelet kubelet kubelet X

Slide 22

Slide 22 text

dn.dev/openshift-workshop Node Node Istio proxy Node Node Node Node Kubernetes Cluster - Correcting kubelet kubelet kubelet kubelet kubelet kubelet

Slide 23

Slide 23 text

dn.dev/openshift-workshop Node Node Istio proxy Node Node Node Node Kubernetes Cluster - Node Fail kubelet kubelet kubelet kubelet kubelet kubelet X

Slide 24

Slide 24 text

dn.dev/openshift-workshop Node Node Istio proxy Node Node Node kubelet kubelet kubelet kubelet kubelet Kubernetes Cluster - Pods Replaced

Slide 25

Slide 25 text

Access Developer Console and open Web Terminal

Slide 26

Slide 26 text

OpenShift build tools: Pipelines and GitOps Building and deploying app containers on the cluster OpenShift promotes build elements to first-class abstractions on the platform ● Integrated container registry ● Software catalog ● Build configuration builds from source repo ● Image stream: Tagged images, source in registry, rollbacks to arbitrary points on that stream, rebuild apps when FROM is updated

Slide 27

Slide 27 text

OpenShift web console and oc Managing apps on the cluster OpenShift promotes some new elements. These tools know about them ● Web console built around the Project → App ● Graphical tools for native k8s things like volume claims, etc ● oc: CLI tool ● odo: CLI tool for developers

Slide 28

Slide 28 text

Elements Kubernetes (blue) and OpenShift (red) Abstractions Route Namespace == Project Build Configuration Image Stream Integrated Registry Pod Replica Set Service Ingress Persistent Volume Claim Persistent Volume

Slide 29

Slide 29 text

OpenShift Project Namespace ready for work Projects draw on the Kubernetes namespace, which isolates resources and access ● Intelligent RBAC defaults and user role ● Project defines and seals an “application” ● … in a way flexible enough for various architectures ● Projects enable multi-tenant use of an OpenShift cluster with access privileges determined by the identity of the user or the team they belong to

Slide 30

Slide 30 text

OpenShift Route Real world external traffic The OpenShift Route(r) ● Routes predate Ingress resource/controllers ● And remain considerably easier to think about and use ● OpenShift admins define Routers -- effectively, edge routing between the cluster SDN and the real world where your customers live ● HAProxy: L7 is in the box ● Easy TLS, edge or pass through

Slide 31

Slide 31 text

OpenShift and Kubernetes Conclusions OpenShift makes it easier for devs to get distributed system benefits ● Deployment choices reduced: SDN, Ingress controller and LB costs ● But what about Layer 4? ● What about site specific SDN concerns? ● Kubernetes flexibility: ● Define alternative implementations ● OpenShift Routers: can be replaced, or ● Kubernetes Ingress

Slide 32

Slide 32 text

dn.dev/openshift-workshop Additional Resources

Slide 33

Slide 33 text

dn.dev/openshift-workshop Developer Sandbox! Get free access for renewable 30 days to a self-service, cloud-hosted Kubernetes experience with Developer Sandbox for Red Hat OpenShift. https://developers.redhat.com/developer-sandbox

Slide 34

Slide 34 text

dn.dev/openshift-workshop Lab: dn.dev/openshift-tutorial

Slide 35

Slide 35 text

dn.dev/openshift-workshop Want More - Labs! developers.redhat.com ● Using OpenShift ● Developing on OpenShift ● GitOps and Pipelines ● Serverless ● Operators ● Istio ● Storage ● AI/ML ● Quarkus

Slide 36

Slide 36 text

dn.dev/openshift-workshop Download https://red.ht/3IxJCzY

Slide 37

Slide 37 text

dn.dev/openshift-workshop Download https://red.ht/modernize-enterprise-java

Slide 38

Slide 38 text

dn.dev/openshift-workshop Download https://dn.dev/k8s-patterns

Slide 39

Slide 39 text

dn.dev/openshift-workshop Thank You!