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