Skip to content

Instantly share code, notes, and snippets.

View ricardozanini's full-sized avatar
🏠
Working from home

Ricardo Zanini ricardozanini

🏠
Working from home
View GitHub Profile
$ curl -X POST -H 'Content-Type:application/json' -H 'Accept:application/json' -d '{"person" : {"name" : "john", "age" : 20}}' http://kogito-example.com/persons
# You should see a response like this:
{"id":"90fab845-ae55-4118-b808-8c301c3060a5","person":{"name":"john","age":20,"adult":true}}
$ cat <<EOF | kubectl -n kogito apply -f -
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: process-business-rules-quarkus
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- host: kogito-example.com
$ kubectl -n kogito get kogitoruntime
NAME REPLICAS IMAGE
process-business-rules-quarkus 1 quay.io/<your-quay-namespace>/process-business-rules-quarkus:latest
$ cat <<EOF | kubectl -n kogito apply -f -
apiVersion: app.kiegroup.org/v1beta1
kind: KogitoRuntime
metadata:
name: process-business-rules-quarkus
spec:
replicas: 1
image: quay.io/<your-quay-namespace>/process-business-rules-quarkus:latest
EOF
$ kubectl -n kogito get pods
NAME READY STATUS RESTARTS AGE
kogito-operator-6954f4cdd9-ml87h 1/1 Running 0 74s
NAMESPACE=kogito
VERSION=<current_operator_version>
kubectl apply -n "${NAMESPACE}" -f "https://github.com/kiegroup/kogito-cloud-operator/releases/download/${VERSION}/kogito-operator.yaml"
FROM quay.io/kiegroup/kogito-quarkus-jvm-ubi8:latest
COPY target/*-runner.jar $KOGITO_HOME/bin
COPY target/lib $KOGITO_HOME/bin/lib
curl -X POST -H 'Content-Type:application/json' -H 'Accept:application/json' -d '{"person" : {"name" : "john", "age" : 20}}' http://localhost:8080/persons
# The response should be something like:
# {"id":"90fab845-ae55-4118-b808-8c301c3060a5","person":{"name":"john","age":20,"adult":true}}
@ricardozanini
ricardozanini / run-maven.sh
Last active May 21, 2024 18:30
Deploying a custom Kogito service on Kubernetes (blog resources)
git clone git@github.com:kiegroup/kogito-examples.git
cd kogito-examples/process-business-rules-quarkus
mvn clean package quarkus:dev
@ricardozanini
ricardozanini / management-console.yaml
Created July 24, 2020 19:17
Management Console example with Data Index URL
apiVersion: app.kiegroup.org/v1alpha1
kind: KogitoMgmtConsole
metadata:
name: management-console
spec:
replicas: 1
image:
tag: "0.12"
# we use environment variables to set the external data index URL
# this is needed for now since Management Console is a client application, we are working on having a local proxy to