apiVersion: apps/v1
kind: Deployment
metadata:
  name: cron
  labels:
    app: cron
spec:
  replicas: 1
  selector:
    matchLabels:
      app: cron
  template:
    metadata:
      labels:
        app: cron
    spec:
      nodeSelector:
        app: app
      containers:
        - image: 279559645400.dkr.ecr.us-west-1.amazonaws.com/solui/solumina-cron-microservice:G8R2i020
          imagePullPolicy: Always
          env:
            - name: JAVA_OPTS
              value: -Duser.timezone=--DB_TIMEZONE--
            - name: JAVA_HOME
              value: /usr/local/openjdk-11
            - name: CRON_DB_TIMEZONE
              value: --DB_TIMEZONE--
          name: cron
          ports:
            - containerPort: 8092
          volumeMounts:
            - mountPath: /opt/solumina-cron-microservice/lib
              name: driver
              readOnly: true

            - mountPath: /opt/solumina-cron-microservice/config/application-oracle.yml
              name: application-oracle
              subPath: application-oracle.yml

            - mountPath: /opt/solumina-cron-microservice/config/application-sqlserver.yml
              name: application-sqlserver
              subPath: application-sqlserver.yml

            - mountPath: /opt/solumina-cron-microservice/config/application.yml
              name: application
              subPath: application.yml

            - mountPath: /opt/solumina-cron-microservice/config/loader.properties
              name: loader
              subPath: loader.properties

            - mountPath: /opt/solumina-cron-microservice/config/logback.xml
              name: logback
              subPath: logback.xml

            - mountPath: /opt/solumina-cron-microservice/config/redis.properties
              name: redis
              subPath: redis.properties

            - mountPath: /opt/config/containerJRE
              name: customjre
              readOnly: true

            - mountPath: /opt/solumina-cron-microservice/logs
              name: logs
              readOnly: false

      volumes:
        - name: driver
          nfs:
            server: --fs--.efs.--region--.amazonaws.com
            path: /driver

        - name: customjre
          nfs:
            server: --fs--.efs.--region--.amazonaws.com
            path: /customJRE11-driver

        - name: logs
          nfs:
            server: --fs--.efs.--region--.amazonaws.com
            path: /logs/cron

        - configMap:
            name: cron-applicationoracle-cm
          name: application-oracle

        - configMap:
            name: cron-applicationsqlserver-cm
          name: application-sqlserver

        - configMap:
            name: cron-application-cm
          name: application

        - configMap:
            name: cron-loader-cm
          name: loader

        - configMap:
            name: cron-logback-cm
          name: logback

        - configMap:
            name: cron-redis-cm
          name: redis

      restartPolicy: Always
status: {}
