rhkp opened a new issue, #1785:
URL: https://github.com/apache/incubator-kie-kogito-images/issues/1785
The Data Index(DI)/ Jobs Service(JS) Database(DB) migration image can be
used by Kubernetes/OpenShift job to perform necessary database changes for
DI/JS application, before they are started with SonataFlowPlatform.
An example could be along this line, assuming Postgres database is up and
running on the cluster
Kubernetes DB Migration Job
```
apiVersion: batch/v1
kind: Job
metadata:
name: flyway-image-job
spec:
template:
spec:
containers:
- name: flyway-image
image: quay.io/rhkp/flyway-image:latest
command: ["./migration.sh"]
args:
- "jdbc:postgresql://postgres:5432/sonataflow"
- "$(db_username)"
- "$(db_password)"
env:
- name: db_username
valueFrom:
secretKeyRef:
name: postgres-secrets
key: POSTGRES_USER
- name: db_password
valueFrom:
secretKeyRef:
name: postgres-secrets
key: POSTGRES_PASSWORD
restartPolicy: Never
backoffLimit: 4
```
SonataFlowPlatform Deploying DI/JS Applications
```
apiVersion: sonataflow.org/v1alpha08
kind: SonataFlowPlatform
metadata:
name: sonataflow-platform
spec:
build:
config:
strategyOptions:
KanikoBuildCacheEnabled: "true"
services:
dataIndex:
enabled: true
persistence:
migrateDBOnStartUp: false
postgresql:
jdbcUrl:
jdbc:postgresql://postgres:5432/sonataflow?currentSchema=data-index-service
secretRef:
name: postgres-secrets
userKey: POSTGRES_USER
passwordKey: POSTGRES_PASSWORD
podTemplate:
replicas: 1
container:
initContainers:
- name: di-init-hello
image: busybox:1.28
command: ['sh', '-c', 'echo The DI will be deployed!']
- name: init-postgres
image: registry.access.redhat.com/ubi9/ubi-minimal:latest
imagePullPolicy: IfNotPresent
command: [ 'sh', '-c', 'until (echo 1 > /dev/tcp/postgres.$(cat
/var/run/secrets/kubernetes.io/serviceaccount/namespace).svc.cluster.local/5432)
>/dev/null 2>&1; do echo "Waiting for postgres server"; sleep 3; done;' ]
jobService:
enabled: true
persistence:
migrateDBOnStartUp: false
postgresql:
jdbcUrl:
jdbc:postgresql://postgres:5432/sonataflow?currentSchema=jobs-service
secretRef:
name: postgres-secrets
userKey: POSTGRES_USER
passwordKey: POSTGRES_PASSWORD
podTemplate:
container:
initContainers:
- name: js-init-hello
image: busybox:1.28
command: ['sh', '-c', 'echo The JS will be deployed!']
- name: init-postgres
image: registry.access.redhat.com/ubi9/ubi-minimal:latest
imagePullPolicy: IfNotPresent
command: [ 'sh', '-c', 'until (echo 1 > /dev/tcp/postgres.$(cat
/var/run/secrets/kubernetes.io/serviceaccount/namespace).svc.cluster.local/5432)
>/dev/null 2>&1; do echo "Waiting for postgres server"; sleep 3; done;' ]
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]