Please see the Github Pages Site for complete documentation: quarkuscoffeeshop.github.io
The Quarkus Cafe Role will deploy an event-driven demo application built with Quarkus, AMQ Streams (Kafka), and MongoDB. The application deploys to OpenShift (Kubernetes.) The source code for the quarkuscoffeeshop application support doc can be found here.
- OpenShift 4.8 an up Cluster installed
- Ansible should be installed on machine
- oc cli must be installed
- Ansible community.kubernetes module must be installed
ansible-galaxy collection install community.kubernetes
- Install Helm Binary
- Postges Operator for Quarkus CoffeeShop 5.0.1-SNAPSHOT Deployments
- pip3
http://quarkuscoffeeshop-web-quarkus-cafe-demo.apps.example.com example
- Default web page 5.0.1-SNAPSHOT
- http://quarkuscoffeeshop-web-quarkus-cafe-demo.apps.example.com/ this endpoint is used to view the events coming into the cluster
- Default web page v3.3.1
- http://quarkuscoffeeshop-web-quarkus-cafe-demo.apps.example.com/cafe this endpoint is used to view the events coming into the cluster
- If you deploy skip_quarkus_cafe_customermock this will automatically push events to the quarkus cafe dashboard.
- If you would like to manally push events to AMQ use the command below.
export ENDPOINT="quarkuscoffeeshop-web-quarkus-cafe-demo.apps.ocp4.example.com"
curl --request POST http://${ENDPOINT}/order \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
-d '{
"beverages": [
{
"item": "COFFEE_WITH_ROOM",
"name": "Mickey"
},
{
"item": "CAPPUCCINO",
"name": "Minnie"
}
],
"kitchenOrders": [
{
"item": "CAKEPOP",
"name": "Mickey"
},
{
"item": "CROISSANT",
"name": "Minnie"
}
]
}'
Type | Description | Default Value |
---|---|---|
deployment_method | docker or s2i build | docker |
skip_amq_install | Skip Red Hat AMQ Install | false |
skip_mongodb_operator_install | Skip MongoDB Operator Install | false |
single_mongodb_install | Skip single instance mongodb | false |
skip_quarkuscoffeeshop_helm_install | Skip quarkuscoffeeshop helm chart install | false |
openshift_token | OpenShift login token | 123456789 |
openshift_url | OpenShift target url | https://master.example.com |
project_namespace | OpenShift Project name for the quarkus-cafe | quarkus-cafe-demo |
insecure_skip_tls_verify | Skip insecure tls verify | true |
default_owner | Default owner of template files. | root |
default_group | Default group of template files. | root |
delete_deployment | delete the deployment and project for quarkus-cafe-demo | false |
amqstartingCSV | Red Hat AMQ csv version | amqstreams.v1.6.1 |
mongodbstartingCSV | MongoDB Ops Manager version | mongodb-enterprise.v1.8.0 |
config_location | default location for application templates | "/tmp/" |
version_barista | Default container barista tag | 5.0.0-SNAPSHOT |
version_counter | Default container counter tag | 5.0.1-SNAPSHOT |
version_customermocker | Default container customermocker tag | 3.0.1 |
version_kitchen | Default container kitchen tag | 5.0.0-SNAPSHOT |
version_web | Default container web tag | 5.0.1-SNAPSHOT |
helm_chart_version | Version of Qaurkus Cafe Helm Chart | 3.4.4 |
pgsql_username | Default postgress user | coffeshopadmin |
postgres_password | this is the postgress password that will be used in deployment | must be changed |
pgsql_url | default postgres URL | 'jdbc:postgresql://coffeeshopdb:5432/coffeeshopdb?currentSchema=coffeeshop' |
storeid | Store id for web frontend | RALEIGH |
quarkus_log_level | Quarkus coffee shop log level | INFO |
quarkuscoffeeshop_log_level | Microservice log level | DEBUG |
- Ansible
- OpenShift cli
- helm
curl -OL https://raw.githubusercontent.com/quarkuscoffeeshop/quarkuscoffeeshop-ansible/dev/files/deploy-quarkuscoffeeshop-ansible.sh
chmod +x deploy-quarkuscoffeeshop-ansible.sh
Set Environment variables for ACM WORKLOADS
- Gogs server
- OpenShift Pipelines
- OpenShift GitOps
- Quay.io
- AMQ Streams
- Postgres Template deployment
- homeoffice Tekton pipelines
- quarkus-coffeeshop Tekton pipelines
$ cat >env.variables<<EOF
ACM_WORKLOADS=y
AMQ_STREAMS=y
CONFIGURE_POSTGRES=n
MONGODB_OPERATOR=n
MONGODB=n
HELM_DEPLOYMENT=n
EOF
$ ./deploy-quarkuscoffeeshop-ansible.sh -d ocp4.example.com -t sha-123456789 -p 123456789 -s ATLANTA
Set Environment variables for standard deployment
- AMQ Streams
- Postgres Operator configuration
- quarkus coffeeshop helm deployment
$ cat >env.variables<<EOF
ACM_WORKLOADS=n
AMQ_STREAMS=y
CONFIGURE_POSTGRES=y
MONGODB_OPERATOR=n
MONGODB=n
HELM_DEPLOYMENT=y
EOF
$ ./deploy-quarkuscoffeeshop-ansible.sh -d ocp4.example.com -t sha-123456789 -p 123456789 -s ATLANTA
Optional: Change namespace for helm deployments
default is quarkuscoffeeshop-demo
$ cat >env.variables<<EOF
ACM_WORKLOADS=n
AMQ_STREAMS=y
CONFIGURE_POSTGRES=y
MONGODB_OPERATOR=n
MONGODB=n
HELM_DEPLOYMENT=y
EOF
$ NAMESPACE=changeme
$ sed -i "s/quarkuscoffeeshop-demo/${NAMESPACE}/g" deploy-quarkuscoffeeshop-ansible.sh
ansible-galaxy collection install community.kubernetes
# Install Helm
$ curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3
$ chmod 700 get_helm.sh
$ ./get_helm.sh
$ ansible-galaxy install tosin2013.quarkus_cafe_demo_role
$ export DOMAIN=ocp4.example.com
$ export OCP_TOKEN=123456789
$ cat >deploy-quarkus-cafe.yml<<YAML
- hosts: localhost
become: yes
vars:
openshift_token: ${OCP_TOKEN}
openshift_url: https://api.${DOMAIN}:6443
insecure_skip_tls_verify: true
default_owner: ${USER}
default_group: ${USER}
project_namespace: quarkuscoffeeshop-demo
delete_deployment: false
skip_amq_install: false
skip_configure_postgres: true
skip_mongodb_operator_install: false
skip_quarkuscoffeeshop_helm_install: false
domain: ${DOMAIN}
helm_chart_version: 3.3.0
version_barista: 3.0.0
version_counter: 3.1.0
version_customermocker: 3.0.1
version_kitchen: 3.1.0
version_web: 3.1.0
roles:
- tosin2013.quarkus_cafe_demo_role
YAML
$ ansible-playbook deploy-quarkus-cafe.yml
$ ansible-galaxy install tosin2013.quarkus_cafe_demo_role
$ export DOMAIN=ocp4.example.com
$ export OCP_TOKEN=123456789
$ cat >deploy-quarkus-cafe.yml<<YAML
- hosts: localhost
become: yes
vars:
openshift_token: ${OCP_TOKEN}
openshift_url: https://api.${DOMAIN}:6443
insecure_skip_tls_verify: true
default_owner: ${USER}
default_group: ${USER}
project_namespace: quarkuscoffeeshop-demo
delete_deployment: false
skip_amq_install: false
skip_configure_postgres: true
skip_mongodb_operator_install: true
single_mongodb_install: true
skip_quarkuscoffeeshop_helm_install: false
domain: ${DOMAIN}
helm_chart_version: 3.3.0
version_barista: 3.0.0
version_counter: 3.1.0
version_customermocker: 3.0.1
version_kitchen: 3.1.0
version_web: 3.1.0
roles:
- tosin2013.quarkus_cafe_demo_role
YAML
$ ansible-playbook deploy-quarkus-cafe.yml
Force delete kafka crds after bad install
oc get crds -o name | grep '.*\.strimzi\.io' | xargs -r -n 1 oc delete
- Ansible k8s โ Manage Kubernetes (K8s) objects deployment example
GPLv3
This role was created in 2020 by Tosin Akinosho