From e452a3a75084ecd4d001eb9ceb4720483881258b Mon Sep 17 00:00:00 2001 From: Evgeny Slutsky Date: Mon, 31 Aug 2020 12:20:08 +0300 Subject: [PATCH] WIP oVirt: Introduce qemu-guest-agent container ocp VMs needs to run oVirt QEMU agent container. Bug: 1764804 Signed-off-by: Evgeny Slutsky --- manifests/ovirt/qemu-guest-agent.yaml | 55 ++++++++++++++ pkg/operator/assets/bindata.go | 75 +++++++++++++++++++ pkg/operator/bootstrap.go | 4 + .../ovirt/files/ovirt-qemu-guest-agent.yaml | 59 +++++++++++++++ 4 files changed, 193 insertions(+) create mode 100644 manifests/ovirt/qemu-guest-agent.yaml create mode 100644 templates/common/ovirt/files/ovirt-qemu-guest-agent.yaml diff --git a/manifests/ovirt/qemu-guest-agent.yaml b/manifests/ovirt/qemu-guest-agent.yaml new file mode 100644 index 0000000000..d12c980db5 --- /dev/null +++ b/manifests/ovirt/qemu-guest-agent.yaml @@ -0,0 +1,55 @@ +--- +kind: Pod +apiVersion: v1 +metadata: + name: qemu-guest-agent + namespace: openshift-ovirt-infra + creationTimestamp: + deletionGracePeriodSeconds: 65 + labels: + app: qemu-guest-agent +spec: + volumes: + - name: dev + hostPath: + path: "/dev" + - name: virtio-ports + hostPath: + path: "/dev/virtio-ports" + - name: dbus + hostPath: + path: "/run/dbus" + - name: systemd + hostPath: + path: "/run/systemd" + - name: zoneinfo + hostPath: + path: "/usr/share/zoneinfo" + + containers: + - name: qemu-guest-agent + securityContext: + privileged: true + image: registry.svc.ci.openshift.org/ovirt/qemu-guest-agent:4.2 + resources: + requests: + cpu: 100m + memory: 200Mi + volumeMounts: + - name: dev + mountPath: "/dev" + - name: virtio-ports + mountPath: "/dev/virtio-ports" + - name: dbus + mountPath: "/run/dbus" + - name: systemd + mountPath: "/run/systemd" + - name: zoneinfo + mountPath: "/usr/share/zoneinfo" + + terminationMessagePolicy: FallbackToLogsOnError + hostNetwork: true + tolerations: + - operator: Exists + priorityClassName: system-node-critical +status: {} diff --git a/pkg/operator/assets/bindata.go b/pkg/operator/assets/bindata.go index 670364e9b6..cbe8313545 100644 --- a/pkg/operator/assets/bindata.go +++ b/pkg/operator/assets/bindata.go @@ -40,6 +40,7 @@ // manifests/ovirt/coredns.yaml // manifests/ovirt/keepalived.conf.tmpl // manifests/ovirt/keepalived.yaml +// manifests/ovirt/qemu-guest-agent.yaml // manifests/userdata_secret.yaml // manifests/vsphere/coredns-corefile.tmpl // manifests/vsphere/coredns.yaml @@ -2466,6 +2467,78 @@ func manifestsOvirtKeepalivedYaml() (*asset, error) { return a, nil } +var _manifestsOvirtQemuGuestAgentYaml = []byte(`--- +kind: Pod +apiVersion: v1 +metadata: + name: qemu-guest-agent + namespace: openshift-ovirt-infra + creationTimestamp: + deletionGracePeriodSeconds: 65 + labels: + app: qemu-guest-agent +spec: + volumes: + - name: dev + hostPath: + path: "/dev" + - name: virtio-ports + hostPath: + path: "/dev/virtio-ports" + - name: dbus + hostPath: + path: "/run/dbus" + - name: systemd + hostPath: + path: "/run/systemd" + - name: zoneinfo + hostPath: + path: "/usr/share/zoneinfo" + + containers: + - name: qemu-guest-agent + securityContext: + privileged: true + image: registry.svc.ci.openshift.org/ovirt/qemu-guest-agent:4.2 + resources: + requests: + cpu: 100m + memory: 200Mi + volumeMounts: + - name: dev + mountPath: "/dev" + - name: virtio-ports + mountPath: "/dev/virtio-ports" + - name: dbus + mountPath: "/run/dbus" + - name: systemd + mountPath: "/run/systemd" + - name: zoneinfo + mountPath: "/usr/share/zoneinfo" + + terminationMessagePolicy: FallbackToLogsOnError + hostNetwork: true + tolerations: + - operator: Exists + priorityClassName: system-node-critical +status: {} +`) + +func manifestsOvirtQemuGuestAgentYamlBytes() ([]byte, error) { + return _manifestsOvirtQemuGuestAgentYaml, nil +} + +func manifestsOvirtQemuGuestAgentYaml() (*asset, error) { + bytes, err := manifestsOvirtQemuGuestAgentYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "manifests/ovirt/qemu-guest-agent.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + var _manifestsUserdata_secretYaml = []byte(`apiVersion: v1 kind: Secret metadata: @@ -2892,6 +2965,7 @@ var _bindata = map[string]func() (*asset, error){ "manifests/ovirt/coredns.yaml": manifestsOvirtCorednsYaml, "manifests/ovirt/keepalived.conf.tmpl": manifestsOvirtKeepalivedConfTmpl, "manifests/ovirt/keepalived.yaml": manifestsOvirtKeepalivedYaml, + "manifests/ovirt/qemu-guest-agent.yaml": manifestsOvirtQemuGuestAgentYaml, "manifests/userdata_secret.yaml": manifestsUserdata_secretYaml, "manifests/vsphere/coredns-corefile.tmpl": manifestsVsphereCorednsCorefileTmpl, "manifests/vsphere/coredns.yaml": manifestsVsphereCorednsYaml, @@ -2993,6 +3067,7 @@ var _bintree = &bintree{nil, map[string]*bintree{ "coredns.yaml": &bintree{manifestsOvirtCorednsYaml, map[string]*bintree{}}, "keepalived.conf.tmpl": &bintree{manifestsOvirtKeepalivedConfTmpl, map[string]*bintree{}}, "keepalived.yaml": &bintree{manifestsOvirtKeepalivedYaml, map[string]*bintree{}}, + "qemu-guest-agent.yaml": &bintree{manifestsOvirtQemuGuestAgentYaml, map[string]*bintree{}}, }}, "userdata_secret.yaml": &bintree{manifestsUserdata_secretYaml, map[string]*bintree{}}, "vsphere": &bintree{nil, map[string]*bintree{ diff --git a/pkg/operator/bootstrap.go b/pkg/operator/bootstrap.go index b519bc2535..6272513aa7 100644 --- a/pkg/operator/bootstrap.go +++ b/pkg/operator/bootstrap.go @@ -261,6 +261,10 @@ func appendManifestsByPlatform(manifests []manifest, infra configv1.Infrastructu name: "manifests/ovirt/keepalived.conf.tmpl", filename: "ovirt/static-pod-resources/keepalived/keepalived.conf.tmpl", }, + manifest{ + name: "manifests/ovirt/qemu-guest-agent.yaml", + filename: "ovirt/manifests/qemu-guest-agent.yaml", + }, ) } if infra.Status.PlatformStatus.VSphere != nil && infra.Status.PlatformStatus.VSphere.APIServerInternalIP != "" { diff --git a/templates/common/ovirt/files/ovirt-qemu-guest-agent.yaml b/templates/common/ovirt/files/ovirt-qemu-guest-agent.yaml new file mode 100644 index 0000000000..ccc474e12f --- /dev/null +++ b/templates/common/ovirt/files/ovirt-qemu-guest-agent.yaml @@ -0,0 +1,59 @@ +mode: 0644 +path: "/etc/kubernetes/manifests/qemu-guest-agent.yaml" +contents: + inline: | + --- + kind: Pod + apiVersion: v1 + metadata: + name: qemu-guest-agent + namespace: openshift-ovirt-infra + creationTimestamp: + deletionGracePeriodSeconds: 65 + labels: + app: qemu-guest-agent + spec: + volumes: + - name: dev + hostPath: + path: "/dev" + - name: virtio-ports + hostPath: + path: "/dev/virtio-ports" + - name: dbus + hostPath: + path: "/run/dbus" + - name: systemd + hostPath: + path: "/run/systemd" + - name: zoneinfo + hostPath: + path: "/usr/share/zoneinfo" + + containers: + - name: qemu-guest-agent + securityContext: + privileged: true + image: registry.svc.ci.openshift.org/ovirt/qemu-guest-agent:4.2 + resources: + requests: + cpu: 100m + memory: 200Mi + volumeMounts: + - name: dev + mountPath: "/dev" + - name: virtio-ports + mountPath: "/dev/virtio-ports" + - name: dbus + mountPath: "/run/dbus" + - name: systemd + mountPath: "/run/systemd" + - name: zoneinfo + mountPath: "/usr/share/zoneinfo" + + terminationMessagePolicy: FallbackToLogsOnError + hostNetwork: true + tolerations: + - operator: Exists + priorityClassName: system-node-critical + status: {}