apiVersion: apps/v1
kind: Deployment
metadata:
  name: dataflow-grpc
spec:
  template:
    spec:
      serviceAccountName: dataflow-svc
      containers:
        - name: dataflow-grpc
          env:
            - name: GOOGLE_APPLICATION_CREDENTIALS
              value: /var/run/cp9/gcp/key.json
            - name: AWS_REGION
              value: CP9_RUNTIME_REGION
            - name: AWS_DEFAULT_REGION
              value: CP9_RUNTIME_REGION
          volumeMounts:
            - name: google-adc
              mountPath: /var/run/cp9/gcp
              readOnly: true
      volumes:
        - name: google-adc
          secret:
            secretName: dataflow-svc-google-adc
            items:
              - key: key.json
                path: key.json
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: dataflow-http
spec:
  template:
    spec:
      serviceAccountName: dataflow-svc
      containers:
        - name: dataflow-http
          env:
            - name: GOOGLE_APPLICATION_CREDENTIALS
              value: /var/run/cp9/gcp/key.json
            - name: AWS_REGION
              value: CP9_RUNTIME_REGION
            - name: AWS_DEFAULT_REGION
              value: CP9_RUNTIME_REGION
          volumeMounts:
            - name: google-adc
              mountPath: /var/run/cp9/gcp
              readOnly: true
      volumes:
        - name: google-adc
          secret:
            secretName: dataflow-svc-google-adc
            items:
              - key: key.json
                path: key.json
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: dataflow-worker
spec:
  template:
    spec:
      serviceAccountName: dataflow-svc
      containers:
        - name: dataflow-worker
          env:
            - name: GOOGLE_APPLICATION_CREDENTIALS
              value: /var/run/cp9/gcp/key.json
            - name: AWS_REGION
              value: CP9_RUNTIME_REGION
            - name: AWS_DEFAULT_REGION
              value: CP9_RUNTIME_REGION
          volumeMounts:
            - name: google-adc
              mountPath: /var/run/cp9/gcp
              readOnly: true
      volumes:
        - name: google-adc
          secret:
            secretName: dataflow-svc-google-adc
            items:
              - key: key.json
                path: key.json
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: dataflow-workflow
spec:
  template:
    spec:
      serviceAccountName: dataflow-svc
      containers:
        - name: dataflow-workflow
          env:
            - name: GOOGLE_APPLICATION_CREDENTIALS
              value: /var/run/cp9/gcp/key.json
            - name: AWS_REGION
              value: CP9_RUNTIME_REGION
            - name: AWS_DEFAULT_REGION
              value: CP9_RUNTIME_REGION
            - name: POD_NAME
              value: dataflow-workflow-1
          volumeMounts:
            - name: google-adc
              mountPath: /var/run/cp9/gcp
              readOnly: true
      volumes:
        - name: google-adc
          secret:
            secretName: dataflow-svc-google-adc
            items:
              - key: key.json
                path: key.json
