--- kind: Template apiVersion: v1 metadata: name: ec-console annotations: openshift.io/display-name: Everyware Cloud Console description: Everyware Cloud Console service. iconClass: icon-ec tags: ec,console template.openshift.io/long-description: This template provides a standalone Console server. template.openshift.io/provider-display-name: Eurotech S.p.A. template.openshift.io/support-url: https://support.eurotech.com message: "The following service(s) have been created in your project: ${EC_SERVICE_NAME}." labels: template: ec-console-template objects: - kind: Service apiVersion: v1 metadata: name: "${EC_SERVICE_NAME}" spec: ports: - name: "${EC_SERVICE_NAME}" protocol: TCP port: 8080 targetPort: 8080 selector: app: "${EC_SERVICE_NAME}" deploymentconfig: "${EC_SERVICE_NAME}" - apiVersion: v1 kind: Route metadata: annotations: openshift.io/host.generated: "true" creationTimestamp: null labels: template: ${EC_SERVICE_NAME}-template name: ${EC_SERVICE_NAME} spec: # host: ${EC_SERVICE_NAME}-${NAMESPACE}.apps.iot-dev.openshift.opentlc.com port: targetPort: ${EC_SERVICE_NAME} to: kind: Service name: ${EC_SERVICE_NAME} weight: 100 wildcardPolicy: None # status: # ingress: # - conditions: # - lastTransitionTime: 2018-06-21T14:32:36Z # status: "True" # type: Admitted # host: ec-console-iot-demo-1234.apps.iot-dev.openshift.opentlc.com # routerName: router # wildcardPolicy: None - apiVersion: v1 kind: DeploymentConfig metadata: generation: 1 labels: app: "${EC_SERVICE_NAME}" name: "${EC_SERVICE_NAME}" spec: replicas: 1 strategy: type: Recreate selector: app: "${EC_SERVICE_NAME}" deploymentconfig: "${EC_SERVICE_NAME}" template: metadata: labels: app: "${EC_SERVICE_NAME}" deploymentconfig: "${EC_SERVICE_NAME}" spec: imagePullSecrets: - name: redhat-iot-rhpds-pull-secret containers: - env: - name: DB_NAME valueFrom: secretKeyRef: name: "${EC_SECRET_DB}" key: name - name: DB_USERNAME valueFrom: secretKeyRef: name: "${EC_SECRET_DB}" key: username - name: DB_PASSWORD valueFrom: secretKeyRef: name: "${EC_SECRET_DB}" key: password - name: JAVA_OPTS value: -Xmx1G -Dcommons.db.connection.host=$MARIADB_SERVICE_HOST -Dcommons.db.connection.port=$MARIADB_SERVICE_PORT -Dcommons.db.jdbcConnectionUrlResolver=${DB_RESOLVER} -Dcommons.db.jdbc.driver=${DB_DRIVER} -Dcommons.db.connection.scheme=${DB_CONNECTION_SCHEME} -Dcommons.db.schema=${DB_SCHEMA_NAME} -Dcommons.db.schema.update=${DB_SCHEMA_UPDATE} -Dcommons.db.name=${DB_NAME} -Dcommons.db.username=${DB_USERNAME} -Dcommons.db.password=${DB_PASSWORD} -Dbroker.host=$EC_BROKER_MQTT_PORT_1883_TCP_ADDR -Ddatastore.elasticsearch.nodes=$ELASTICSEARCH_PORT_9200_TCP_ADDR -Ddatastore.elasticsearch.port=$ELASTICSEARCH_PORT_9200_TCP_PORT -Dcertificate.jwt.private.key=file:///tmp/key.pk8 -Dcertificate.jwt.certificate=file:///tmp/cert.pem -Dkapua.config.dir=/etc/opt/ec/defaults ${JAVA_OPTS_EXTRA} image: "quay.io/redhat-iot/${EC_SERVICE_NAME}:${IMAGE_VERSION}" imagePullPolicy: IfNotPresent name: "${EC_SERVICE_NAME}" ports: - containerPort: 8080 readinessProbe: httpGet: path: / port: 8080 initialDelaySeconds: 180 timeoutSeconds: 5 failureThreshold: 5 periodSeconds: 10 livenessProbe: timeoutSeconds: 5 initialDelaySeconds: 120 httpGet: path: / port: 8080 resources: limits: memory: "${MEMORY_LIMIT}" restartPolicy: Always terminationGracePeriodSeconds: 30 securityContext: runAsUser: 1000 parameters: - name: IMAGE_VERSION description: The version of the image to use value: latest - name: MEMORY_LIMIT displayName: Memory Limit description: Maximum amount of memory the container can use. value: 2Gi required: true - name: NAMESPACE displayName: Namespace description: The OpenShift Namespace where the ImageStream resides. value: ec - name: EC_SERVICE_NAME displayName: EC api Service Name description: The name of the OpenShift Service. value: ec-console required: true # - name: BROKER_HOST # description: Address of the broker service # value: ec-broker.ec.svc.cluster.local # required: true # - name: STORAGE_HOST # description: Address of the storage service # value: elasticsearch.ec.svc.cluster.local # required: true # - name: STORAGE_PORT # description: Port of the storage service # value: "9200" # required: true # - name: DB_HOST # description: Address of the DB # value: mariadb.ec.svc.cluster.local # required: true # - name: DB_PORT # description: The version of the image to use # value: "3306" # required: true - name: DB_SCHEMA_NAME description: Automatically update DB schema value: "ecdb" required: true - name: DB_SCHEMA_UPDATE description: Automatically update DB schema value: "true" required: true - name: DB_RESOLVER description: JDBC connection URL resolver value: MariaDB required: true - name: DB_DRIVER description: JDBC driver value: org.mariadb.jdbc.Driver required: true - name: DB_CONNECTION_SCHEME description: JDBC connection scheme value: jdbc:mariadb required: true - name: EC_SECRET_DB description: Name of the secret containing DB credentials value: "ec-db" required: true