apiVersion: apps/v1
kind: Deployment
metadata:
  name: gcp-cloud-compute-operator
spec:
  replicas: 1
  selector:
    matchLabels:
      name: gcp-cloud-compute-operator
  template:
    metadata:
      labels:
        name: gcp-cloud-compute-operator
    spec:
      serviceAccountName: gcp-cloud-compute-operator
      containers:
        - name: gcp-cloud-compute-operator
          # Replace this with the built image name
          image: paulczar/gcp-cloud-compute-operator
          ports:
          - containerPort: 60000
            name: metrics
          command:
          - gcp-cloud-compute-operator
          imagePullPolicy: Always
          volumeMounts:
          - name: gcloud
            mountPath: "/mnt/gcloud"
          env:
            - name: WATCH_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAME
              value: "gcp-cloud-compute-operator"
            - name: GOOGLE_APPLICATION_CREDENTIALS
              value: "/mnt/gcloud/creds"
      volumes:
        - name: gcloud
          secret:
            secretName: gcp-operator
            items:
            - key: google.json
              path: creds
              mode: 511
