https://github.com/wpernath/knative-workshop
A tutorial repository to discuss benefits of serverless in a kubernertes environment
https://github.com/wpernath/knative-workshop
helm knative-serving kubernetes openshift-v4 serverless
Last synced: 22 days ago
JSON representation
A tutorial repository to discuss benefits of serverless in a kubernertes environment
- Host: GitHub
- URL: https://github.com/wpernath/knative-workshop
- Owner: wpernath
- Created: 2022-04-11T19:27:20.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-12T19:07:02.000Z (over 1 year ago)
- Last Synced: 2023-12-12T20:27:18.766Z (over 1 year ago)
- Topics: helm, knative-serving, kubernetes, openshift-v4, serverless
- Homepage:
- Size: 3.5 MB
- Stars: 0
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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:```YAML
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```bash
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
```bash
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)
```bash
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```bash
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```bash
helm package knative-chart
helm install ps1-native
helm install ps1-jvm --set deployment.tag=jvm```
- Do load test with `hey````bash
hey -T application/json -c 16 -n 32000
```