Configure the ORDER database required for the CustomerOrderResource application.
This section covers how to deploy a DB2 container to Red Hat OpenShift that has been pre-configured with the ORDER database required for the CustomerOrderResource application.
Clone a repository (if you haven’t already…)
- Issue the following command to clone the repository that contains the required files
git clone https://github.com/ibm-cloud-architecture/appmod-liberty-toolkit
Navigate to the DB2 folder
- The
yaml
files for theDeployment
andService
are in thedb2
folder of the repository
cd appmod-liberty-toolkitcd db2
Deploy the DB2 image to OpenShift
- Issue the following commands to create a
namespace
,service account
,deploymentconfig
andservice
:
oc create ns db2oc project db2oc create serviceaccount mysvcacct -n db2oc adm policy add-scc-to-user privileged system:serviceaccount:db2:mysvcacctoc apply -f db2-dc.yamloc apply -f db2-service.yaml
The DB2 database will take a few minutes to start and will then be accessible in the Cluster at db2.db2.svc:50000
- If you want to expose the database outside of the cluster, use the
db2-nodeport.yaml
file