Quarkus Coolstore Pipeline

Deploy a production instance of coolstore on OpenShift using pipelines

Prerequisites

  • Red Hat Pipelines Operator installed on your OpenShift cluster

Setup

There are a couple things pipelines do not have permissions to do by default, so we'll set them up here.

export QUARKUS_NS=foo

oc new-project $QUARKUS_NS

oc adm policy add-scc-to-user anyuid system:serviceaccount:$QUARKUS_NS:rabbitmq-server

cat << EOF | oc create -f -
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
  generateName: coolstore-
  namespace: $QUARKUS_NS
spec:
  targetNamespaces:
  - $QUARKUS_NS
  upgradeStrategy: Default
EOF

oc create -f quarkus-pipelines.yml

Use

  1. Run the deploy-coolstore-prereqs pipeline. You can accept the default options
  2. Run the deploy-coolstore pipeline. You should select VolumeClaimTemplate for the workspace. No additional configuration is necessary. You may want to change the repo and branch to whatever you're working on. You can rerun this pipeline as many times as you want to redeploy the app. The deployconfig has an image trigger so it will restart automatically when the new image build is pushed.
  3. A route will be create and your coolstore instance will be available at https://coolstore-$namspace.apps.$cluster.$domain
  4. Quarkus is configured with the user cooluser / c00lp@ss unless you change the corresponding COOLSTORE_USER and COOLSTORE_PASS parameters.

CLI Example:

export QUARKUS_NS=foo

oc new-project $QUARKUS_NS

oc adm policy add-scc-to-user anyuid system:serviceaccount:$QUARKUS_NS:rabbitmq-server

cat << EOF | oc create -f -
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
  generateName: coolstore-
  namespace: $QUARKUS_NS
spec:
  targetNamespaces:
  - $QUARKUS_NS
  upgradeStrategy: Default
EOF

oc create -f quarkus-pipelines.yml

cat << EOF | oc create -f -
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
  name: deploy-coolstore-prereqs
  namespace: $QUARKUS_NS
spec:
  pipelineRef:
    name: deploy-coolstore-prereqs
  workspaces:
  - name: shared
    emptyDir: {}
EOF

until oc get pipelinerun deploy-coolstore-prereqs | grep Succeeded; do oc get pipelinerun deploy-coolstore-prereqs; sleep 1; done

cat << EOF | oc create -f -
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
  name: deploy-coolstore
  namespace: $QUARKUS_NS
spec:
  params:
  - name: GIT_REPO
    value: https://github.com/jmontleon/eap-coolstore-monolith
  - name: GIT_REVISION
    value: quarkus-migration
  pipelineRef:
    name: deploy-coolstore
  workspaces:
  - name: shared
    volumeClaimTemplate:
      metadata:
        creationTimestamp: null
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 1Gi
        storageClassName: gp3-csi
        volumeMode: Filesystem
      status: {}
EOF

until oc get pipelinerun deploy-coolstore | grep Succeeded; do oc get pipelinerun deploy-coolstore; sleep 1; done
oc get route coolstore

Graphical Example:

export QUARKUS_NS=foo

oc new-project $QUARKUS_NS

oc adm policy add-scc-to-user anyuid system:serviceaccount:$QUARKUS_NS:rabbitmq-server

cat << EOF | oc create -f -
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
  generateName: coolstore-
  namespace: $QUARKUS_NS
spec:
  targetNamespaces:
  - $QUARKUS_NS
  upgradeStrategy: Default
EOF

oc create -f quarkus-pipelines.yml

Choose to start the deploy-coolstore-prereqs pipeline.

Change any desired options, start, and wait for it to finish.

Choose to start the deploy-coolstore pipeline.

Change the shared workspace to use a VolumeClaimTemplate, change any desired options, start, and wait for it to finish.