Giter Club home page Giter Club logo

knative-workshop's Introduction

knative-workshop

This is a simple demo project to demonstrate knative-serving. If you want to follow this demo, please use a recent OpenShift 4.8+ cluster (either CodeReady Containers or SNO). And install OpenShift Serverless.

Using the Web UI

  • Install person-service helm chart
  • Click on "Make serverless"
  • Add an environment variable APP_GREETING with some nice content
  • Click on Edit Service to make the ksvc use the database:
          envFrom:
            - prefix: DB_
              secretRef:
                name: ps1-db-pguser-ps1-db
  • Demonstrate that it works now.
  • Wait a bit until it settled down

A/B Deployments

  • Go to the console
  • Deploy a new version
kn service update ksvc-ps1-deployment --image=quay.io/wpernath/person-service:v1.8.10-jvm --env APP_GREETING="We are now in JVM mode"
kn revision list
https --verify=no ....
  • Tag the two (useable) revisions
kn service update ksvc-ps1-deployment --tag=ksvc-ps1-deployment-00003=jvm
kn service update ksvc-ps1-deployment --tag=ksvc-ps1-deployment-00002=native
kn revision list
  • Now update the service to get only one or the other tag (A/B deployments)
kn service update ksvc-ps1-deployment --traffic native=100,jvm=0
kn service update ksvc-ps1-deployment --traffic native=0,jvm=100

Canary Deployments

  • The only difference to A/B is that we are going to have traffic splits between the old and the new version
kn service update ksvc-ps1-deployment --traffic native=80,jvm=20
watch -n1 http ....

Autoscaling

  • New namespace
  • Create the knative helm chart
  • Install it twice with --set deployment.tag=jvm|native
helm package knative-chart
helm install ps1-native <chart-file>
helm install ps1-jvm <chart-file> --set deployment.tag=jvm
  • Do load test with hey
hey -T application/json -c 16 -n 32000 <url>

knative-workshop's People

Contributors

wpernath 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.