apiVersion: apps/v1
kind: Deployment
metadata:
  name: assessment-svc
  annotations:
    monitor: monitor
    javaDebug: javaDebug
    pullSecrets: pullSecrets
spec:
  replicas: 1
  selector:
    matchLabels:
      app: assessment-svc
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 2
      maxUnavailable: 0
  template:
    metadata:
      labels:
        app: assessment-svc
    spec:
      containers:
      - image: assessment-service
        name: spring-boot-service-container
        imagePullPolicy: IfNotPresent
        livenessProbe:
          httpGet:
            path: /assessment/monitoring/health
            port: 8080
          initialDelaySeconds: 180
          periodSeconds: 31
          timeoutSeconds: 5
          successThreshold: 1
          failureThreshold: 3
        readinessProbe:
          httpGet:
            path: /assessment/monitoring/health
            port: 8080
          initialDelaySeconds: 180
          periodSeconds: 5
          timeoutSeconds: 5
          successThreshold: 1
          failureThreshold: 1
        env:
          - name: IFS_WEB_GOOGLEANALYTICS_TRACKINGID
            valueFrom:
              configMapKeyRef:
                name: web-config
                key: IFS_WEB_GOOGLEANALYTICS_TRACKINGID
          - name: IFS_WEB_SYSTEM_USER_UID
            valueFrom:
              configMapKeyRef:
                name: web-config
                key: IFS_WEB_SYSTEM_USER_UID
          - name: SPRING_APPLICATION_JSON
            valueFrom:
              configMapKeyRef:
                name: web-config
                key: SPRING_APPLICATION_JSON
          - name: NEW_RELIC_LICENSE_KEY
            valueFrom:
              configMapKeyRef:
                name: new-relic-config
                key: NEW_RELIC_LICENSE_KEY
          - name: NEW_RELIC_LOG
            valueFrom:
              configMapKeyRef:
                name: new-relic-config
                key: NEW_RELIC_LOG
          - name: IFS_SUBSIDY_CONTROL_NORTHERN_IRELAND_ENABLED
            valueFrom:
              configMapKeyRef:
                name: feature-toggle-config
                key: IFS_SUBSIDY_CONTROL_NORTHERN_IRELAND_ENABLED
          - name: SPRING_PROFILES_ACTIVE
            valueFrom:
              configMapKeyRef:
                name: spring-config
                key: SPRING_PROFILES_ACTIVE
          - name: IFS_WEB_BASEURL
            valueFrom:
              configMapKeyRef:
                name: web-config
                key: IFS_WEB_BASEURL
          - name: JAVA_OPTS
            value: -Xms750m -Xmx750m -javaagent:/newrelic.jar
          - name: NEW_RELIC_APP_NAME
            value: "ifs-assessment-service (${openshiftEnv})"
        ports:
          - containerPort: 8080
        resources:
          limits:
            cpu: 1000m
          requests:
            cpu: 100m
            memory: 1G