apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    config.linkerd.io/opaque-ports: "4222"
  labels:
    app.kubernetes.io/name: api
    app.kubernetes.io/part-of: core-server
    app.kubernetes.io/version: dev
  name: core-server
  namespace: core-storage-dev
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: api
      app.kubernetes.io/part-of: core-server
      app.kubernetes.io/version: dev
  template:
    metadata:
      labels:
        app.kubernetes.io/name: api
        app.kubernetes.io/part-of: core-server
        app.kubernetes.io/version: dev
    spec:
      volumes:
        - name: config
          configMap:
            name: corestorageconfig
        - name: nats-nkey
          secret:
            secretName: natsnkeys
      containers:
        - env:
          - name: LOG_LEVEL
            value: Debug
          - name: PSQL_PASSWORD
            valueFrom:
              secretKeyRef:
                key: psql-pw
                name: postgres-user
          - name: AWS_ACCESS_KEY_ID
            valueFrom:
              secretKeyRef:
                key: accesskey
                name: s3
          - name: AWS_SECRET_ACCESS_KEY
            valueFrom:
              secretKeyRef:
                key: secretkey
                name: s3
          - name: STREAMINGSIGNSECRET
            valueFrom:
              secretKeyRef:
                key: signing-secret
                name: backend-secret
          image: harbor.computational.bio.uni-giessen.de/scienceobjectsdb/core-server:latest
          resources:
            limits:
              cpu: 2000m
              memory: 2000Mi
            requests:
              cpu: 2000m
              memory: 2000Mi
          name: core-server
          imagePullPolicy: Always
          command: [/CORE-Server]
          args: ["run", "-c", "/config/config.yaml"]
          volumeMounts:
            - name: config
              mountPath: "/config"
              readOnly: true
            - name: nats-nkey
              mountPath: "/nkeys"
              readOnly: true
          ports:
          - containerPort: 50051
          - containerPort: 9011