| | |
| | | shell: "oc new-app --name employee-rostering \ |
| | | --strategy=docker \ |
| | | java:8~{{optaweb_git_repository}}#{{optaweb_git_branch}} \ |
| | | -e JAVA_TOOL_OPTIONS=\"-XX:InitialHeapSize=4g -XX:MaxHeapSize=8g\" \ |
| | | -e JAVA_TOOL_OPTIONS=\"-XX:InitialHeapSize=1g -XX:MaxHeapSize=4g\" \ |
| | | -n {{ocp_project}}" |
| | | |
| | | - name: "Share PostgreSQL secret with OptaWeb app" |
| | | shell: "oc set env dc/employee-rostering --from=secret/postgresql -n {{ocp_project}}" |
| | | |
| | | # The memory limit needs to be higher than actual maximum JVM memory consumption. |
| | | # Recommendation: set the memory limit to MaxHeapSize + 1 GiB. |
| | | # |
| | | # If JVM memory consumption exceeds container memory limit, the JVM process will be killed by OOM killer. |
| | | # More info: |
| | | # - https://docs.openshift.com/container-platform/3.11/dev_guide/application_memory_sizing.html |
| | | # - https://docs.openshift.com/container-platform/3.11/dev_guide/compute_resources.html |
| | | # Also note that cluster has a Limit Range defining maximum resource limits containers/pods can ask. |
| | | # Verify the max memory limit at Administration > Limit Ranges before increasing the limit. |
| | | - name: "Set OptaWeb's resource requests and limits" |
| | | shell: "oc set resources dc employee-rostering \ |
| | | --limits=cpu=2,memory=5Gi \ |
| | | --requests=cpu=1,memory=1Gi \ |
| | | -n {{ocp_project}}" |
| | | |
| | | - name: "Expose the service" |
| | | shell: "oc expose svc/employee-rostering -n {{ocp_project}}" |
| | | |