https://github.com/systemcraftsman/functionia-serverless-demo
https://github.com/systemcraftsman/functionia-serverless-demo
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/systemcraftsman/functionia-serverless-demo
- Owner: SystemCraftsman
- Created: 2022-03-08T20:26:14.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-03-22T00:08:59.000Z (about 4 years ago)
- Last Synced: 2025-02-24T00:29:15.295Z (over 1 year ago)
- Language: Java
- Size: 175 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Functionia

## 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:
```shell
cd bitmine-courier && ./mvnw clean package -Dquarkus.kubernetes.deploy=true
```
## Instructions
### Scene one:
Create quarkers miner clan function.
```shell
kn func create -l quarkus -t cloudevents quarkers-mining-service
```
Do the editings in the function.
Build and deploy function.
```shell
cd quarkers-mining-service
kn func deploy --build
```
Update the function service.
```shell
kn service update quarkers-mining-service --concurrency-target=1
```
Call bitmine-courier with curl with 10 mine requests.
```shell
curl -XGET http://bitmine-courier-functionia.apps-crc.testing/10
```
Checkout the pod count and logs.
```shell
stern -n functionia -c user-container quarkers-mining-service
```
### Scene two:
Delete quarkers-kafka-source.
```shell
kn source kafka delete quarkers-kafka-source
```
```shell
kn func create -l node -t cloudevents noders-mining-service
```
Do the editings in the function.
Build and deploy function.
```shell
cd noders-mining-service && kn func deploy --build
```
Update the function service.
```shell
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.
```shell
oc set env dc/bitmine-courier TOPIC=knative-messaging-kafka.functionia.kafka-channel
```
```shell
oc rollout latest dc/bitmine-courier
```
Call bitmine-courier with curl with 50 mine requests.
```shell
curl -XGET http://bitmine-courier-functionia.apps-crc.testing/50
```
Checkout the pod count and logs.
```shell
stern -n functionia -c user-container quarkers-mining-service
```
```shell
stern -n functionia -c user-container noders-mining-service
```
### Scene three:
Delete the Kafka channel.
```shell
oc delete -f resources/2-channel-subscription/kafka-channel.yaml
```
Create the broker.
```shell
oc apply -f resources/3-broker-trigger/functionia-broker.yaml
```
Create triggers for clans.
```shell
oc apply -f resources/3-broker-trigger/quarkers-trigger.yaml
```
```shell
oc apply -f resources/3-broker-trigger/noders-trigger.yaml
```
Edit bitmine-courier to produce to channel topic.
```shell
oc set env dc/bitmine-courier TOPIC=knative-broker-functionia-kafka-broker
```
```shell
oc rollout latest dc/bitmine-courier
```
### Scene four:
```shell
kn service update noders-mining-service --tag=noders-mining-service-00002=noders
```
```shell
kn func deploy --build
```
```shell
kn service update noders-mining-service --tag=noders-mining-service-00003=wakanda
```
```shell
kn service update noders-mining-service --traffic noders=80,wakanda=20
```