apiVersion: apps/v1
kind: Deployment
metadata:
  name: ws-deployment
spec:
  selector:
    matchLabels:
      app: ws-deployment
  template:
    metadata:
      labels:
        app: ws-deployment
    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: ws-deployment
        image: gcr.io/ucdlib-pubreg/krm-ws-service:main
        imagePullPolicy: Always
        ports:
        - containerPort: 3000
        env:
        - name: KRM_ENV
          value: "gce-prod"
        - name: KAFKA_HOST
          value: "kafka-service"
        resources:
          limits:
            memory: "256Mi"
            cpu: "1"
          requests:
            memory: "32Mi"
            cpu: "100m"
        volumeMounts:
        - mountPath: /etc/krm/setup
          name: graph-setup-volume
      volumes:
      - name: graph-setup-volume
        emptyDir: {}
      nodeSelector:
        intendedfor: krm-services
