The repository includes a set of Kubernetes manifests underDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/WASdev/sample.daytrader7/llms.txt
Use this file to discover all available pages before exploring further.
deploy/ that together stand up a complete DayTrader 7 environment on a cluster. The application itself is described as an OpenLibertyApplication custom resource managed by the OpenLiberty Operator, and the database tier is a containerized DB2 instance deployed as a standard Deployment with an accompanying Service. RBAC resources and a Secret round out the manifest set.
The
applicationImage field in deploy/daytrader7-deploy.yaml currently references a pre-built image (docker.io/dguinan/sample-daytrader7:latest). Before deploying to your own cluster, build your own image using the Docker deployment guide and update this field to point to your registry and tag.Prerequisites
Kubernetes Cluster
A running cluster with
kubectl configured. OpenShift clusters are also supported — the RBAC manifests reference OpenShift SCC roles.OpenLiberty Operator
The OpenLiberty Operator must be installed in the target namespace so the
OpenLibertyApplication CRD is available.DB2 Credentials
A DB2 password to encode into the
db-credential Secret. The default encoded value in db2-secret.yaml is passw0rd.Manifest inventory
Thedeploy/ directory contains five YAML files. Here is what each one does and its full contents:
deploy/db2-secret.yaml — DB2 password Secret
Stores the DB2 instance password as an Opaque Kubernetes Secret. The dbpw key holds the base64-encoded password (cGFzc3cwcmQ= decodes to passw0rd). Update this value before applying to a production cluster.
deploy/db2-role-n-sa.yaml — RBAC Role and ServiceAccount
Creates the mysvcacct ServiceAccount used by the DB2 pod, and a RoleBinding that grants both the default and mysvcacct service accounts the system:openshift:scc:privileged ClusterRole. This is required because the DB2 container runs as a privileged workload.
deploy/tradedb.yaml — DB2 Deployment
Deploys a single replica of the docker.io/tamdocker/trade7db:latest DB2 image. The DB2INST1_PASSWORD environment variable is sourced from the db-credential Secret, and the pod runs under the mysvcacct ServiceAccount with privileged security context.
deploy/tradedb-service.yaml — DB2 Service
Exposes the DB2 pod as a ClusterIP Service named trade-db2 on port 50000. The daytrader7-deploy.yaml manifest sets tradeDbHost=trade-db2, so the application resolves the database by this Service name via cluster DNS.
deploy/daytrader7-deploy.yaml — OpenLibertyApplication CR
Describes the DayTrader 7 application pod using the OpenLibertyApplication CRD. The operator manages deployment, rolling updates, and the creation of a Route (on OpenShift) or Ingress resource at path /daytrader. All five DB2 connection environment variables are set here; dbPass is injected from the db-credential Secret.
Resource requirements
| CPU | Memory | |
|---|---|---|
| Requests | 500m | 1Gi |
| Limits | 500m | 2Gi |
daytrader7-deploy.yaml to match your cluster capacity and benchmarking requirements.
Deployment steps
Apply the manifests in dependency order. The Argo CD sync-wave annotations ("0" → "3") reflect the intended sequence:
Create the DB2 Secret
Apply the credential Secret first. If you want a different DB2 password, base64-encode it (
echo -n 'yourpassword' | base64) and replace the dbpw value before applying:Set up RBAC
Create the
mysvcacct ServiceAccount and the privileged RoleBinding required by the DB2 container:Deploy the DB2 database
Deploy the DB2 pod and its ClusterIP Service. Wait for the pod to reach
Running before proceeding:Update the application image reference
Edit
deploy/daytrader7-deploy.yaml and replace the applicationImage value with the image you built and pushed to your registry:Deploy DayTrader 7
Apply the
OpenLibertyApplication manifest. The OpenLiberty Operator will create the Deployment, Service, and (on OpenShift) a Route exposing the app at /daytrader:Initialize the database
Retrieve the exposed route or ingress hostname for your cluster and navigate to the configuration page:Click “(Re)-create DayTrader Database Tables and Indexes”, then “(Re)-populate DayTrader Database”.
After the database has been populated, restart the DayTrader 7 pod so Liberty reinitializes its connection pool cleanly:
Application exposure
TheOpenLibertyApplication CR sets expose: true, which instructs the operator to create a Route (OpenShift) or Ingress resource automatically. Traffic is routed to the pod’s liveness-port at HTTPS port 9443, under the path /daytrader.