- Quay.io account
- Quay.io repository and a robot account created in it.
stern
tool installed.- A Strimzi cluster
- Serverless Operator and Serving, Eventing, KnativeKafka enabled.
- Bitmine courier deployed:
cd bitmine-courier && ./mvnw clean package -Dquarkus.kubernetes.deploy=true
Create a project namespace.
oc new-project functionia
Create a AMQ Streams / Strimzi cluster inside (Please first enable the AMQ Streams Operator)
You can use Strimzi CLI to create one easily (or you can use the operator resources to create one).
kfk clusters --create --cluster my-cluster -n functionia
Create Quarkers miner clan function.
kn func create -l quarkus -t cloudevents quarkers-mining-service
Do the editings in the function.
Build and deploy function.
cd quarkers-mining-service
kn func deploy --build
Update the function service.
kn service update quarkers-mining-service --concurrency-target=1
Call bitmine-courier with curl with 10 mine requests.
curl -XGET http://bitmine-courier-functionia.apps-crc.testing/10
Checkout the pod count and logs.
stern -n functionia -c user-container quarkers-mining-service
Delete quarkers-kafka-source.
kn source kafka delete quarkers-kafka-source
Create Noders miner clan function.
kn func create -l node -t cloudevents noders-mining-service
Do the editings in the function. Build and deploy function.
cd noders-mining-service && kn func deploy --build
Update the function service.
kn service update noders-mining-service --concurrency-target=1
Create the kafka channel. Create the quarkers subscription. Create the noders subscription.
Edit bitmine-courier to produce to channel topic.
oc set env dc/bitmine-courier TOPIC=knative-messaging-kafka.functionia.kafka-channel
oc rollout latest dc/bitmine-courier
Call bitmine-courier with curl with 50 mine requests.
curl -XGET http://bitmine-courier-functionia.apps-crc.testing/50
Checkout the pod count and logs.
stern -n functionia -c user-container quarkers-mining-service
stern -n functionia -c user-container noders-mining-service
Delete the Kafka channel.
oc delete -f resources/2-channel-subscription/kafka-channel.yaml
Create the broker.
oc apply -f resources/3-broker-trigger/functionia-broker.yaml
Create triggers for clans.
oc apply -f resources/3-broker-trigger/quarkers-trigger.yaml
oc apply -f resources/3-broker-trigger/noders-trigger.yaml
Edit bitmine-courier to produce to channel topic.
oc set env dc/bitmine-courier TOPIC=knative-broker-functionia-kafka-broker
oc rollout latest dc/bitmine-courier
Checkout the pod count and logs.
stern -n functionia -c user-container quarkers-mining-service
stern -n functionia -c user-container noders-mining-service
Tag Noders service as noders
.
kn service update noders-mining-service --tag=noders-mining-service-00002=noders
Edit the NodeJS function and build/deploy it.
kn func deploy --build
Tag the new version as wakanda
.
kn service update noders-mining-service --tag=noders-mining-service-00003=wakanda
Split the traffic as requested.
kn service update noders-mining-service --traffic noders=80,wakanda=20
Checkout the traffic status.
kn revision list
Checkout the distribution and logs.
stern -n functionia -c user-container quarkers-mining-service
stern -n functionia -c user-container noders-mining-service