apiVersion: v1
kind: Pod
metadata:
  generateName: $POD_NAME
  labels:
    dj-kubelet.com/spotify-track: ""

spec:
  restartPolicy: Never
  containers:
  - image: djkubelet/spotify-ctl:latest
    name: track
    imagePullPolicy: IfNotPresent
    args:
      - $TRACK
    volumeMounts:
    - name: spotify-oauth
      mountPath: "/etc/spotify-oauth"

  volumes:
  - name: spotify-oauth
    secret:
      secretName: spotify-oauth

  affinity:
    podAntiAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
      - labelSelector:
          matchExpressions:
          - key: dj-kubelet.com/spotify-track
            operator: Exists
        topologyKey: "kubernetes.io/hostname"
