apiVersion: apps/v1
kind: Deployment
metadata:
  name: router-deployment
spec:
  selector:
    matchLabels:
      app: router
  template:
    metadata:
      labels:
        app: router
    spec:
      initContainers:
      - name: graph-setup-init
        image: gcr.io/ucdlib-pubreg/casita-krm-graph-setup:v0.0.1
        imagePullPolicy: Always
        command: ["/bin/sh"]
        args: ["-c", "cp -r /setup/* /mnt/setup"]
        volumeMounts:
        - mountPath: /mnt/setup
          name: graph-setup-volume
      containers:
      - name: router
        image: gcr.io/ucdlib-pubreg/krm-router:main
        imagePullPolicy: Always
        env:
        - name: KRM_ENV
          value: "gce-prod"
        - name: LOG_LEVEL
          value: "warn"
        - name: RABBITMQ_HOST
          value: rabbitmq-service
        - name: KAFKA_HOST
          value: "kafka-service"
        resources:
          limits:
            memory: "1Gi"
            cpu: "1"
          requests:
            memory: "128Mi"
            cpu: "100m"
        volumeMounts:
        - mountPath: /etc/krm/setup
          name: graph-setup-volume
        - mountPath: /etc/google
          name: service-account
      volumes:
      - name: graph-setup-volume
        emptyDir: {}
      - name: service-account
        secret:
          secretName: service-account
      nodeSelector:
        intendedfor: krm-services
