apiVersion: v1
kind: ReplicationController
metadata:
  name: bigquery-controller
  labels:
    name: bigquery-controller
spec:
  replicas: 2
  template:
    metadata:
      labels:
        name: bigquery-controller
    spec:
      containers:
      - name: bigquery
        image: gcr.io/google-samples/pubsub-bq-pipe:v2
        env:
        - name: PROCESSINGSCRIPT
          value: pubsub-to-bigquery
        # Change this to your pubsub topic
        - name: PUBSUB_TOPIC
          value: projects/openshift-bigquery-demo/topics/new_tweets
        # Change this to your project ID.
        - name: PROJECT_ID
          value: openshift-bigquery-demo
        # Change the following two settings to your dataset and table.
        - name: BQ_DATASET
          value: rtda
        - name: BQ_TABLE
          value: tweets
        - name: GOOGLE_APPLICATION_CREDENTIALS
          value: /etc/secretspath/google-services.json
        volumeMounts:
        - name: secrets
          mountPath: /etc/secretspath
          readOnly: true
      volumes:
      - name: secrets
        secret:
          secretName: google-services-secret
