# Source: platform-azure-demonset/templates/demonset.yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: spot-node-untaint
  namespace: kube-system
  labels:
    app: spot-node-untaint
    gitops.jenkins-x.io/pipeline: 'namespaces'
  annotations:
    meta.helm.sh/release-name: 'platform-azure-demonset'
spec:
  selector:
    matchLabels:
      app: spot-node-untaint
  updateStrategy:
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: spot-node-untaint
    spec:
      serviceAccountName: node-untaint
      containers:
        - name: node-untaint
          env:
            - name: NODE_NAME
              valueFrom:
                fieldRef:
                  fieldPath: spec.nodeName
          image: bitnami/kubectl:latest
          imagePullPolicy: Always
          command: ["/bin/bash"]
          args: ["/scripts/node-untaint-script.sh"]
          volumeMounts:
            - name: node-untaint-script
              mountPath: /scripts/
              readOnly: true
      volumes:
        - name: node-untaint-script
          configMap:
            name: node-untaint-script
      nodeSelector:
        kubernetes.azure.com/scalesetpriority: "spot"
      tolerations:
        - effect: NoSchedule
          key: node-role.kubernetes.io/master
        - key: "kubernetes.azure.com/scalesetpriority"
          operator: "Equal"
          value: "spot"
          effect: "NoSchedule"
