This is step by step instruction for demonstrating Canary Deployment with knative. Application in this demo is using my custom apps on Quay, consume Kafka Topik and stream to REST API.
- Install OpenShift Serveless or knative using operator
- Install knative (kn) CLI
$ oc login
$ oc project my-project
$ kn service create quarkus-kafka-consumer \
--image quay.io/efeluzy/quarkus-kafka-consumer:v3 \
--revision-name quarkus-kafka-consumer-v3 \
kn service update quarkus-kafka-consumer \
--image quay.io/efeluzy/quarkus-kafka-consumer:latest \
--revision-name quarkus-kafka-consumer-v4
--traffic quarkus-kafka-consumer-v4=50 \
--traffic quarkus-kafka-consumer-v3=50 \
Using knative CLI
$ kn revision list
choose revision
$ kn service update quarkus-kafka-consumer --traffic quarkus-kafka-consumer-abcd=10 --traffic quarkus-kafka-consumer-vwxyz=90
or using Openshift web console:
Note:
- quarkus-kafka-consumer-vwxyz is previous service revision tag name.
- new service will serve 10%, previous service will serve 90%
$ kn service describe quarkus-kafka-consumer
Result
Name: quarkus-kafka-consumer
Namespace: erfin-serverless-demo
Labels: app.kubernetes.io/component=quarkus-kafka-consumer, app.kubernetes.io/instance=quarkus-k ...
Annotations: openshift.io/generated-by=OpenShiftWebConsole
Age: 7h
URL: http://quarkus-kafka-consumer-erfin-serverless-demo.apps.erfin-cluster.sandbox1459.opentlc.com
Revisions:
50% quarkus-kafka-consumer-tmjzr-3 (current @latest) #v3 [3] (12m)
Image: quay.io/efeluzy/quarkus-kafka-consumer:latest (at 09d28f)
50% quarkus-kafka-consumer-mjmr9 #latest [1] (7h)
Image: image-registry.openshift-image-registry.svc:5000/erfin-serverless-demo/quarkus-kafka-consumer:v3 (at 09d28f)
Conditions:
OK TYPE AGE REASON
++ Ready 10m
++ ConfigurationsReady 12m
++ RoutesReady 10m