apiVersion: apps/v1
kind: Deployment
metadata:
  name: tpu-player-deployment
spec:
  replicas: 8
  selector:
    matchLabels:
      app: tpu-player
  template:
    metadata:
      annotations:
        tf-version.cloud-tpus.google.com: "1.9"
      labels:
        app: tpu-player
    spec:
      containers:
      - name: minigo-tpu-player-container
        image: gcr.io/tensor-go/minigo-tpu-player:0.2
        imagePullPolicy: Always
        resources:
          limits:
            cloud-tpus.google.com/v2: 8
        volumeMounts:
        - name: service-credentials
          mountPath: /etc/credentials
        env:
        - name: GOOGLE_APPLICATION_CREDENTIALS
          value: /etc/credentials/service-account.json
        - name: BUCKET_NAME
          value: $BUCKET_NAME
        - name: WORK_DIR
          value: $WORK_DIR
      volumes:
      - name: service-credentials
        secret:
          secretName: $SERVICE_ACCOUNT-creds
      restartPolicy: Always
