apiVersion: v1
kind: Pod
metadata:
  name: libvirt-ci
  labels:
    role: libvirt
    ci: k8s
spec:
  nodeSelector:
    ci: k8s
  hostNetwork: True
  hostPID: True
  hostIPC: True
  containers:
  - name: libvirt
    image: lyanchih/libvirtd
    securityContext:
      privileged: true
    volumeMounts:
    - name: cgroup
      mountPath: /sys/fs/cgroup
    - name: lib-modules
      mountPath: /lib/modules
    - name: run
      mountPath: /var/run
    - name: dev
      mountPath: /dev
    - name: libvirt-xml
      mountPath: /etc/libvirt/qemu
    - name: libvirt-lib
      mountPath: /var/lib/libvirt
  - name: add-br
    image: lyanchih/libvirtd
    tty: true
    command:
    - /bin/sh
    - -c
    - while brctl show kube0 2>&1 | grep 'No such'; do brctl addbr kube0; sleep 5; done; cat -;
    securityContext:
      capabilities:
        add:
        - NET_ADMIN
  volumes:
  - name: cgroup
    hostPath:
      path: /sys/fs/cgroup
  - name: lib-modules
    hostPath:
      path: /lib/modules
  - name: run
    hostPath:
      path: /var/run
  - name: dev
    hostPath:
      path: /dev
  - name: libvirt-lib
    hostPath:
      path: /var/lib/libvirt
  - name: libvirt-xml
    hostPath:
      path: /etc/libvirt/qemu