apiVersion: apps/v1
kind: Deployment
metadata:
  name: decoder-deployment
spec:
  selector:
    matchLabels:
      app: decoder
  template:
    metadata:
      labels:
        app: decoder
    spec:
      containers:
      - name: decoder
        image: gcr.io/ucdlib-pubreg/grb-decoder:main
        imagePullPolicy: Always
        env:
        - name: KRM_ENV
          value: "gce-prod"
        - name: DECODER_KAFKA_HOST
          value: kafka-service
        - name: DECODER_KAFKA_PORT
          value: "9092"
        - name: SSH_KEY_USERNAME
          valueFrom:
            secretKeyRef:
              name: decoder-ssh-user
              key: ssh-username
        - name: GRB_FILE
          value: "decoded"
        resources:
          limits:
            memory: "1Gi"
            cpu: "1"
          requests:
            memory: "128Mi"
            cpu: "100m"
        volumeMounts:
        - name: decoder-ssh-key
          mountPath: /root/ssh-key
        - mountPath: /etc/google
          name: service-account
      volumes:
      - name: decoder-ssh-key
        secret:
          secretName: decoder-ssh-key
      - name: service-account
        secret:
          secretName: service-account
      nodeSelector:
        intendedfor: decoders
