---
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: virt-tool
  namespace: cloudplus
  labels:
    app: virt-tool
spec:
  selector:
    matchLabels:
      app: virt-tool
  template:
    metadata:
      labels:
        app: virt-tool
    spec:
      nodeSelector:
        cloudplus/virt.tool: ""
      hostNetwork: true
      containers:
      - image: registry.cn-hangzhou.aliyuncs.com/cloudplus-lab/kubernetes-kvm-virtctl:v2.1.0
        command: 
        - bash
        - 'virtctl-update-stuff.sh'
        imagePullPolicy: Always
        name: virtctl
        securityContext:
          runAsUser: 0
          privileged: true
          allowPrivilegeEscalation: true
          capabilities:
            add: 
            - SYS_TIME
        volumeMounts:
          - name: varlog
            mountPath: /var/log/
          - name: kube
            mountPath: /root/.kube/
          - name: libvirt
            mountPath: /var/lib/libvirt/
          - name: varrun
            mountPath: /var/run/
          - name: etc
            mountPath: /etc/
      - image: registry.cn-hangzhou.aliyuncs.com/cloudplus-lab/kubernetes-kvm-virtlet:v2.1.0
        command: 
        - bash
        - 'virtlet-update-stuff.sh'
        imagePullPolicy: Always
        name: virtlet
        securityContext:
          runAsUser: 0
          privileged: true
          allowPrivilegeEscalation: true
          capabilities:
            add: 
            - SYS_TIME
        volumeMounts:
          - name: varlog
            mountPath: /var/log/
          - name: kube
            mountPath: /root/.kube/
          - name: libvirt
            mountPath: /var/lib/libvirt/
          - name: varrun
            mountPath: /var/run/
          - name: etc
            mountPath: /etc/
      - image: registry.cn-hangzhou.aliyuncs.com/cloudplus-lab/kubernetes-kvm-libvirtwatcher:v2.1.0
        command: 
        - bash
        - 'watcher.sh'
        imagePullPolicy: Always
        name: libvirtwatcher
        securityContext:
          runAsUser: 0
          privileged: true
          allowPrivilegeEscalation: true
          capabilities:
            add: 
            - SYS_TIME
        volumeMounts:
          - name: varlog
            mountPath: /var/log/
          - name: kube
            mountPath: /root/.kube/
          - name: libvirt
            mountPath: /var/lib/libvirt/
          - name: varrun
            mountPath: /var/run/
          - name: etc
            mountPath: /etc/
      - image: registry.cn-hangzhou.aliyuncs.com/cloudplus-lab/kubernetes-kvm-virtmonitor:v2.1.0
        command: 
        - bash
        - 'monitor.sh'
        imagePullPolicy: Always
        name: virtmonitor
        securityContext:
          runAsUser: 0
          privileged: true
          allowPrivilegeEscalation: true
          capabilities:
            add: 
            - SYS_TIME
        volumeMounts:
          - name: varlog
            mountPath: /var/log/
          - name: kube
            mountPath: /root/.kube/
          - name: libvirt
            mountPath: /var/lib/libvirt/
          - name: varrun
            mountPath: /var/run/
          - name: etc
            mountPath: /etc/
      volumes: 
        - name: varlog
          hostPath: 
            path: /var/log/
        - name: kube
          hostPath: 
            path: /root/.kube/
        - name: libvirt
          hostPath: 
            path: /var/lib/libvirt/
        - name: varrun
          hostPath: 
            path: /var/run/
        - name: etc
          hostPath: 
            path: /etc/