apiVersion: apps/v1
kind: Deployment
metadata:
  name: adapter-p360-arkiv-ra-no
spec:
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
  selector:
    matchLabels:
      app: adapter-p360-arkiv-ra-no
  template:
    metadata:
      labels:
        app: adapter-p360-arkiv-ra-no
    spec:
      restartPolicy: Always
      volumes:
        - name: tempdir
          emptyDir: {}
      containers:
        - name: adapter-p360-arkiv-ra-no-ra-no
          image: fintlabs.azurecr.io/p360-arkiv-adapter:build.48
          resources:
            limits:
              memory: "2Gi"
              cpu: "2"
            requests:
              memory: "1Gi"
              cpu: "250m"
          ports:
            - containerPort: 8091
          readinessProbe:
            httpGet:
              path: /health
              port: 8091
            initialDelaySeconds: 10
            timeoutSeconds: 5
          volumeMounts:
            - name: tempdir
              mountPath: /temp
          env:
            - {name: TZ, value: Europe/Oslo}
            - name: JAVA_TOOL_OPTIONS
              value: >-
                -Xmx1G -verbose:gc
                -XX:+ExitOnOutOfMemoryError
                -Dfile.encoding=UTF-8
                -Dhttps.proxyHost=10.10.10.4
                -Dhttps.proxyPort=8888
                -Dhttp.nonProxyHosts="localhost|*.felleskomponent.no"
                -Dcom.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true
                -Dcom.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.dump=true
                -Dcom.sun.xml.ws.transport.http.HttpAdapter.dump=true
                -Dcom.sun.xml.internal.ws.transport.http.HttpAdapter.dump=true
                -Dcom.sun.xml.internal.ws.transport.http.HttpAdapter.dumpTreshold=100000
            - {name: springfox.title, value: "Public 360 Adapter for Riksantikvaren"}
            - {name: security.basic.enabled, value: "false"}
            - {name: fint.adapter.organizations, value: ra.no}
            - {name: fint.oauth.enabled, value: 'true'}
            - {name: fint.oauth.username, valueFrom: {secretKeyRef: {name: ra-p360-adapter, key: username}}}
            - {name: fint.oauth.password, valueFrom: {secretKeyRef: {name: ra-p360-adapter, key: password}}}
            - {name: fint.oauth.access-token-uri, value: 'https://idp.felleskomponent.no/nidp/oauth/nam/token'}
            - {name: fint.oauth.client-id, valueFrom: {secretKeyRef: {name: ra-p360-adapter, key: client-id}}}
            - {name: fint.oauth.client-secret, valueFrom: {secretKeyRef: {name: ra-p360-adapter, key: client-secret}}}
            - {name: fint.oauth.scope, value: 'fint-client'}
            - {name: fint.adapter.reject-unknown-events, value: 'false'}
            - {name: fint.p360.title.format.tilskuddfartoy, value: '${kallesignal} - ${fartoyNavn} - Tilskudd - ${kulturminneId} - ${soknadsnummer.identifikatorverdi}'}
            - {name: fint.p360.defaults.casetype.tilskudd-fartoy.administrativEnhet, value: '100072'}
            - {name: fint.p360.defaults.casetype.tilskudd-fartoy.arkivdel, value: '205461'}
            - {name: fint.p360.defaults.casetype.tilskudd-fartoy.saksstatus, value: '5'}
            - {name: fint.p360.defaults.casetype.tilskudd-fartoy.klasse, value: 'recno:209823'}
            - {name: fint.p360.defaults.casetype.tilskudd-fartoy.klassifikasjon, value: 'recno:205465'}
            - {name: fint.p360.defaults.casetype.tilskudd-fartoy.korrespondansepartType, value: '5'}
            - {name: fint.p360.defaults.casetype.tilskudd-fartoy.journalpostType, value: '110'}
            - {name: fint.p360.defaults.casetype.tilskudd-fartoy.journalstatus, value: '3'}
            - {name: fint.p360.defaults.casetype.tilskudd-fartoy.dokumentstatus, value: '1'}
            - {name: fint.p360.defaults.casetype.tilskudd-fartoy.dokumentType, value: '1'}
            - {name: fint.p360.defaults.casetype.tilskudd-fartoy.tilknyttetRegistreringSom, value: '1'}
            - {name: fint.p360.wsdl-location, value: '/data'}
            - {name: fint.p360.user, valueFrom: {secretKeyRef: {name: ra-p360-adapter, key: p360-user}}}
            - {name: fint.p360.password, valueFrom: {secretKeyRef: {name: ra-p360-adapter, key: p360-password}}}
            - {name: fint.p360.endpoint-base-url, valueFrom: {secretKeyRef: {name: ra-p360-adapter, key: p360-endpoint-base-url}}}
            - {name: fint.file-cache.directory, value: '/temp'}
            - {name: fint.internal-files.type, value: 'BLOB'}
            - {name: fint.internal-files.directory, value: '/temp'}
            - {name: fint.internal-files.connection-string, valueFrom: {secretKeyRef: {name: fintdockervolumes, key: connection-string}}}
            - {name: fint.internal-files.container-name, value: fint-blobs}
