This configurable-rules version of Drools CloudEvents Operator. You can change the rules under config-rules
directory and restart the container to apply the new rules.
- [Term 1]
minikube start --mount --mount-string="$(pwd)/config-rules:/mnt/data"
- [Term 1]
minikube addons enable ingress
- [Term 1]
kubectl apply -f ./config/exposedapps.halkyon.io-v1.crd.yml
- [Term 1]
kubectl apply -f ./config/config-rules-pv-pvc.yml
- [Term 2]
mvn clean package
- [Term 2]
java -jar target/quarkus-app/quarkus-run.jar
- [Term 1]
kubectl apply -f ./config/drools-cloudevents-configurable-rules.yml
- Wait until [Term 2] prints
App drools-cloudevents-configurable-rules is exposed and ready to be used at https://192.168.x.x
It may take around 15 seconds. - [Term 1]
Note that you need to replace the IP address with the one in the previous step. Also use
curl -k https://192.168.x.x/drools/evaluate \ -H "Ce-Specversion: 1.0" \ -H "Ce-Type: fact.Measurement" \ -H "Ce-Source: io.cloudevents.examples/user" \ -H "Ce-Id: 536808d3-88be-4077-9d7a-a3f162705f78" \ -H "Content-Type: application/json" \ -H "Ce-Subject: SUBJ-0001" \ -d '{"id":"color","val":"red"}'
-k
option to ignore the self-signed certificate. - You should get a response which comes from the configured rules:
{"configured rule by operator result":"red!!"}
minikube start --mount --mount-string="$(pwd)/config-rules:/mnt/data"
minikube addons enable ingress
kubectl apply -f drools-cloudevents-configurable-rules-operator-deployment.yaml
- Wait until drools-cloudevents-configurable-rules-operator is Running (
kubectl get pods -w
). kubectl apply -f ./config/config-rules-pv-pvc.yml
kubectl apply -f ./config/drools-cloudevents-configurable-rules.yml
kubectl logs <drools-cloudevents-configurable-rules-operator pod name> -f
- Wait until the log prints
App drools-cloudevents-configurable-rules is exposed and ready to be used at https://192.168.x.x
It may take around 30 seconds. -
Note that you need to replace the IP address with the one in the previous step. Also use
curl -k https://192.168.x.x/drools/evaluate \ -H "Ce-Specversion: 1.0" \ -H "Ce-Type: fact.Measurement" \ -H "Ce-Source: io.cloudevents.examples/user" \ -H "Ce-Id: 536808d3-88be-4077-9d7a-a3f162705f78" \ -H "Content-Type: application/json" \ -H "Ce-Subject: SUBJ-0001" \ -d '{"id":"color","val":"red"}'
-k
option to ignore the self-signed certificate. - You should get a response which comes from the configured rules:
{"configured rule by operator result":"red!!"}
- You can scale the pod by
kubectl scale deployment drools-cloudevents-configurable-rules --replicas=3
- Make user can run podman without sudo:
sudo visudo
minikube start --driver=podman --container-runtime=cri-o --mount --mount-string="$(pwd)/config-rules:/mnt/data" ; minikube addons enable ingress
eval $(minikube -p minikube podman-env)
... same as docker