Skip to content

Latest commit

 

History

History
221 lines (146 loc) · 4.5 KB

README.md

File metadata and controls

221 lines (146 loc) · 4.5 KB

Functionia

Funtionia-8

Prerequisites

  • 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

Instructions

Scene one:

Screen Shot 2022-03-24 at 15 53 36

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

Scene two:

Screen Shot 2022-03-24 at 15 53 47

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

Scene three:

Screen Shot 2022-03-24 at 15 53 56

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

Scene four:

Screen Shot 2022-03-24 at 15 53 10

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