https://github.com/rgolangh/sonataflow-argocd-app
https://github.com/rgolangh/sonataflow-argocd-app
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/rgolangh/sonataflow-argocd-app
- Owner: rgolangh
- Created: 2023-08-10T18:04:05.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-26T13:50:14.000Z (over 1 year ago)
- Last Synced: 2024-12-28T02:29:50.654Z (5 months ago)
- Size: 26.4 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This repo demonstrates maintaing multi serverless workflow definitions, using kustomize and possibly adding argocd
## Structure:
```
kustomiztion.yaml // the base kustomization yaml
flow-x: // per-flow directory
sonataflow.yaml // sonataflow CR
configMap.yaml // the sonataflow's configMap (the target quarkus application.properties)
specs/ // specs dirs for openapi specs
svc-openapi.yaml // some service's open-api spec
kustomization.yaml // per-flow kustomization
```## Prerequisites
A k8s cluster, I used kind with podman.
And sonata serverless operator:
```
kubectl create -f https://raw.githubusercontent.com/kiegroup/kogito-serverless-operator/v1.42.0/operator.yaml
```## From git to deployed workflows
* **Namespace:**
Create the 'workflows' namespace:
```
kubectl create namespace workflows
```* **Kustomize usage:**
Run kustomize to get all the manifests:
```
kustomize build .
```Deploy using kustomize only:
```
kustomize build . | kubectl apply -f - --namespace workflows
```* **Argocd Usage:**
Alternatively use argocd application for a more managed approach:
```
argocd app create workflows --repo https://github.com/rgolangh/sonataflow-argocd-app --path ./ --dest-server https://kubernetes.default.svc --dest-namespace workflowsargocd app sync workflows
```* **Automated Sync:**
To avoid manual syncs, tweak the app sync policy:
```
argocd app set workflows --sync-policy automated
```* **Invoke a workflow:**
Expose the flows to interact with them incase you deploy on `kind` or any other luster lacking ingress capability:
```
kubectl port-forward -n workflows svc/mta 8080:80 &curl localhost:8080/mta -d '{"foo":"bar"}' -H "Content-Type: application/json"
```