apiVersion: apps/v1
kind: Deployment
metadata:
  name: userinfo
  labels:
    app: userinfo
spec:
  replicas: 1
  selector:
    matchLabels:
      app: userinfo
  template:
    metadata:
      labels:
        app: userinfo
    spec:
      containers:
        - name: userinfo
          image: "279559645400.dkr.ecr.us-west-1.amazonaws.com/solui/solumina-user-info:G8R2i020"
          env:
            - name: JAVA_HOME
              value: /usr/local/openjdk-11
          ports:
            - containerPort: 8091
          livenessProbe:
            httpGet:
              path: /solumina-user-info/health
              port: http
            initialDelaySeconds: 300
            failureThreshold: 3
            periodSeconds: 30
          volumeMounts:
            - mountPath: /opt/solumina-user-info/lib
              name: driver
              readOnly: true

            - mountPath: /opt/solumina-user-info/config/application-mongodb.yml
              name: application-mongodb
              subPath: application-mongodb.yml

            - mountPath: /opt/solumina-user-info/config/application-sqlserver.yml
              name: application-sqlserver
              subPath: application-sqlserver.yml

            - mountPath: /opt/solumina-user-info/config/application.yml
              name: application
              subPath: application.yml

            - mountPath: /opt/solumina-user-info/config/loader.properties
              name: loader
              subPath: loader.properties

            - mountPath: /opt/solumina-user-info/config/logback.xml
              name: logback
              subPath: logback.xml

            - mountPath: /opt/solumina-user-info/config/redis.properties
              name: redis
              subPath: redis.properties

            - mountPath: /opt/solumina-user-info/logs
              name: logs
              readOnly: false

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

      volumes:
        - configMap:
            name: userinfo-applicationmongodb-cm
          name: application-mongodb

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

        - configMap:
            name: userinfo-application-cm
          name: application

        - configMap:
            name: userinfo-loader-cm
          name: loader

        - configMap:
            name: userinfo-logback-cm
          name: logback

        - configMap:
            name: userinfo-redis-cm
          name: redis

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

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

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