{
    "apiVersion": "v1",
    "kind": "Template",
    "labels": {
        "rhdm": "7.5",
        "template": "rhdm75-optaweb-employee-rostering"
    },
    "message": "A new Decision Manager Optaweb employee rostering application have been created in your project.\n\nPlease be sure to create the secret named \"${OPTAWEB_HTTPS_SECRET}\" containing the ${OPTAWEB_HTTPS_KEYSTORE} file used for serving secure content.",
    "metadata": {
        "annotations": {
            "description": "Application template for a Optaweb Employee Rostering with a PostgreSQL database, for Red Hat Decision Manager 7.5 - Deprecated",
            "iconClass": "icon-jboss",
            "openshift.io/display-name": "Red Hat Decision Manager 7.5 Business Optimizer Employee Rostering with a PostgreSQL database",
            "openshift.io/provider-display-name": "Red Hat, Inc.",
            "tags": "rhdm,decisionserver,jboss,optaweb,employee-rostering,postgresql",
            "template.openshift.io/bindable": "false",
            "template.openshift.io/documentation-url": "https://access.redhat.com/documentation/en-us/red_hat_decision_manager/7.5/html/deploying_the_employee_roster_starter_application_for_red_hat_business_optimizer_on_red_hat_openshift_container_platform/",
            "template.openshift.io/long-description": "This web application assists the operations department to assign shifts to employees, for example in hospitals, factories, guard firms or call centers. It automatically finds the best employee for each shift, taking into account labor regulations, skill requirements, employee preferences and other constraints. Deprecated since Red Hat Decision Manager version 7.5.",
            "template.openshift.io/support-url": "https://access.redhat.com",
            "version": "7.5"
        },
        "name": "rhdm75-optaweb-employee-rostering"
    },
    "objects": [
        {
            "apiVersion": "v1",
            "kind": "ServiceAccount",
            "metadata": {
                "labels": {
                    "application": "${APPLICATION_NAME}"
                },
                "name": "${APPLICATION_NAME}-optaweb-employee-rostering"
            }
        },
        {
            "apiVersion": "v1",
            "kind": "RoleBinding",
            "metadata": {
                "labels": {
                    "application": "${APPLICATION_NAME}"
                },
                "name": "${APPLICATION_NAME}-optaweb-employee-rostering-view"
            },
            "roleRef": {
                "name": "view"
            },
            "subjects": [
                {
                    "kind": "ServiceAccount",
                    "name": "${APPLICATION_NAME}-optaweb-employee-rostering"
                }
            ]
        },
        {
            "apiVersion": "v1",
            "kind": "Service",
            "metadata": {
                "annotations": {
                    "description": "All the Optaweb employee rostering web server's ports."
                },
                "labels": {
                    "application": "${APPLICATION_NAME}",
                    "service": "${APPLICATION_NAME}-optaweb-employee-rostering"
                },
                "name": "${APPLICATION_NAME}-optaweb-employee-rostering"
            },
            "spec": {
                "ports": [
                    {
                        "name": "http",
                        "port": 8080,
                        "targetPort": 8080
                    },
                    {
                        "name": "https",
                        "port": 8443,
                        "targetPort": 8443
                    }
                ],
                "selector": {
                    "deploymentConfig": "${APPLICATION_NAME}-optaweb-employee-rostering"
                }
            }
        },
        {
            "apiVersion": "v1",
            "kind": "Service",
            "metadata": {
                "annotations": {
                    "description": "The JGroups ping port for clustering.",
                    "service.alpha.kubernetes.io/tolerate-unready-endpoints": "true"
                },
                "labels": {
                    "application": "${APPLICATION_NAME}",
                    "service": "${APPLICATION_NAME}-optaweb-employee-rostering"
                },
                "name": "${APPLICATION_NAME}-optaweb-employee-rostering-ping"
            },
            "spec": {
                "clusterIP": "None",
                "ports": [
                    {
                        "name": "ping",
                        "port": 8888,
                        "targetPort": 8888
                    }
                ],
                "selector": {
                    "deploymentConfig": "${APPLICATION_NAME}-optaweb-employee-rostering"
                }
            }
        },
        {
            "apiVersion": "v1",
            "kind": "Service",
            "metadata": {
                "annotations": {
                    "description": "The database server's port."
                },
                "labels": {
                    "application": "${APPLICATION_NAME}",
                    "service": "${APPLICATION_NAME}-postgresql"
                },
                "name": "${APPLICATION_NAME}-postgresql"
            },
            "spec": {
                "ports": [
                    {
                        "port": 5432,
                        "targetPort": 5432
                    }
                ],
                "selector": {
                    "deploymentConfig": "${APPLICATION_NAME}-postgresql"
                }
            }
        },
        {
            "apiVersion": "v1",
            "id": "${APPLICATION_NAME}-optaweb-employee-rostering-http",
            "kind": "Route",
            "metadata": {
                "annotations": {
                    "description": "Route for Optaweb employee rostering's http service."
                },
                "labels": {
                    "application": "${APPLICATION_NAME}",
                    "service": "${APPLICATION_NAME}-optaweb-employee-rostering"
                },
                "name": "${APPLICATION_NAME}-optaweb-employee-rostering"
            },
            "spec": {
                "host": "${OPTAWEB_HOSTNAME_HTTP}",
                "port": {
                    "targetPort": "http"
                },
                "to": {
                    "name": "${APPLICATION_NAME}-optaweb-employee-rostering"
                }
            }
        },
        {
            "apiVersion": "v1",
            "id": "${APPLICATION_NAME}-optaweb-employee-rostering-https",
            "kind": "Route",
            "metadata": {
                "annotations": {
                    "description": "Route for Optaweb employee rostering's https service."
                },
                "labels": {
                    "application": "${APPLICATION_NAME}",
                    "service": "${APPLICATION_NAME}-optaweb-employee-rostering"
                },
                "name": "secure-${APPLICATION_NAME}-optaweb-employee-rostering"
            },
            "spec": {
                "host": "${OPTAWEB_HOSTNAME_HTTPS}",
                "port": {
                    "targetPort": "https"
                },
                "tls": {
                    "termination": "passthrough"
                },
                "to": {
                    "name": "${APPLICATION_NAME}-optaweb-employee-rostering"
                }
            }
        },
        {
            "apiVersion": "v1",
            "kind": "DeploymentConfig",
            "metadata": {
                "annotations": {
                    "template.alpha.openshift.io/wait-for-ready": "true"
                },
                "labels": {
                    "application": "${APPLICATION_NAME}",
                    "service": "${APPLICATION_NAME}-optaweb-employee-rostering"
                },
                "name": "${APPLICATION_NAME}-optaweb-employee-rostering"
            },
            "spec": {
                "replicas": 1,
                "selector": {
                    "deploymentConfig": "${APPLICATION_NAME}-optaweb-employee-rostering"
                },
                "strategy": {
                    "type": "Recreate"
                },
                "template": {
                    "metadata": {
                        "labels": {
                            "application": "${APPLICATION_NAME}",
                            "deploymentConfig": "${APPLICATION_NAME}-optaweb-employee-rostering",
                            "service": "${APPLICATION_NAME}-optaweb-employee-rostering"
                        },
                        "name": "${APPLICATION_NAME}-optaweb-employee-rostering"
                    },
                    "spec": {
                        "containers": [
                            {
                                "env": [
                                    {
                                        "name": "KIE_ADMIN_USER",
                                        "value": "${OPTAWEB_ADMIN_USER}"
                                    },
                                    {
                                        "name": "KIE_ADMIN_PWD",
                                        "value": "${OPTAWEB_ADMIN_PWD}"
                                    },
                                    {
                                        "name": "DATASOURCES",
                                        "value": "RHDM"
                                    },
                                    {
                                        "name": "RHDM_JNDI",
                                        "value": "${OPTAWEB_PERSISTENCE_DS}"
                                    },
                                    {
                                        "name": "RHDM_PERSISTENCE_DIALECT",
                                        "value": "org.hibernate.dialect.PostgreSQLDialect"
                                    },
                                    {
                                        "name": "RHDM_XA_CONNECTION_PROPERTY_DatabaseName",
                                        "value": "${OPTAWEB_POSTGRESQL_DB}"
                                    },
                                    {
                                        "name": "RHDM_DRIVER",
                                        "value": "postgresql"
                                    },
                                    {
                                        "name": "RHDM_USERNAME",
                                        "value": "${OPTAWEB_POSTGRESQL_USER}"
                                    },
                                    {
                                        "name": "RHDM_PASSWORD",
                                        "value": "${OPTAWEB_POSTGRESQL_PWD}"
                                    },
                                    {
                                        "name": "RHDM_XA_CONNECTION_PROPERTY_ServerName",
                                        "value": "${APPLICATION_NAME}-postgresql"
                                    },
                                    {
                                        "name": "RHDM_XA_CONNECTION_PROPERTY_PortNumber",
                                        "value": "5432"
                                    },
                                    {
                                        "name": "OPTAWEB_EMPLOYEE_ROSTERING_PERSISTENCE_DATASOURCE",
                                        "value": "${OPTAWEB_PERSISTENCE_DS}"
                                    },
                                    {
                                        "name": "OPTAWEB_EMPLOYEE_ROSTERING_PERSISTENCE_DIALECT",
                                        "value": "org.hibernate.dialect.PostgreSQLDialect"
                                    },
                                    {
                                        "name": "OPTAWEB_EMPLOYEE_ROSTERING_PERSISTENCE_HBM2DDL_AUTO",
                                        "value": "${OPTAWEB_PERSISTENCE_HBM2DDL_AUTO}"
                                    },
                                    {
                                        "name": "OPTAWEB_GENERATOR_ZONE_ID",
                                        "value": "${OPTAWEB_GENERATOR_ZONE_ID}"
                                    },
                                    {
                                        "name": "RHDM_JTA",
                                        "value": "true"
                                    },
                                    {
                                        "name": "HTTPS_KEYSTORE_DIR",
                                        "value": "/etc/optaweb-employee-rostering-secret-volume"
                                    },
                                    {
                                        "name": "HTTPS_KEYSTORE",
                                        "value": "${OPTAWEB_HTTPS_KEYSTORE}"
                                    },
                                    {
                                        "name": "HTTPS_NAME",
                                        "value": "${OPTAWEB_HTTPS_NAME}"
                                    },
                                    {
                                        "name": "HTTPS_PASSWORD",
                                        "value": "${OPTAWEB_HTTPS_PASSWORD}"
                                    },
                                    {
                                        "name": "JGROUPS_PING_PROTOCOL",
                                        "value": "openshift.DNS_PING"
                                    },
                                    {
                                        "name": "OPENSHIFT_DNS_PING_SERVICE_NAME",
                                        "value": "${APPLICATION_NAME}-optaweb-employee-rostering-ping"
                                    },
                                    {
                                        "name": "OPENSHIFT_DNS_PING_SERVICE_PORT",
                                        "value": "8888"
                                    }
                                ],
                                "image": "${OPTAWEB_IMAGE_STREAM_NAME}",
                                "imagePullPolicy": "Always",
                                "livenessProbe": {
                                    "failureThreshold": 3,
                                    "httpGet": {
                                        "path": "/swagger/index.html",
                                        "port": 8080,
                                        "scheme": "HTTP"
                                    },
                                    "initialDelaySeconds": 180,
                                    "periodSeconds": 15,
                                    "timeoutSeconds": 2
                                },
                                "name": "${APPLICATION_NAME}-optaweb-employee-rostering",
                                "ports": [
                                    {
                                        "containerPort": 8778,
                                        "name": "jolokia",
                                        "protocol": "TCP"
                                    },
                                    {
                                        "containerPort": 8080,
                                        "name": "http",
                                        "protocol": "TCP"
                                    },
                                    {
                                        "containerPort": 8443,
                                        "name": "https",
                                        "protocol": "TCP"
                                    },
                                    {
                                        "containerPort": 8888,
                                        "name": "ping",
                                        "protocol": "TCP"
                                    }
                                ],
                                "readinessProbe": {
                                    "failureThreshold": 6,
                                    "httpGet": {
                                        "path": "/swagger/index.html",
                                        "port": 8080,
                                        "scheme": "HTTP"
                                    },
                                    "initialDelaySeconds": 60,
                                    "periodSeconds": 30,
                                    "timeoutSeconds": 2
                                },
                                "resources": {
                                    "limits": {
                                        "memory": "${OPTAWEB_MEMORY_LIMIT}"
                                    }
                                },
                                "volumeMounts": [
                                    {
                                        "mountPath": "/etc/optaweb-employee-rostering-secret-volume",
                                        "name": "optaweb-employee-rostering-keystore-volume",
                                        "readOnly": true
                                    }
                                ]
                            }
                        ],
                        "serviceAccountName": "${APPLICATION_NAME}-optaweb-employee-rostering",
                        "terminationGracePeriodSeconds": 60,
                        "volumes": [
                            {
                                "name": "optaweb-employee-rostering-keystore-volume",
                                "secret": {
                                    "secretName": "${OPTAWEB_HTTPS_SECRET}"
                                }
                            }
                        ]
                    }
                },
                "triggers": [
                    {
                        "imageChangeParams": {
                            "automatic": true,
                            "containerNames": [
                                "${APPLICATION_NAME}-optaweb-employee-rostering"
                            ],
                            "from": {
                                "kind": "ImageStreamTag",
                                "name": "${OPTAWEB_IMAGE_STREAM_NAME}:${IMAGE_STREAM_TAG}",
                                "namespace": "${IMAGE_STREAM_NAMESPACE}"
                            }
                        },
                        "type": "ImageChange"
                    },
                    {
                        "type": "ConfigChange"
                    }
                ]
            }
        },
        {
            "apiVersion": "v1",
            "kind": "DeploymentConfig",
            "metadata": {
                "annotations": {
                    "template.alpha.openshift.io/wait-for-ready": "true"
                },
                "labels": {
                    "application": "${APPLICATION_NAME}",
                    "service": "${APPLICATION_NAME}-postgresql"
                },
                "name": "${APPLICATION_NAME}-postgresql"
            },
            "spec": {
                "replicas": 1,
                "selector": {
                    "deploymentConfig": "${APPLICATION_NAME}-postgresql"
                },
                "strategy": {
                    "type": "Recreate"
                },
                "template": {
                    "metadata": {
                        "labels": {
                            "application": "${APPLICATION_NAME}",
                            "deploymentConfig": "${APPLICATION_NAME}-postgresql",
                            "service": "${APPLICATION_NAME}-postgresql"
                        },
                        "name": "${APPLICATION_NAME}-postgresql"
                    },
                    "spec": {
                        "containers": [
                            {
                                "env": [
                                    {
                                        "name": "POSTGRESQL_USER",
                                        "value": "${OPTAWEB_POSTGRESQL_USER}"
                                    },
                                    {
                                        "name": "POSTGRESQL_PASSWORD",
                                        "value": "${OPTAWEB_POSTGRESQL_PWD}"
                                    },
                                    {
                                        "name": "POSTGRESQL_DATABASE",
                                        "value": "${OPTAWEB_POSTGRESQL_DB}"
                                    },
                                    {
                                        "name": "POSTGRESQL_MAX_PREPARED_TRANSACTIONS",
                                        "value": "${POSTGRESQL_MAX_PREPARED_TRANSACTIONS}"
                                    }
                                ],
                                "image": "postgresql",
                                "imagePullPolicy": "Always",
                                "livenessProbe": {
                                    "exec": {
                                        "command": [
                                            "/usr/libexec/check-container",
                                            "--live"
                                        ]
                                    },
                                    "initialDelaySeconds": 120,
                                    "timeoutSeconds": 10
                                },
                                "name": "${APPLICATION_NAME}-postgresql",
                                "ports": [
                                    {
                                        "containerPort": 5432,
                                        "protocol": "TCP"
                                    }
                                ],
                                "readinessProbe": {
                                    "exec": {
                                        "command": [
                                            "/usr/libexec/check-container"
                                        ]
                                    },
                                    "initialDelaySeconds": 5,
                                    "timeoutSeconds": 1
                                },
                                "volumeMounts": [
                                    {
                                        "mountPath": "/var/lib/pgsql/data",
                                        "name": "${APPLICATION_NAME}-postgresql-pvol"
                                    }
                                ]
                            }
                        ],
                        "terminationGracePeriodSeconds": 60,
                        "volumes": [
                            {
                                "name": "${APPLICATION_NAME}-postgresql-pvol",
                                "persistentVolumeClaim": {
                                    "claimName": "${APPLICATION_NAME}-postgresql-claim"
                                }
                            }
                        ]
                    }
                },
                "triggers": [
                    {
                        "imageChangeParams": {
                            "automatic": true,
                            "containerNames": [
                                "${APPLICATION_NAME}-postgresql"
                            ],
                            "from": {
                                "kind": "ImageStreamTag",
                                "name": "postgresql:${POSTGRESQL_IMAGE_STREAM_TAG}",
                                "namespace": "${POSTGRESQL_IMAGE_STREAM_NAMESPACE}"
                            }
                        },
                        "type": "ImageChange"
                    },
                    {
                        "type": "ConfigChange"
                    }
                ]
            }
        },
        {
            "apiVersion": "v1",
            "kind": "PersistentVolumeClaim",
            "metadata": {
                "labels": {
                    "application": "${APPLICATION_NAME}",
                    "service": "${APPLICATION_NAME}-postgresql"
                },
                "name": "${APPLICATION_NAME}-postgresql-claim"
            },
            "spec": {
                "accessModes": [
                    "ReadWriteOnce"
                ],
                "resources": {
                    "requests": {
                        "storage": "${DB_VOLUME_CAPACITY}"
                    }
                }
            }
        }
    ],
    "parameters": [
        {
            "description": "The name for the application.",
            "displayName": "Application Name",
            "name": "APPLICATION_NAME",
            "required": true,
            "value": "myapp"
        },
        {
            "description": "OptaWeb administrator username",
            "displayName": "OptaWeb Admin User",
            "name": "OPTAWEB_ADMIN_USER",
            "required": false,
            "value": "adminUser"
        },
        {
            "description": "OptaWeb administrator password",
            "displayName": "OptaWeb Admin Password",
            "from": "[a-zA-Z]{6}[0-9]{1}!",
            "generate": "expression",
            "name": "OPTAWEB_ADMIN_PWD",
            "required": false
        },
        {
            "description": "Namespace in which the ImageStreams for Red Hat Decision Manager images are installed. These ImageStreams are normally installed in the openshift namespace. You should only need to modify this if you installed the ImageStreams in a different namespace/project.",
            "displayName": "ImageStream Namespace",
            "name": "IMAGE_STREAM_NAMESPACE",
            "required": true,
            "value": "openshift"
        },
        {
            "description": "The name of the image stream to use for Optaweb employee rostering. Default is \"rhdm-optaweb-employee-rostering-rhel8\".",
            "displayName": "Optaweb Employee Rostering ImageStream Name",
            "name": "OPTAWEB_IMAGE_STREAM_NAME",
            "required": true,
            "value": "rhdm-optaweb-employee-rostering-rhel8"
        },
        {
            "description": "A named pointer to an image in an image stream. Default is \"7.5.1\".",
            "displayName": "ImageStream Tag",
            "name": "IMAGE_STREAM_TAG",
            "required": true,
            "value": "7.5.1"
        },
        {
            "description": "Optaweb employee rostering persistence datasource (Sets the org.optaweb.employeerostering.persistence.datasource system property)",
            "displayName": "Optaweb Employee Rostering Persistence Datasource",
            "name": "OPTAWEB_PERSISTENCE_DS",
            "required": true,
            "value": "java:/jboss/datasources/optaweb"
        },
        {
            "description": "Optaweb employee rostering persistence hbm2ddl auto (Sets the org.optaweb.employeerostering.persistence.hbm2ddl.auto system property)",
            "displayName": "Optaweb Employee Rostering Persistence HBM2DDL Auto",
            "example": "update",
            "name": "OPTAWEB_PERSISTENCE_HBM2DDL_AUTO",
            "required": false
        },
        {
            "description": "Optaweb employee rostering PostgreSQL database username",
            "displayName": "Optaweb Employee Rostering PostgreSQL Database User",
            "name": "OPTAWEB_POSTGRESQL_USER",
            "required": false,
            "value": "optaweb"
        },
        {
            "description": "Optaweb employee rostering PostgreSQL database password",
            "displayName": "Optaweb Employee Rostering PostgreSQL Database Password",
            "from": "[a-zA-Z]{6}[0-9]{1}!",
            "generate": "expression",
            "name": "OPTAWEB_POSTGRESQL_PWD",
            "required": false
        },
        {
            "description": "Optaweb employee rostering PostgreSQL database name",
            "displayName": "Optaweb Employee Rostering PostgreSQL Database Name",
            "name": "OPTAWEB_POSTGRESQL_DB",
            "required": false,
            "value": "optaweb"
        },
        {
            "description": "Namespace in which the ImageStream for the PostgreSQL image is installed. The ImageStream is already installed in the openshift namespace. You should only need to modify this if you installed the ImageStream in a different namespace/project. Default is \"openshift\".",
            "displayName": "PostgreSQL ImageStream Namespace",
            "name": "POSTGRESQL_IMAGE_STREAM_NAMESPACE",
            "required": false,
            "value": "openshift"
        },
        {
            "description": "The PostgreSQL image version, which is intended to correspond to the PostgreSQL version. Default is \"10\".",
            "displayName": "PostgreSQL ImageStream Tag",
            "name": "POSTGRESQL_IMAGE_STREAM_TAG",
            "required": false,
            "value": "10"
        },
        {
            "description": "Allows the PostgreSQL to handle XA transactions.",
            "displayName": "PostgreSQL Database max prepared connections",
            "name": "POSTGRESQL_MAX_PREPARED_TRANSACTIONS",
            "required": true,
            "value": "100"
        },
        {
            "description": "Size of persistent storage for database volume.",
            "displayName": "Database Volume Capacity",
            "name": "DB_VOLUME_CAPACITY",
            "required": true,
            "value": "1Gi"
        },
        {
            "description": "Custom hostname for http service route, if set will also configure the OPTAWEB_HOST. Leave blank for default hostname, e.g.: <application-name>-optaweb-employee-rostering-<project>.<default-domain-suffix>",
            "displayName": "Optaweb Employee Rostering Custom http Route Hostname",
            "name": "OPTAWEB_HOSTNAME_HTTP",
            "required": false,
            "value": ""
        },
        {
            "description": "Custom hostname for https service route.  Leave blank for default hostname, e.g.: secure-<application-name>-optaweb-employee-rostering-<project>.<default-domain-suffix>",
            "displayName": "Optaweb Employee Rostering Custom https Route Hostname",
            "name": "OPTAWEB_HOSTNAME_HTTPS",
            "required": false,
            "value": ""
        },
        {
            "description": "The name of the secret containing the keystore file",
            "displayName": "Optaweb Employee Rostering Keystore Secret Name",
            "example": "optaweb-employee-rostering-app-secret",
            "name": "OPTAWEB_HTTPS_SECRET",
            "required": true
        },
        {
            "description": "The name of the keystore file within the secret",
            "displayName": "Optaweb Employee Rostering Keystore Filename",
            "name": "OPTAWEB_HTTPS_KEYSTORE",
            "required": false,
            "value": "keystore.jks"
        },
        {
            "description": "The name associated with the server certificate",
            "displayName": "Optaweb Employee Rostering Certificate Name",
            "name": "OPTAWEB_HTTPS_NAME",
            "required": false,
            "value": "jboss"
        },
        {
            "description": "The password for the keystore and certificate",
            "displayName": "Optaweb Employee Rostering Keystore Password",
            "name": "OPTAWEB_HTTPS_PASSWORD",
            "required": false,
            "value": "mykeystorepass"
        },
        {
            "description": "Optaweb employee rostering Container memory limit",
            "displayName": "Optaweb Employee Rostering Container Memory Limit",
            "name": "OPTAWEB_MEMORY_LIMIT",
            "required": false,
            "value": "1Gi"
        },
        {
            "description": "The timezone id used by the OptaWeb Generator (Sets the optaweb.generator.zoneId system property; defaults to local timezone)",
            "displayName": "Optaweb Employee Rostering Generator Zone ID",
            "name": "OPTAWEB_GENERATOR_ZONE_ID",
            "required": false,
            "value": ""
        }
    ]
}