1. oc login to your cluster, e.g. oc login -u admin -p admin https://mycluster.testing:6443 2. clone a EAP app deployment Git repo, eg. deployment.git 3. create env vars for namespaces and create them too (BTW I use to set WATCH_NAMESPACE=INSTALL_NAMESPACE) export INSTALL_NAMESPACE="${USER}-dg8-eap74-namespace" export WATCH_NAMESPACE="${USER}-dg8-eap74-watch-namespace" oc new-project ${INSTALL_NAMESPACE} oc new-project ${WATCH_NAMESPACE} 4. Install RHDG Operator oc apply -f - << EOF apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: name: datagrid namespace: ${INSTALL_NAMESPACE} spec: targetNamespaces: - ${WATCH_NAMESPACE} EOF oc apply -f - << EOF apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: datagrid-operator namespace: ${INSTALL_NAMESPACE} spec: channel: 8.1.x installPlanApproval: Automatic name: datagrid source: redhat-operators sourceNamespace: openshift-marketplace EOF 5. Check that the RHDG Operator is running, i.e. wait until operator pod is running oc get pods -n ${INSTALL_NAMESPACE} 6. Create Infinispan CR oc project ${WATCH_NAMESPACE} oc apply -f - << EOF apiVersion: infinispan.org/v1 kind: Infinispan metadata: name: example-infinispan spec: replicas: 1 EOF 7. Check that the RHDG service is up and running, i.e. wait until example-infinispan-* pod is running oc get pods 8. Get Infinispan default credentials oc get secret example-infinispan-generated-secret -o jsonpath="{.data.identities\.yaml}" | base64 --decode | head -n 3 > user export RHDG_ADDRESS=$(oc logs example-infinispan-0 | grep ISPN080034 | sed "s|^.*on ||g") export USERNAME="$(cat user | grep username | sed 's|- username: ||g')" export PASSWORD=$(cat user | grep password | sed 's| password: ||g') echo "$USERNAME - $PASSWORD" 9. Set a name for the EAP 73 app EAP_APP_NAME=eap-app-73 10. Create a EAP ping service cat << EOF > ping-service.yaml apiVersion: v1 kind: Service spec: clusterIP: None ports: - name: ping port: 8888 selector: deploymentconfig: ${EAP_APP_NAME} metadata: name: ${EAP_APP_NAME}-ping-service annotations: service.alpha.kubernetes.io/tolerate-unready-endpoints: "true" description: "The JGroups ping port for clustering." EOF oc create -f ping-service.yaml 11. Set the EAP image to be used to 7.3:latest EAP_IMAGE=registry-proxy.engineering.redhat.com/rh-osbs/jboss-eap-7-eap73-openjdk8-openshift-rhel7:latest 12. Start the build oc new-build ${EAP_IMAGE} --binary=true --name=${EAP_APP_NAME} oc start-build ${EAP_APP_NAME} --from-dir=./deployment 13. Wait until the build is over, i.e. wait until eap-app-73-*-build is "Completed" oc get pods 14. Install the EAP Operator oc apply -f - << EOF kind: "Subscription" apiVersion: "operators.coreos.com/v1alpha1" metadata: name: "eap-operator" namespace: "${INSTALL_NAMESPACE}" spec: channel: alpha name: "eap" sourceNamespace: "openshift-marketplace" installPlanApproval: "Automatic" source: "redhat-operators" EOF 15. Set a name for the EAP 73 app image export APPLICATION_IMAGE=$(oc get is ${EAP_APP_NAME} -o jsonpath='{.status.tags[0].items[0].dockerImageReference}') 16. Create a WildFly CR running the pre-built app oc apply -f - << EOF apiVersion: wildfly.org/v1alpha1 kind: WildFlyServer metadata: name: ${EAP_APP_NAME} spec: applicationImage: '${APPLICATION_IMAGE}' replicas: 1 env: - name: JGROUPS_PING_PROTOCOL value: 'dns.DNS_PING' - name: OPENSHIFT_DNS_PING_SERVICE_NAME value: 'eap-ping-service' - name: OPENSHIFT_DNS_PING_SERVICE_PORT value: '8888' - name: CACHE_USERNAME value: '${USERNAME}' - name: CACHE_PASSWORD value: '${PASSWORD}' EOF 17. Check that the EAP 73 app is up and running, i.e. wait until eap-app-73-0 is ready oc get pods 18. Set a name for the EAP 74 app EAP_APP_NAME=eap-app-74 19. Create a EAP ping service cat << EOF > ping-service.yaml apiVersion: v1 kind: Service spec: clusterIP: None ports: - name: ping port: 8888 selector: deploymentconfig: ${EAP_APP_NAME} metadata: name: ${EAP_APP_NAME}-ping-service annotations: service.alpha.kubernetes.io/tolerate-unready-endpoints: "true" description: "The JGroups ping port for clustering." EOF oc create -f ping-service.yaml 20. Set the EAP image to be used to 7.4:Beta EAP_IMAGE=registry-proxy.engineering.redhat.com/rh-osbs/jboss-eap-7-tech-preview-eap74-openjdk11-openshift-rhel8:7.4.0.Beta-4 21. Start the build oc new-build ${EAP_IMAGE} --binary=true --name=${EAP_APP_NAME} oc start-build ${EAP_APP_NAME} --from-dir=./deployment 22. Wait until the build is over, i.e. wait until eap-app-74-*-build is "Completed" oc get pods 23. Set a name for the EAP 73 app image export APPLICATION_IMAGE=$(oc get is ${EAP_APP_NAME} -o jsonpath='{.status.tags[0].items[0].dockerImageReference}') 24. Create a WildFly CR running the pre-built app oc apply -f - << EOF apiVersion: wildfly.org/v1alpha1 kind: WildFlyServer metadata: name: ${EAP_APP_NAME} spec: applicationImage: '${APPLICATION_IMAGE}' replicas: 1 env: - name: JGROUPS_PING_PROTOCOL value: 'dns.DNS_PING' - name: OPENSHIFT_DNS_PING_SERVICE_NAME value: '${EAP_APP_NAME}-ping-service' - name: OPENSHIFT_DNS_PING_SERVICE_PORT value: '8888' - name: CACHE_USERNAME value: '${USERNAME}' - name: CACHE_PASSWORD value: '${PASSWORD}' EOF 25. Check that the EAP 74 app is NOT ready: oc get pods NAME READY STATUS RESTARTS AGE eap-app-73-0 1/1 Running 0 28m eap-app-74-0 0/1 Running 11 29m example-infinispan-0 1/1 Running 0 29m