Applications running within OpenShift can increase capacity based on user load. This functionality is called 'auto-scaling'. Setting up auto-scaling is essentially a two-step process: Modify your deployment configuration to set a request-limit for CPU resources. You will want to observe the application's metrics during a busy period to understand what an appropriate request might be. Your request should sit just above the upper-limit of normal traffic for an individual pod.
This process implies that you already have a deployed application, and wish to have a URL outside of the domain of what OpenShift can administer (currently openshift.dsc.umich.edu and webplatformsunpublished.umich.edu). Essentially, your application will need to have two publicly available routes, each protected with a certificate: the route provided within the OpenShift domain, and the route at your custom sub-domain. More instructions follow:
Services can be exposed to external load balancers--allowing for failover to external hosting--by exposing the service as a 'load balancer' within OpenShift. The following command illustrates how to do this oc expose dc myweb --type=LoadBalancer --name=myweb-ingress In this case, the deployment configuration name is 'myweb'. The name of additional service is 'myweb-ingress'. This should not conflict with existing service names within your project. Doing this will result in your service being available as a port on the OpenShift nodes:
It is possible to access / update files in a pod from the command line. E.g. The command oc rsync kartograafr-3-ltzt2:/var/log/kartograafr will copy the kartograafr log files from the kartograafr-3-ltzt2 pod to the current laptop directory. Note: A message that rsync is not available in the container may appear, but files can still be copied. This is a good option for examining current log or configuration files.
Overview This link provides initial vendor documentation on getting started with creating applications in OpenShift. Create a Docker-based Image Using The CLI oc new-app ubuntu Create An App Based On A Dockerfile You must have a dockerfile (called Dockerfile) in this repo for openshift to recognize it:oc new-app https://github.com/chriskretler/ubuntu-dockerfile --strategy=docker
Overview Docker Vendor Documentation Efficient Dockerfiles The Docker build process caches where possible to speed up builds. Order actions in the Dockerfile so that commands that usually produce the same result, or that are unlikely to change, come early. E.g. Put utility installation / update code before compiling source under active development.
Sample Environmental Variable Command oc env dc/sample PROPERTIES=howdyProperties This command will update the deployment config, called sample, to create an environmental variable called PROPERTIES with a value of howdy. Because we are creating this in the deployment configuration, the variable will be available to the application at run-time. All pods that are created with this deploy config will use this variable.
What about time zones?
OpenShift provides metrics on running pods via the web interface and via API. The metrics API is only available to OpenShift admins, but all users can view metrics on pods within their own projects via the UI. Basic commands are described here.
The OpenShift secrets functionality allows for storage and access of sensitive information. The OpenShift documentation can be found here. Key points: