Skip to content

Commit

Permalink
Remove Infinispan from ocp-tryout
Browse files Browse the repository at this point in the history
Signed-off-by: Ricardo Zanini <zanini@redhat.com>
  • Loading branch information
ricardozanini committed May 23, 2024
1 parent ea75e48 commit ec0557a
Show file tree
Hide file tree
Showing 12 changed files with 147 additions and 98 deletions.
46 changes: 25 additions & 21 deletions kogito-quarkus-examples/ocp-tryout/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Make sure you meet the [prerequisites](#prerequisites) and then start [here](#in

### Available Infrastructure
- Persistence:
- infinispan/server:14.0.4.Final via helm chart
- PostgreSQL via helm chart
- Messaging:
- bitnami/kafka:2.8.1-debian-10-r31 via helm chart
- Authorization/Authentication:
Expand Down Expand Up @@ -49,8 +49,8 @@ Installation from pre-build images
```
# example
image:
repository: docker.io/apache/incubator-kie-examples-travels
tag: 1.16.0.final
repository: quay.io/<your namespace>/kogito-examples-travels
tag: 10.0.0.final
applicationPort: 8080
```
- `./testapp/protobuf`: For each Kogito application to be installed add its protobuf files under the `protobuf` folder. Protobuf files for the Kogito examples can be found under folder `target/classes/META-INF/resources/persistence/protobuf`.
Expand All @@ -74,9 +74,13 @@ All configuration required to make those connections as well as initializations
- `keycloak.admin.password` - the administration consoles' users' password
- `keycloak.realm.json` - Keycloak initialization file for the Kogito realm creating clients, users, etc. used in Kogito examples
- `keycloak.db.vendor` - Keycloak persistence
### Infinispan Configurations
- `quarkus.infinispan.client.hosts` - the infinispan url used by the Kogito application; can be internal service url
- `quarkus.infinispan.client.username` - the user used by the Kogito application to access the infinispan service
#### PostgreSQL Configurations
- `kogito.persistence.type`
- `quarkus.datasource.db-kind`
- `quarkus.datasource.username`
- `quarkus.datasource.password`
- `quarkus.datasource.jdbc.url`
- `quarkus.datasource.reactive.url`
### Kafka Configurations
- `kafka.bootstrap.servers` - the kafka url used by the Kogito application; can be internal service url
### Kogito Dataindex Configurations
Expand All @@ -97,19 +101,19 @@ All configuration required to make those connections as well as initializations
### Memory and cpu requests and limits
if marked `-` then namespace defaults are applied
|deployment|request cpu|request mem|limit cpu|limit mem|
|---|---|---|---|---|
|**namespace default per deployment/statefulSet**|10m|64Mi|1|750Mi|
|keycloak|-|-|-|-|
|kogito-data-index-infinispan|-|-|-|500Mi|
|kogito-management-console|-|-|-|500Mi|
|kogito-task-console|-|-|-|500Mi|
|kogito-jobs-service|-|-|-|500Mi|
|kogito-travel-agency-travels-jvm|-|-|-|500Mi|
|kogito-travel-agency-visas-jvm|-|-|-|500Mi|
|infinispan|500m|512Mi|500m|512Mi|
|kafka|-|-|-|-|
|kafka-zookeeper|250m|256Mi|-|-|
|**sum**|-|-|-|6512Mi|
|**sandbox max. aggregate values per user name (both namespaces)**|1750m|7Gi|20000m|7Gi|
| deployment |request cpu|request mem|limit cpu|limit mem|
|-------------------------------------------------------------------|---|---|---|---|
| **namespace default per deployment/statefulSet** |10m|64Mi|1|750Mi|
| keycloak |-|-|-|-|
| kogito-data-index-postgresql |-|-|-|500Mi|
| kogito-management-console |-|-|-|500Mi|
| kogito-task-console |-|-|-|500Mi|
| kogito-jobs-service |-|-|-|500Mi|
| kogito-travel-agency-travels-jvm |-|-|-|500Mi|
| kogito-travel-agency-visas-jvm |-|-|-|500Mi|
| postgresql |500m|512Mi|500m|512Mi|
| kafka |-|-|-|-|
| kafka-zookeeper |250m|256Mi|-|-|
| **sum** |-|-|-|6512Mi|
| **sandbox max. aggregate values per user name (both namespaces)** |1750m|7Gi|20000m|7Gi|
2 changes: 1 addition & 1 deletion kogito-quarkus-examples/ocp-tryout/installer.properties
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ OCP_PROJECT=
# or to N or leave empty, if does not need to be installed
INSTALL_ALL=Y
SHARED_CONFIG=N
INFINISPAN=N
POSTGRESQL=N
KAFKA=N
KEYCLOAK=N
KOGITO_DATA_INDEX=N
Expand Down
8 changes: 4 additions & 4 deletions kogito-quarkus-examples/ocp-tryout/installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#


# firstly, any Kogito unrelated infrastructure like infinispan, kafka, etc. is installed
# firstly, any Kogito unrelated infrastructure like postgresql, kafka, etc. is installed
# secondly, any Kogito services like data-index, management console, etc. is installed
# thirdly, the application to try out is installed

Expand All @@ -28,7 +28,7 @@ source common-functions.sh

action=install

components=(SHARED_CONFIG INFINISPAN KAFKA KEYCLOAK \
components=(SHARED_CONFIG POSTGRESQL KAFKA KEYCLOAK \
KOGITO_DATA_INDEX KOGITO_MANAGEMENT_CONSOLE KOGITO_TASK_CONSOLE KOGITO_JOBS_SERVICE \
TEST_APP)
# override the installer properties configuration if needed
Expand Down Expand Up @@ -103,11 +103,11 @@ function install(){

componentAction "${SHARED_CONFIG}" "kogito-shared"

componentAction "${INFINISPAN}" "infinispan"
componentAction "${POSTGRESQL}" "postgresql"
componentAction "${KAFKA}" "kafka"
componentAction "${KEYCLOAK}" "keycloak"

dbType="infinispan"
dbType="postgresql"

componentAction "${KOGITO_DATA_INDEX}" "kogito-data-index" "${dbType}"
componentAction "${KOGITO_MANAGEMENT_CONSOLE}" "kogito-management-console"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
configMap:
name: data-index-config
containers:
- name: kogito-data-index-infinispan
- name: kogito-data-index-postgresql
volumeMounts:
- name: app-pvc
mountPath: /home/kogito/data/protobufs
Expand All @@ -40,23 +40,36 @@ spec:
configMapKeyRef:
name: kogito-configs
key: kogito.dataindex.props
- name: QUARKUS_INFINISPAN_CLIENT_HOSTS
- name: KOGITO_PERSISTENCE_TYPE
valueFrom:
configMapKeyRef:
name: kogito-configs
key: quarkus.infinispan.client.hosts
- name: QUARKUS_INFINISPAN_CLIENT_USE_AUTH
value: 'true'
- name: QUARKUS_INFINISPAN_CLIENT_USERNAME
key: kogito.persistence.type
- name: QUARKUS_DATASOURCE_JDBC_URL
valueFrom:
configMapKeyRef:
name: kogito-configs
key: quarkus.infinispan.client.username
- name: QUARKUS_INFINISPAN_CLIENT_PASSWORD
key: quarkus.datasource.jdbc.url
- name: QUARKUS_DATASOURCE_REACTIVE_URL
valueFrom:
secretKeyRef:
name: infinispan-generated-secret
key: password
configMapKeyRef:
name: kogito-configs
key: quarkus.datasource.reactive.url
- name: QUARKUS_DATASOURCE_DB_KIND
valueFrom:
configMapKeyRef:
name: kogito-configs
key: quarkus.datasource.db-kind
- name: QUARKUS_DATASOURCE_USERNAME
valueFrom:
configMapKeyRef:
name: kogito-configs
key: quarkus.datasource.username
- name: QUARKUS_DATASOURCE_PASSWORD
valueFrom:
configMapKeyRef:
name: kogito-configs
key: quarkus.datasource.password
resources:
limits:
cpu: '1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spec:
template:
spec:
containers:
- name: kogito-jobs-service-infinispan
- name: kogito-jobs-service-postgresql
env:
- name: ENABLE_EVENTS
value: 'true'
Expand All @@ -30,23 +30,41 @@ spec:
configMapKeyRef:
name: kogito-configs
key: kogito.jobsservice.props
- name: QUARKUS_INFINISPAN_CLIENT_HOSTS
- name: KOGITO_DATA_INDEX_PROPS
valueFrom:
configMapKeyRef:
name: kogito-configs
key: quarkus.infinispan.client.hosts
- name: QUARKUS_INFINISPAN_CLIENT_USE_AUTH
value: 'true'
- name: QUARKUS_INFINISPAN_CLIENT_USERNAME
key: kogito.dataindex.props
- name: KOGITO_PERSISTENCE_TYPE
valueFrom:
configMapKeyRef:
name: kogito-configs
key: kogito.persistence.type
- name: QUARKUS_DATASOURCE_JDBC_URL
valueFrom:
configMapKeyRef:
name: kogito-configs
key: quarkus.infinispan.client.username
- name: QUARKUS_INFINISPAN_CLIENT_PASSWORD
key: quarkus.datasource.jdbc.url
- name: QUARKUS_DATASOURCE_REACTIVE_URL
valueFrom:
secretKeyRef:
name: infinispan-generated-secret
key: password
configMapKeyRef:
name: kogito-configs
key: quarkus.datasource.reactive.url
- name: QUARKUS_DATASOURCE_DB_KIND
valueFrom:
configMapKeyRef:
name: kogito-configs
key: quarkus.datasource.db-kind
- name: QUARKUS_DATASOURCE_USERNAME
valueFrom:
configMapKeyRef:
name: kogito-configs
key: quarkus.datasource.username
- name: QUARKUS_DATASOURCE_PASSWORD
valueFrom:
configMapKeyRef:
name: kogito-configs
key: quarkus.datasource.password
resources:
limits:
cpu: '1'
Expand Down
10 changes: 7 additions & 3 deletions kogito-quarkus-examples/ocp-tryout/kogito-shared/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@ There is one config map per infrastructure component.
- `keycloak.admin.password` - the administration consoles' users' password
- `keycloak.realm.json` - Keycloak initialization file for the Kogito realm creating clients, users, etc. used in Kogito examples
- `keycloak.db.vendor` - Keycloak persistence
#### Infinispan Config
- `quarkus.infinispan.client.hosts` - the infinispan url used by the Kogito application; can be internal service url
- `quarkus.infinispan.client.username` - the user used by the Kogito application to access the infinispan service
#### PostgreSQL Config
- `kogito.persistence.type`
- `quarkus.datasource.db-kind`
- `quarkus.datasource.username`
- `quarkus.datasource.password`
- `quarkus.datasource.jdbc.url`
- `quarkus.datasource.reactive.url`
#### Kafka Config
- `kafka.bootstrap.servers` - the kafka url used by the Kogito application; can be internal service url
#### Kogito Dataindex Config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,17 @@ data:
keycloak.admin.password: 'admin'
keycloak.realm.json: '/tmp/kogito-realm.json'
keycloak.db.vendor: 'h2'
quarkus.infinispan.client.username: 'developer'
quarkus.infinispan.client.hosts: 'infinispan.${project_name}.svc.cluster.local:11222'
kogito.persistence.type: jdbc
quarkus.datasource.db-kind: postgresql
quarkus.datasource.username: kogito-user
quarkus.datasource.password: kogito-pass
quarkus.datasource.jdbc.url: jdbc:postgresql://postgresql.${project_name}.svc.cluster.local:5432/kogito}
quarkus.datasource.reactive.url: postgresql://postgresql.${project_name}.svc.cluster.local:5432/kogito}
kafka.bootstrap.servers: 'kafka.${project_name}.svc.cluster.local:9092'
kogito.dataindex.props: '-Dkogito.protobuf.folder=/home/kogito/data/protobufs'
kogito.dataindex.httpurl: 'http://kogito-data-index-infinispan-${project_name}.${apps_cluster_host}'
kogito.dataindex.httpurl.with.graphql: 'http://kogito-data-index-infinispan-${project_name}.${apps_cluster_host}/graphql'
kogito.dataindex.wsurl: 'ws://kogito-data-index-infinispan-${project_name}.${apps_cluster_host}'
kogito.dataindex.httpurl: 'http://kogito-data-index-postgresql-${project_name}.${apps_cluster_host}'
kogito.dataindex.httpurl.with.graphql: 'http://kogito-data-index-postgresql-${project_name}.${apps_cluster_host}/graphql'
kogito.dataindex.wsurl: 'ws://kogito-data-index-postgresql-${project_name}.${apps_cluster_host}'
kogito.managementconsole.props: '-Dkogito.svg.folder.path=/home/kogito/data/svg -Dkogito.consoles.keycloak.config.url=http://keycloak-${project_name}.${apps_cluster_host}/auth/ -Dkogito.consoles.keycloak.config.health-check-url=http://keycloak-${project_name}.${apps_cluster_host}/auth/realms/kogito/.well-known/openid-configuration'
kogito.taskconsole.props: '-Dkogito.test.user-system.enabled=true -Dkogito.consoles.keycloak.config.url=http://keycloak-${project_name}.${apps_cluster_host}/auth/ -Dkogito.consoles.keycloak.config.health-check-url=http://keycloak-${project_name}.${apps_cluster_host}/auth/realms/kogito/.well-known/openid-configuration'
kogito.jobsservice.props: '-Dquarkus-profile=events-support -D%events-support.kafka.bootstrap.servers=kafka.${project_name}.svc.cluster.local:9092 -D%events-support.mp.messaging.outgoing.kogito-job-service-job-status-events.bootstrap.servers=kafka.${project_name}.svc.cluster.local:9092'
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,13 @@
# under the License.
#

images:
server: quay.io/infinispan/server:14.0.4.Final
deploy:
infinispan:
server:
endpoints:
- securityRealm: default
socketBinding: default
- connectors:
hotrod:
hotrodConnector:
authentication:
sasl:
mechanisms: DIGEST-MD5
qop: auth
serverName: infinispan
rest:
restConnector:
authentication:
mechanisms: BASIC
securityRealm: metrics
socketBinding: metrics
database_service_name: postgresql
memory_limit: 512Mi
volume_capacity: 1Gi
config:
postgresql_database: kogito
postgresql_password: kogito-pass
postgresql_user: kogito-user
port: 5432
image:
tag: "postgres:16.1-alpine3.19"
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
action=$1

if [ "${action}" == "uninstall" ]; then
echo "*** uninstalling infinispan"
helm uninstall infinispan -n $(getProjectName)
oc delete pvc,secret --selector clusterName=infinispan -n $(getProjectName)
echo "*** uninstalling postgresql"
helm uninstall postgresql -n $(getProjectName)
oc delete pvc,secret --selector clusterName=postgresql -n $(getProjectName)

elif [ "${action}" == "install" ]; then
echo "*** installing infinispan"
echo "*** installing postgresql"
helm repo add openshift-helm-charts https://charts.openshift.io/
helm install infinispan openshift-helm-charts/infinispan-infinispan --version "0.2.0" -f infinispan-values.yaml -n $(getProjectName) $(dryRun "Helm")
helm install postgresql openshift-helm-charts/redhat-postgresql-persistent --version "0.0.3" -f postgresql-values.yaml -n $(getProjectName) $(dryRun "Helm")

else
echo "*** no such action: $action"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ version: 0.1.0
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.16.0"
appVersion: "10.0.0"
Original file line number Diff line number Diff line change
Expand Up @@ -80,23 +80,41 @@ spec:
configMapKeyRef:
name: kogito-configs
key: kogito.dataindex.wsurl
- name: QUARKUS_INFINISPAN_CLIENT_HOSTS
- name: KOGITO_DATA_INDEX_PROPS
valueFrom:
configMapKeyRef:
name: kogito-configs
key: quarkus.infinispan.client.hosts
- name: QUARKUS_INFINISPAN_CLIENT_USE_AUTH
value: 'true'
- name: QUARKUS_INFINISPAN_CLIENT_USERNAME
key: kogito.dataindex.props
- name: KOGITO_PERSISTENCE_TYPE
valueFrom:
configMapKeyRef:
name: kogito-configs
key: quarkus.infinispan.client.username
- name: QUARKUS_INFINISPAN_CLIENT_PASSWORD
key: kogito.persistence.type
- name: QUARKUS_DATASOURCE_JDBC_URL
valueFrom:
secretKeyRef:
name: infinispan-generated-secret
key: password
configMapKeyRef:
name: kogito-configs
key: quarkus.datasource.jdbc.url
- name: QUARKUS_DATASOURCE_REACTIVE_URL
valueFrom:
configMapKeyRef:
name: kogito-configs
key: quarkus.datasource.reactive.url
- name: QUARKUS_DATASOURCE_DB_KIND
valueFrom:
configMapKeyRef:
name: kogito-configs
key: quarkus.datasource.db-kind
- name: QUARKUS_DATASOURCE_USERNAME
valueFrom:
configMapKeyRef:
name: kogito-configs
key: quarkus.datasource.username
- name: QUARKUS_DATASOURCE_PASSWORD
valueFrom:
configMapKeyRef:
name: kogito-configs
key: quarkus.datasource.password
ports:
- name: http
containerPort: {{ .Values.applicationPort }}
Expand Down
Loading

0 comments on commit ec0557a

Please sign in to comment.