Coder Social home page Coder Social logo

rguske / knative-serving-eventing-demo-magic Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 17 KB

This repository supports you on installing and demoing Knative's building blocks Serving and Eventing.

Shell 100.00%
kubernetes knative knative-serving knative-eventing serverless faas functions-as-a-service

knative-serving-eventing-demo-magic's Introduction

Demo-Magic Scripts to install and demo Knative's Serving and Eventing

Twitter Follow

๐Ÿ“ My Personal Blog

Hi curious visitor ๐Ÿ‘‹

Knative is the most popular platform to run Serverless workload on Kubernetes. It's two building blocks Serving and Eventing are providing a rich set of features in order to support you in running your Serverless workload as well as to build Event-Driven architectures. Implementation-details like e.g. the reactive Knative Pod Autoscaler making it possible to scale your workload from n to 0(!) and vice versa. Also, features like Revisions and Routes making deployment models like Blue/Green, Canary and Progressive available and thus providing great flexibility in shipping your code to production.

This repository provides two demo-scripts I've created to demo Knative's power in the mentioned disciplines. By cloning this repository, you will have two scripts by hand, which will install the two aforementioned building blocks to an existing Kubernetes installation plus demos for each. But don't think about a classical installation script (execute -> finish)! The idea is basically, you execute a script, it'll start typing the first command for you and stops until you execute. Therefore, you can keep focus on your presentation and continue when you are ready. I've e.g. used the scripts multiple times when presenting on Knative. I'm using the popular Demo Magic script/tool to do so.

๐Ÿ“– Table of Content

๐Ÿ’ป CLI Tools

In order not being disrupted by a missing cli tool during the script execution, install (or replace a tool withing the script) the following cli tools:

๐Ÿ”ง Preperations

Clone the repository locally and change into the new directory knative_serving_eventing_demo_script.

git clone [email protected]:rguske/knative_serving_eventing_demo_script.git && cd knative_serving_eventing_demo_script

๐Ÿท๏ธ Knative Release Versions

Open both scripts and adjust the respective release versions for the installations at the beginning of every script. You'll find the latest releases using the links below.

# adjust the versions for the serving installation (core and net-contour) in knative_serving.sh
export KN_SERVING='knative-v1.1.1'
export KN_CONTOUR='knative-v1.1.0'

# adjust the version for the eventing installation in knative_eventing.sh
export KN_EVENTING=knative-v1.0.2

Note: I've only tested both scripts successfully with the above release versions.

Note: If you like to use another networking-layer than Contour, modify the sections 04. as well as 05. in the knative_serving.sh script accordingly.

๐Ÿ›‚ Load Balancer required

Because I'm using Tanzu Kubernetes Grid as a Kubernetes runtime, load balancing services is not a topic I have to worry about. Therefore, section 05. in the knative_serving.sh script is expecting that a load balancer will assign an IP address automatically to the Envoy Proxy (kubectl get service envoy -n contour-external --output 'jsonpath={.status.loadBalancer.ingress[0].ip}').

โœจ Knative Magic locally on a KinD Cluster

If you don't have a Kubernetes playground available, check out Knative on Kind (KonK).

You are a Fusion or Workstation user? Check out vctl to easliy instantiate a KinD cluster locally ๐Ÿ‘€ ๐Ÿ‘‰ A closer look at VMware's Project Nautilus

โญ Eventing Demo vSphere-Tag

In order to provide a great Event-Driven-Architecture (EDA) experience on vSphere, the knative_eventing.sh script will install the VMware Event Router using helm, to connect to the vCenter Server event-stream (vCenter = event provider) and to provide the stream to a broker. For the deployment of the Event-Router, it's important that you enter your vCenter parameters in section 06. of the knative_eventing.sh script.

Section 06:

cat << EOF > override.yaml
eventrouter:
  config:
    logLevel: info
  vcenter:
    address: https://<vcenter-server-address> # FQDN or IP
    username: [email protected] # enter your read-only user
    password: 'VMware1!' # enter your super secret password
    insecure: true # specify if the connection is insecure or not
  eventProcessor: knative
  knative:
    destination:
      ref:
        apiVersion: eventing.knative.dev/v1
        kind: Broker
        name: default
        namespace: vmware-functions
EOF

Also, an example function from the official VEBA (VMware Event Broker Appliance) repository will be used for the eventing demo. It will apply a specified vSphere Tag to a Virtual Machine after it was powered on (DrsVmPoweredOnEvent).

Adjust the values in the tag_secret.json file accordingly before starting the knative_eventing.sh script.

Note: Of course the vSphere Tag must also exist before you start the script ๐Ÿ˜‰

{
  // vCenter Server address (FQDN or IP)
  "VCENTER_SERVER": "FILL-ME-IN",
  //User with the right persmissions to apply a vSphere Tag
  "VCENTER_USERNAME" : "FILL-ME-IN",
  // Users password
  "VCENTER_PASSWORD" : "FILL-ME-IN",
  // vSphere Tag name
  "VCENTER_TAG_NAME" : "FILL-ME-IN",
  // Possible values are Fail, Ignore or Warn
  "VCENTER_CERTIFICATE_ACTION" : "FILL-ME-IN"
}

๐Ÿš€ Execute a Script

Simply start a script by executing e.g. ./knative_serving.sh on your terminal and confirm the execution of each printed command. I recommend using tmux and watch (e.g. watch kubectl get pods -A) or helpful tools like k9s or Octant to follow the installations on another terminal window.

Have Fun!

knative-serving-eventing-demo-magic's People

Contributors

rguske avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.