{"id":21915805,"url":"https://github.com/wpernath/knative-workshop","last_synced_at":"2025-04-18T21:52:33.377Z","repository":{"id":88083987,"uuid":"480522411","full_name":"wpernath/knative-workshop","owner":"wpernath","description":"A tutorial repository to discuss benefits of serverless in a kubernertes environment","archived":false,"fork":false,"pushed_at":"2023-12-12T19:07:02.000Z","size":3671,"stargazers_count":0,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2023-12-12T20:27:18.766Z","etag":null,"topics":["helm","knative-serving","kubernetes","openshift-v4","serverless"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wpernath.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-04-11T19:27:20.000Z","updated_at":"2022-12-06T07:57:32.000Z","dependencies_parsed_at":"2023-05-18T05:00:28.068Z","dependency_job_id":null,"html_url":"https://github.com/wpernath/knative-workshop","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpernath%2Fknative-workshop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpernath%2Fknative-workshop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpernath%2Fknative-workshop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpernath%2Fknative-workshop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wpernath","download_url":"https://codeload.github.com/wpernath/knative-workshop/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226971307,"owners_count":17711413,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["helm","knative-serving","kubernetes","openshift-v4","serverless"],"created_at":"2024-11-28T19:14:20.457Z","updated_at":"2024-11-28T19:14:20.912Z","avatar_url":"https://github.com/wpernath.png","language":null,"readme":"# knative-workshop\nThis 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.\n\n## Using the Web UI\n- Install person-service helm chart\n- Click on \"Make serverless\"\n- Add an environment variable APP_GREETING with some nice content\n- Click on Edit Service to make the ksvc use the database:\n\n```YAML\n          envFrom:\n            - prefix: DB_\n              secretRef:\n                name: ps1-db-pguser-ps1-db\n```\n\n- Demonstrate that it works now. \n- Wait a bit until it settled down\n\n## A/B Deployments\n- Go to the console\n- Deploy a new version\n\n```bash\nkn service update ksvc-ps1-deployment --image=quay.io/wpernath/person-service:v1.8.10-jvm --env APP_GREETING=\"We are now in JVM mode\"\nkn revision list\nhttps --verify=no ....\n```\n\n- Tag the two (useable) revisions\n\n```bash\nkn service update ksvc-ps1-deployment --tag=ksvc-ps1-deployment-00003=jvm\nkn service update ksvc-ps1-deployment --tag=ksvc-ps1-deployment-00002=native\nkn revision list\n```\n\n- Now update the service to get only one or the other tag (A/B deployments)\n\n```bash\nkn service update ksvc-ps1-deployment --traffic native=100,jvm=0\nkn service update ksvc-ps1-deployment --traffic native=0,jvm=100\n```\n\n## Canary Deployments\n- The only difference to A/B is that we are going to have traffic splits between the old and the new version\n\n```bash\nkn service update ksvc-ps1-deployment --traffic native=80,jvm=20\nwatch -n1 http ....\n```\n\n## Autoscaling\n- New namespace\n- Create the knative helm chart\n- Install it twice with --set deployment.tag=jvm|native\n\n```bash\nhelm package knative-chart\nhelm install ps1-native \u003cchart-file\u003e\nhelm install ps1-jvm \u003cchart-file\u003e --set deployment.tag=jvm\n\n```\n- Do load test with `hey`\n\n```bash\nhey -T application/json -c 16 -n 32000 \u003curl\u003e\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwpernath%2Fknative-workshop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwpernath%2Fknative-workshop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwpernath%2Fknative-workshop/lists"}