apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: csgo-updater
  namespace: operations
  labels:
    k8s-app: csgo-updater
spec:
  selector:
    matchLabels:
      name: csgo-updater
  template:
    metadata:
      labels:
        name: csgo-updater
    spec:
      nodeSelector:
        node-role.kubernetes.io/csgo: csgo
      tolerations:
      # this toleration is to have the daemonset runnable on master nodes
      # remove it if your masters can't run pods
      - key: node-role.kubernetes.io/operations
        operator: Exists
        effect: NoSchedule
      containers:
      - name: csgo-updater
        image: npflan/docker-csgo:vanilla-4.0.8
        command: ["sh", "-c", "/home/csgo/server.sh install; while true; do sleep 86400; done"]
        volumeMounts:
        - mountPath: /home/csgo/server
          name: csgo-volume
      terminationGracePeriodSeconds: 10
      volumes:
      - name: csgo-volume
        hostPath:
          path: /home/npfuser
          type: Directory
