apiVersion: apps/v1
kind: Deployment
metadata:
  name: file-retriever-server
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: service-provider-scm-file-retriever-server
  replicas: 1
  template:
    metadata:
      labels:
        app.kubernetes.io/name: service-provider-scm-file-retriever-server
    spec:
      securityContext:
        runAsNonRoot: true
      containers:
        - name: kube-rbac-proxy
          image: quay.io/openshift/origin-kube-rbac-proxy:4.10.0
          args:
            - "--insecure-listen-address=0.0.0.0:8080"
            - "--upstream=http://127.0.0.1:8000/"
            - "--config-file=/etc/kube-rbac-proxy/config-file.yaml"
            - "--logtostderr=true"
            - "--ignore-paths=\"/\",\"/ws/*\""
            - "--v=10"
          ports:
            - containerPort: 8080
              name: proxy
          volumeMounts:
            - name: config
              mountPath: /etc/kube-rbac-proxy
          securityContext:
            allowPrivilegeEscalation: false
        - command:
          - /spi-file
          image: quay.io/redhat-appstudio/service-provider-integration-scm-file-retriever-server
          name: server
          securityContext:
            allowPrivilegeEscalation: false
          livenessProbe:
            httpGet:
              path: /health
              port: 8000
            initialDelaySeconds: 15
            periodSeconds: 20
          readinessProbe:
            httpGet:
              path: /ready
              port: 8000
            initialDelaySeconds: 5
            periodSeconds: 10
          resources:
            limits:
              cpu: 200m
              memory: 100Mi
            requests:
              cpu: 100m
              memory: 20Mi
      serviceAccountName: file-retriever-server-sa
      terminationGracePeriodSeconds: 10
      volumes:
        - name: config
          configMap:
            name: kube-rbac-proxy
