apiVersion: apps/v1
kind: Deployment
metadata:
  name: elk-cron
  labels:
    app: elk-cron
spec:
  replicas: 1
  selector:
    matchLabels:
      app: elk-cron
  template:
    metadata:
      labels:
        app: elk-cron
    spec:
      containers:
        - image: 279559645400.dkr.ecr.us-west-1.amazonaws.com/solui/solumina-elk:G8R2i020
          imagePullPolicy: Always
          env:
            - name: JAVA_HOME
              value: /usr/local/openjdk-11
          name: elk-cron
          ports:
            - containerPort: 9090
          resources:
            requests:
              cpu: 200m
              memory: 300Mi

          volumeMounts:
            - mountPath: /opt/solumina-elk/application-sqlserver.yml
              name: application-sqlserver
              subPath: application-sqlserver.yml

            - mountPath: /opt/solumina-elk/application.yml
              name: application
              subPath: application.yml

            - mountPath: /opt/solumina-elk/loader.properties
              name: loader
              subPath: loader.properties

            - mountPath: /opt/solumina-elk/logback.xml
              name: logback
              subPath: logback.xml

            - mountPath: /opt/solumina-elk/redis.properties
              name: redis
              subPath: redis.properties

            - mountPath: /opt/solumina-elk/lib
              name: driver
              readOnly: true

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

      volumes:
        - configMap:
            name: elk-cron-application-sqlserver-cm
          name: application-sqlserver

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

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

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

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

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

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

      restartPolicy: Always
status: {}
