The first set of templates are for MicroServices. These are generic templates with sizing and allows team/developers to build their own application and they should base it Alpine and Slim JDK verison:
FROM mayureshkrishna/java-8:server-jre-8u121-slim
This template makes following resources available on the containers:
- ImageStream
- DeploymentConfig a. Rolling Deployment Strategy b. Config Change as Trigger c. Container Resources limited to CPU: 500m to 1 Core and Memory: 100Mi to 500Mi and Port 8080
- Service exposed on port 8080
- Route with TLS edge termination
- HorizontalPodAutoscaler with Min 1 and Max 4 pods with 80% CPU utilization as trigger
This template has 4 parameters:
- APPLICATION_NAME - This is the name of application/microservice
- ENV_NAME - This is the project name on OpenShift
- APPLICATION_DOMAIN - This the sub-domain of your OpenShift deployment
- REGISTRY_URL - This is OpenShift internal docker registry URL
oc create -f microservice-small-template.json -n dev
Your OpenShift admin can create this template at OpenShift level thus making it available across all projects.
oc replace -f microservice-small-template.json -n dev
oc export templates/microservice-small-template -o json > microservice-small-template.json -n dev
You can use yaml instead of json if you prefer yaml.
oc new-app --template=microservice-small-template -p APPLICATION_NAME=sample-app,ENV_NAME=dev,APPLICATION_DOMAIN=amnotion.com,REGISTRY_URL=172.30.36.202:5000 -l "app=sample-app" -n dev