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

Functionia: An event-driven adventure in the serverless metaverse with OpenShift Serverless

Functionia: An event-driven adventure in the serverless metaverse with OpenShift Serverless

Aykut Bulgu

April 14, 2022
Tweet

More Decks by Aykut Bulgu

Other Decks in Technology

Transcript

  1. CONFIDENTIAL designator
    V0000000
    An event-driven adventure in the serverless
    metaverse with OpenShift Serverless
    Functionia
    Aykut Bulgu
    Senior Content Architect
    1

    View Slide

  2. CONFIDENTIAL designator
    V0000000
    Me as Code
    2
    #oc apply -f aykutbulgu.yaml
    apiVersion: redhat/v3.8
    kind: Senior Content Architect
    metadata:
    name: Aykut Bulgu
    namespace: Red Hat Global Learning Services
    annotations:
    twitter: @systemcraftsman
    email:
    - [email protected]
    - [email protected]
    organizer: Software Craftsmanship Turkey
    founder: System Craftsman
    labels:
    married: yes
    children: 1
    interests:
    - tech (mostly kafka)
    - aikido
    - gamification
    - stoicism
    spec:
    replicas: 1
    containers:
    - image: aykut:latest

    View Slide

  3. CONFIDENTIAL designator
    V0000000
    What do we have in the webinar?
    3
    ➔ Traditional long-running application architecture and its drawbacks.
    ➔ OpenShift Serverless Serving and creating functions.
    ➔ OpenShift Serverless Eventing and how it solves problems by:
    ◆ Reducing the coupling between services.
    ◆ Providing autoscale and scale-to-zero capabilities to the applications.
    ➔ Building blocks for eventing like source, channel, subscription, sink, and more.
    ➔ CloudEvents usage in an OpenShift Serverless Eventing architecture.

    View Slide

  4. CONFIDENTIAL designator
    V0000000
    Functionia: The serverless metaverse
    4

    View Slide

  5. CONFIDENTIAL designator
    V0000000
    Functionia: The serverless metaverse
    5

    View Slide

  6. CONFIDENTIAL designator
    V0000000
    Meet OSVR-4
    6
    Hello. I am OSVR-4.
    I will help you through your journey
    in Functionia.

    View Slide

  7. CONFIDENTIAL designator
    V0000000
    The Problem
    7

    View Slide

  8. CONFIDENTIAL designator
    V0000000
    Functionia: The serverless metaverse
    8
    ➔ Miner clans do bitmining in a daily basis.
    ➔ Sometimes no bitmining is done.
    ◆ No economical bitmining architecture
    ◆ Resources are used for nothing
    ➔ Code bases of miner apps are too complex.
    ◆ There are more than one technology as
    there are more than one clan.
    ◆ Harder development life-cycle.
    ➔ In case of failures in the miner clans, there is
    no retry mechanism. All processes are
    synchronous.
    ➔ Quakers miner clan face a lot of issues like
    these recently.

    View Slide

  9. CONFIDENTIAL designator
    V0000000
    Functionia: The serverless metaverse
    9
    I have a solution for you:
    Openshift Serverless!

    View Slide

  10. CONFIDENTIAL designator
    V0000000
    OpenShift Serverless
    10

    View Slide

  11. CONFIDENTIAL designator
    V0000000
    OpenShift Serverless
    11
    OpenShift Serverless
    ➔ Deploy and run serverless containers
    ➔ Use any programming language or runtime
    ➔ Modernize existing applications to run
    serverless
    ➔ Powered by a rich ecosystem of event
    sources
    ➔ Manage serverless apps natively in
    Kubernetes
    ➔ Based on open source project Knative
    ➔ Run anywhere OpenShift runs
    OPENSHIFT
    OpenShift Serverless
    SERVING EVENTING
    Red Hat Enterprise Linux CoreOS
    Physical Virtual Private cloud Public cloud
    Applications Events
    F

    View Slide

  12. CONFIDENTIAL designator
    V0000000
    OpenShift Serverless
    12
    Immutable revisions
    Deploy new features performing
    canary, A/B or blue-green testing
    with gradual traffic rollout with no
    sweat and following best practices.
    Any programming language
    Use any programming language or
    runtime of choice. From Java,
    Python, Go and JavaScript to
    Quarkus, SpringBoot or Node.js.
    No need to configure number of
    replicas, or idling. Scale to zero when
    not in use, auto scale to thousands
    during peak, with built-in reliability
    and fault-tolerance.
    Automatic scaling
    Use a simplified developer
    experience to deploy and run
    serverless containers abstracting
    infrastructure & focusing what
    matters.
    Containers made easy
    prem
    aws
    Ready for the Hybrid Cloud
    True portable serverless running
    anywhere OpenShift runs, that is on
    premise or on any cloud. Leverage
    data locality and SaaS when needed.
    azure
    Event Driven Architecture
    Build loosely coupled & distributed
    apps connecting with a variety of
    built-in or third-party event sources
    connectors powered by Operators.

    View Slide

  13. CONFIDENTIAL designator
    V0000000
    OpenShift Serverless
    13

    View Slide

  14. CONFIDENTIAL designator
    V0000000
    OpenShift Serverless
    14
    But how is it supposed
    to help us?

    View Slide

  15. CONFIDENTIAL designator
    V0000000
    OpenShift Serverless
    15
    SERVING
    An event-driven model that serves the
    container with your application and can
    "scale to zero".
    Common infrastructure for consuming and
    producing events that will stimulate
    applications.
    EVENTING
    ➔ Autoscaling with scale-to-zero
    ➔ Advanced networking
    ➔ Immutable revisions
    ➔ Traffic splitting
    ➔ Knative Service
    ➔ Functions
    ➔ Serverless workloads with event-driven
    architecture
    ➔ Source
    ◆ Kafka Source
    ➔ Channel
    ◆ Kafka Channel
    ➔ Subscription
    ➔ Broker
    ➔ Trigger

    View Slide

  16. CONFIDENTIAL designator
    V0000000
    OpenShift Serverless
    16
    apiVersion: apps/v1
    kind: Deployment
    metadata:
    name: frontend
    labels:
    app: guestbook
    spec:
    selector:
    matchLabels:
    app: guestbook
    tier: frontend
    replicas: 1
    template:
    metadata:
    labels:
    app: guestbook
    tier: frontend
    spec:
    containers:
    - image: markusthoemmes/guestbook
    name: guestbook
    resources:
    requests:
    cpu: 100m
    memory: 100Mi
    env:
    - name: GET_HOSTS_FROM
    value: dns
    ports:
    - containerPort: 80
    apiVersion: serving.knative.dev/v1alpha1
    kind: Service
    metadata:
    name: frontend
    spec:
    template:
    metadata:
    labels:
    app: guestbook
    tier: frontend
    spec:
    containers:
    - image: markusthoemmes/guestbook
    resources:
    requests:
    cpu: 100m
    memory: 100Mi
    env:
    - name: GET_HOSTS_FROM
    value: dns
    ports:
    - containerPort: 80
    ---
    apiVersion: v1
    kind: Service
    metadata:
    name: frontend-service
    labels:
    app: guestbook
    tier: frontend
    spec:
    ports:
    - port: 80
    selector:
    app: guestbook
    tier: frontend
    ---
    apiVersion: route.openshift.io/v1
    kind: Route
    metadata:
    name: frontend-route
    spec:
    to:
    kind: Service
    name: frontend-service
    OpenShift OpenShift Serverless
    apiVersion: extensions/v1beta1
    kind: HorizontalPodAutoscaler
    metadata:
    name: guestbook
    namespace: default
    spec:
    scaleRef:
    kind: ReplicationController
    name: guestbook
    namespace: default
    subresource: scale
    minReplicas: 1
    maxReplicas: 10
    cpuUtilization:
    targetPercentage: 50
    22 lines
    ~70 lines

    View Slide

  17. CONFIDENTIAL designator
    V0000000
    OpenShift Serverless
    17
    Service Microservice Function
    > Single Purpose
    > Stateless
    > Independently Scalable
    > Automated
    > Single Action
    > Ephemeral
    > Autonomous
    > Loosely-coupled
    f( )

    View Slide

  18. CONFIDENTIAL designator
    V0000000
    OpenShift Serverless
    18
    So let’s roll up our sleeves and
    start the implementation!

    View Slide

  19. CONFIDENTIAL designator
    V0000000
    Source to Sink
    19
    Quakers Knative
    Service (ksvc)

    View Slide

  20. CONFIDENTIAL designator
    V0000000
    Source to Sink
    21
    This is great!
    Thank you.

    View Slide

  21. CONFIDENTIAL designator
    V0000000
    Source to Sink
    22
    Oh, but we have the
    Noders clan too.
    Hi!

    View Slide

  22. CONFIDENTIAL designator
    V0000000
    Channel and Subscriptions
    23
    What about using a Channel
    and Subscriptions?

    View Slide

  23. CONFIDENTIAL designator
    V0000000
    Channel and Subscriptions
    24
    Quakers Knative
    Service (ksvc)
    Noders Knative
    Service (ksvc)

    View Slide

  24. CONFIDENTIAL designator
    V0000000
    Channel and Subscriptions
    26

    View Slide

  25. CONFIDENTIAL designator
    V0000000
    Channel and Subscriptions
    27
    Well, I can
    help.
    We’ll use a
    Broker and
    Triggers.
    But we have
    wrong tags.

    View Slide

  26. CONFIDENTIAL designator
    V0000000
    Brokers and Triggers
    28
    Quakers Knative
    Service (ksvc)
    Noders Knative
    Service (ksvc)

    View Slide

  27. CONFIDENTIAL designator
    V0000000
    Brokers and Triggers
    30

    View Slide

  28. CONFIDENTIAL designator
    V0000000
    Traffic Distribution
    31
    Noders keep
    Noders clan should keep 80% of
    Vibranium.
    To Wakanda
    20% of the Vibranium should be sent
    to Wakanda.
    80% 20%

    View Slide

  29. CONFIDENTIAL designator
    V0000000
    Traffic Distribution
    32
    Ok. Let’s do some
    traffic distribution!

    View Slide

  30. CONFIDENTIAL designator
    V0000000
    The End
    34

    View Slide

  31. CONFIDENTIAL designator
    V0000000
    Resources
    35
    https://bit.ly/rh-functionia

    View Slide

  32. CONFIDENTIAL designator
    V0000000
    linkedin.com/company/red-hat
    youtube.com/user/RedHatVideos
    facebook.com/redhatinc
    twitter.com/RedHat
    36
    Red Hat is the world’s leading provider of enterprise
    open source software solutions. Award-winning
    support, training, and consulting services make
    Red Hat a trusted adviser to the Fortune 500.
    Thank you

    View Slide