apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: kube-node-cycle-agent
  namespace: kube-system
spec:
  updateStrategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 1
  selector:
    matchLabels:
      app: kube-node-cycle-agent
  template:
    metadata:
      labels:
        app: kube-node-cycle-agent
    spec:
      serviceAccountName: kube-node-cycler
      hostNetwork: true
      containers:
      - name: kube-node-cycle-agent
        image: quay.io/utilitywarehouse/kube-node-cycle-operator:0.1.3
        args:
        - agent
        - -project=uw-dev
        - -region=europe-west2
        env:
        - name: GOOGLE_APPLICATION_CREDENTIALS
          value: "/etc/secrets/service-account/credentials.json"
        volumeMounts:
          - name: gcp-credentials
            mountPath: /etc/secrets/service-account/credentials.json
            subPath: credentials.json
      tolerations:
      - key: node-role.kubernetes.io/master
        operator: Exists
        effect: NoSchedule
      volumes:
        - name: gcp-credentials
          secret:
            secretName: gcp-compute-admin
            defaultMode: 0400
