Upgrade to Pro — share decks privately, control downloads, hide ads and more …

GDC 2019 :: Unstoppable Cloud Infrastructure with OpenShift and Kubernetes

GDC 2019 :: Unstoppable Cloud Infrastructure with OpenShift and Kubernetes

Come learn how Kubernetes is revolutionizing the cloud computing space - and, the anticipated impact on the gaming industry. We’ll start with a quick introduction to distributed systems and the architecture behind Kubernetes. Then we’ll learn about Kubernetes APIs and API object primitives. By the end of this session you should have a firm grasp of the benefits that can be gained from adopting a Cloud Native solutions architecture for your back-end gaming systems.

Jan Kleinert

March 22, 2019
Tweet

More Decks by Jan Kleinert

Other Decks in Technology

Transcript

  1. Unstoppable Cloud Infrastructure
    with OpenShift and Kubernetes
    Jan Kleinert • Josh Wood
    [email protected][email protected]
    March 22, 2019

    View Slide

  2. @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

    View Slide

  3. @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

    View Slide

  4. @jankleinert / @joshixisjosh9
    Why do we need Kubernetes?
    4

    View Slide

  5. View Slide

  6. View Slide

  7. View Slide

  8. @jankleinert / @joshixisjosh9
    8
    What is Kubernetes?

    View Slide

  9. @jankleinert / @joshixisjosh9
    9
    Kubernetes is...
    An open source platform for running
    container-based workloads and
    managing them at scale

    View Slide

  10. @jankleinert / @joshixisjosh9
    10
    Kubernetes provides...
    An API
    API object primitives include these attributes:
    kind
    apiVersion
    metadata
    spec
    status

    View Slide

  11. @jankleinert / @joshixisjosh9
    11
    Basic K8s Terminology
    1. Control Plane
    2. Node
    3. Pod
    4. Deployment
    5. Service

    View Slide

  12. @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 


    View Slide

  13. @jankleinert / @joshixisjosh9
    13
    Node
    ● Node: a host machine where
    containers run
    ● Each Node runs kubelet, the K8s
    agent

    View Slide

  14. @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: {}

    View Slide

  15. @jankleinert / @joshixisjosh9
    15
    https://youtu.be/E7KWcvuFVns

    View Slide

  16. @jankleinert / @joshixisjosh9
    16
    Service
    ● Endpoint for dynamic
    group of pods
    ● Load Balances between
    them
    ● Default is exposed only
    in cluster
    kind: Service
    apiVersion: v1
    metadata:
    name: hello-k8s
    creationTimestamp:
    labels:
    run: hello-k8s
    spec:
    ports:
    - protocol: TCP
    port: 8080
    targetPort: 8080
    selector:
    run: hello-k8s
    type: LoadBalancer
    status:
    loadBalancer: {}

    View Slide

  17. @jankleinert / @joshixisjosh9
    17
    https://youtu.be/mkLNa_5w_58

    View Slide

  18. @jankleinert / @joshixisjosh9
    18
    Deployment
    ● Scale handle:
    ● scale —replicas=x
    ● Deployment is a
    group of Pods, their
    ReplicaSets
    kind: Deployment

    apiVersion: apps/v1beta1

    metadata:

    name: hello-k8s

    creationTimestamp: 

    labels:

    run: hello-k8s

    spec:

    replicas: 1

    selector:

    matchLabels:

    run: hello-k8s

    template:

    metadata:

    creationTimestamp: 

    labels:

    run: hello-k8s

    spec:

    containers:

    - name: hello-k8s

    image: jkleinert/raleigh-dogparks:v1

    resources: {}

    strategy: {}

    status: {}

    View Slide

  19. @jankleinert / @joshixisjosh9
    19
    https://youtu.be/1gjTeR4tsj0

    View Slide

  20. @jankleinert / @joshixisjosh9
    20
    https://youtu.be/V8BOQhmC30w

    View Slide

  21. @jankleinert / @joshixisjosh9
    21
    https://youtu.be/C8xAqfFaSLI

    View Slide

  22. @jankleinert / @joshixisjosh9
    22
    https://youtu.be/YEkIAWFc9WE

    View Slide

  23. @jankleinert / @joshixisjosh9
    23
    What is OpenShift?

    View Slide

  24. @jankleinert / @joshixisjosh9
    24
    Registry
    Route
    Deployment
    Configuration
    Build
    Configuration
    Persistent
    Volume Claim Ingress
    Service
    Persistent
    Volume
    Replication
    Controller*
    Pod
    Image Stream
    Kubernetes
    and OpenShift

    View Slide

  25. @jankleinert / @joshixisjosh9
    25
    Build
    Build and deploy container images

    View Slide

  26. @jankleinert / @joshixisjosh9
    26

    View Slide

  27. @jankleinert / @joshixisjosh9
    27

    View Slide

  28. @jankleinert / @joshixisjosh9
    28
    Source to Image
    Combines source repos and operationally-
    maintained builder images to produce
    application images

    View Slide

  29. @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

    View Slide

  30. @jankleinert / @joshixisjosh9
    30
    Automate
    git push to deploy

    View Slide

  31. @jankleinert / @joshixisjosh9
    31

    View Slide

  32. @jankleinert / @joshixisjosh9
    32
    Iterate

    View Slide

  33. @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:


    View Slide

  34. @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/

    View Slide

  35. @jankleinert / @joshixisjosh9
    35
    Collaborate
    Share and replicate your success

    View Slide

  36. @jankleinert / @joshixisjosh9
    36
    Service Catalog & Brokers

    View Slide

  37. @jankleinert / @joshixisjosh9
    37
    Templates as Installers
    Install a template into the current project, making it easier to reuse:
    oc create -f template.json


    View Slide

  38. @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


    View Slide

  39. @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

    View Slide

  40. @jankleinert / @joshixisjosh9
    40
    Interactive Learning Portal: https://learn.openshift.com
    Kubernetes By Example: http://kubernetesbyexample.com
    Kubernetes Docs: https://kubernetes.io
    OpenShift Docs: https://docs.openshift.com
    Resources

    View Slide

  41. THANK YOU
    plus.google.com/+RedHat
    linkedin.com/company/red-hat
    youtube.com/user/RedHatVideos
    facebook.com/redhatinc
    twitter.com/RedHat

    View Slide