apiVersion: apps/v1
kind: Deployment
metadata:
  name: gcp-operator
spec:
  replicas: 1
  selector:
    matchLabels:
      name: gcp-operator
  template:
    metadata:
      labels:
        name: gcp-operator
    spec:
      serviceAccountName: gcp-operator
      containers:
        - name: gcp-operator
          image: paulczar/gcp-operator
          ports:
          - containerPort: 60000
            name: metrics
          command:
          - gcp-operator
          imagePullPolicy: Always
          env:
            - name: WATCH_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: OPERATOR_NAME
              value: gcp-operator
            - name: GOOGLE_APPLICATION_CREDENTIALS
              value: /etc/secret/google.json
          volumeMounts:
            - name: google-credentials
              mountPath: /etc/secret/google.json
              subPath: google.json
      volumes:
      - name: google-credentials
        secret:
          secretName: gcp-operator