apiVersion: apps/v1
kind: Deployment
metadata:
  name: adapter-vigokodeverk
spec:
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
  selector:
    matchLabels:
      app: adapter-vigokodeverk
  template:
    metadata:
      labels:
        app: adapter-vigokodeverk
    spec:
      restartPolicy: Always
      volumes:
        - name: tempdir
          emptyDir: {}
      containers:
        - name: adapter-vigokodeverk
          image: fintlabs.azurecr.io/adapter-vigo-kodeverk:build.12
          resources:
            limits:
              memory: "2Gi"
              cpu: "2"
            requests:
              memory: "1Gi"
              cpu: "250m"
          ports:
            - containerPort: 8091
          readinessProbe:
            httpGet:
              path: /health
              port: 8091
            initialDelaySeconds: 60
            timeoutSeconds: 5
          volumeMounts:
            - name: tempdir
              mountPath: /temp
          env:
            - name: TZ
              value: Europe/Oslo
            - name: JAVA_TOOL_OPTIONS
              value: '-XX:+ExitOnOutOfMemoryError -Xmx1G -verbose:gc'
            - name: springfox.title
              value: "Vigo kodeverk Adapter"
            - name: security.basic.enabled
              value: "false"
            - name: fint.adapter.organizations
              value: fintlabs.no
            - name: fint.adapter.sse-endpoint
              value: https://beta.felleskomponent.no/utdanning/vigo/kodeverk/provider/sse/%s
            - name: fint.adapter.status-endpoint
              value: https://beta.felleskomponent.no/utdanning/vigo/kodeverk/provider/status
            - name: fint.adapter.response-endpoint
              value: https://beta.felleskomponent.no/utdanning/vigo/kodeverk/provider/response
            - name: fint.oauth.enabled
              value: "true"
            - name: fint.oauth.access-token-uri
              value: https://idp.felleskomponent.no/nidp/oauth/nam/token
            - name: fint.oauth.scope
              value: fint-client
            - name: fint.oauth.client-id
              valueFrom:
                secretKeyRef:
                  key: client-id
                  name: fake-adapter
            - name: fint.oauth.client-secret
              valueFrom:
                secretKeyRef:
                  key: client-secret
                  name: fake-adapter
            - name: fint.oauth.username
              valueFrom:
                secretKeyRef:
                  key: username
                  name: fake-adapter
            - name: fint.oauth.password
              valueFrom:
                secretKeyRef:
                  key: password
                  name: fake-adapter
            - name: fint.isiclient.fileLocation
              value: /temp
            - name: fint.isiclient.sourceSystemId
              valueFrom:
                secretKeyRef:
                  name: vigokv-isiclient
                  key: sourceSystemId
            - name: fint.isiclient.destSystemId
              valueFrom:
                secretKeyRef:
                  name: vigokv-isiclient
                  key: destSystemId
            - name: fint.isiclient.password
              valueFrom:
                secretKeyRef:
                  name: vigokv-isiclient
                  key: password