From 3f8895b2b7cb96b5690a06aad97f5893ebd113c0 Mon Sep 17 00:00:00 2001 From: portdirect Date: Sat, 17 Feb 2018 17:30:37 -0500 Subject: [PATCH] Libvirt: Move to lightweight Libvirt 1.3.1 image This PS moves to use a lightweight libvirt 1.3.1 image based on ubuntu xenial for used with newton openstack. Change-Id: I99f64bba7aca3896fc3d32884c3e6f59ff088f79 --- libvirt/values.yaml | 14 +++--- tools/images/libvirt/Dockerfile.ubuntu.xenial | 40 ++++++++++++++++ tools/images/libvirt/README.rst | 48 +++++++++++++++++++ tools/overrides/releases/newton/kolla.yaml | 1 + 4 files changed, 96 insertions(+), 7 deletions(-) create mode 100644 tools/images/libvirt/Dockerfile.ubuntu.xenial create mode 100644 tools/images/libvirt/README.rst diff --git a/libvirt/values.yaml b/libvirt/values.yaml index 0837f15595..af43ad28ee 100644 --- a/libvirt/values.yaml +++ b/libvirt/values.yaml @@ -27,7 +27,7 @@ labels: images: tags: - libvirt: docker.io/kolla/ubuntu-source-nova-libvirt:3.0.3 + libvirt: docker.io/openstackhelm/libvirt:ubuntu-xenial-1.3.1 dep_check: quay.io/stackanetes/kubernetes-entrypoint:v0.2.1 pull_policy: "IfNotPresent" @@ -44,7 +44,7 @@ conf: listen_tls: "0" auth_tcp: "none" ca_file: "" - listen_addr: 0.0.0.0 + listen_addr: 127.0.0.1 log_level: "3" qemu: stdio_handler: "file" @@ -53,11 +53,11 @@ conf: pod: affinity: - anti: - type: - default: preferredDuringSchedulingIgnoredDuringExecution - topologyKey: - default: kubernetes.io/hostname + anti: + type: + default: preferredDuringSchedulingIgnoredDuringExecution + topologyKey: + default: kubernetes.io/hostname mounts: libvirt: init_container: null diff --git a/tools/images/libvirt/Dockerfile.ubuntu.xenial b/tools/images/libvirt/Dockerfile.ubuntu.xenial new file mode 100644 index 0000000000..eeed452e8e --- /dev/null +++ b/tools/images/libvirt/Dockerfile.ubuntu.xenial @@ -0,0 +1,40 @@ +FROM docker.io/ubuntu:xenial +MAINTAINER pete.birley@att.com + +ARG LIBVIRT_VERSION=1.3.1-1ubuntu10.18 +ARG CEPH_RELEASE=luminous +ARG PROJECT=nova +ARG UID=42424 +ARG GID=42424 + +ADD https://download.ceph.com/keys/release.asc /etc/apt/ceph-release.asc +RUN set -ex ;\ + export DEBIAN_FRONTEND=noninteractive ;\ + apt-key add /etc/apt/ceph-release.asc ;\ + rm -f /etc/apt/ceph-release.asc ;\ + echo deb http://download.ceph.com/debian-${CEPH_RELEASE}/ xenial main | tee /etc/apt/sources.list.d/ceph.list ;\ + apt-get update ;\ + apt-get upgrade -y ;\ + apt-get install --no-install-recommends -y \ + ceph-common \ + dmidecode \ + ebtables \ + iproute2 \ + libvirt-bin=${LIBVIRT_VERSION} \ + pm-utils \ + qemu \ + qemu-block-extra \ + qemu-efi \ + openvswitch-switch ;\ + groupadd -g ${GID} ${PROJECT} ;\ + useradd -u ${UID} -g ${PROJECT} -M -d /var/lib/${PROJECT} -s /usr/sbin/nologin -c "${PROJECT} user" ${PROJECT} ;\ + mkdir -p /etc/${PROJECT} /var/log/${PROJECT} /var/lib/${PROJECT} /var/cache/${PROJECT} ;\ + chown ${PROJECT}:${PROJECT} /etc/${PROJECT} /var/log/${PROJECT} /var/lib/${PROJECT} /var/cache/${PROJECT} ;\ + usermod -a -G kvm ${PROJECT} ;\ + apt-get clean -y ;\ + rm -rf \ + /var/cache/debconf/* \ + /var/lib/apt/lists/* \ + /var/log/* \ + /tmp/* \ + /var/tmp/* diff --git a/tools/images/libvirt/README.rst b/tools/images/libvirt/README.rst new file mode 100644 index 0000000000..89e7fda302 --- /dev/null +++ b/tools/images/libvirt/README.rst @@ -0,0 +1,48 @@ +Libvirt Container +================= + +This container builds a small image with Libvirt for use with OpenStack-Helm. + +Instructions +------------ + +OS Specific Host setup: +~~~~~~~~~~~~~~~~~~~~~~~ + +Ubuntu: +^^^^^^^ + +From a freshly provisioned Ubuntu 16.04 LTS host run: + +.. code:: bash + + sudo apt-get update -y + sudo apt-get install -y \ + docker.io \ + git + +Build the Libvirt Image +~~~~~~~~~~~~~~~~~~~~~~~ + +A known good image is published to dockerhub on a fairly regular basis, but if +you wish to build your own image, from the root directory of the OpenStack-Helm +repo run: + +.. code:: bash + + LIBVIRT_VERSION=1.3.1-1ubuntu10.18 + DISTRO=ubuntu + DISTRO_RELEASE=xenial + CEPH_RELEASE=luminous + + sudo docker build \ + --network=host \ + --force-rm \ + --pull \ + --no-cache \ + --file=./tools/images/libvirt/Dockerfile.${DISTRO}.xenial \ + --build-arg LIBVIRT_VERSION="${LIBVIRT_VERSION}" \ + --build-arg CEPH_RELEASE="${CEPH_RELEASE}" \ + -t docker.io/openstackhelm/libvirt:${DISTRO}-${DISTRO_RELEASE}-${LIBVIRT_VERSION%-*} \ + tools/images/libvirt + sudo docker push docker.io/openstackhelm/libvirt:${DISTRO}-${DISTRO_RELEASE}-${LIBVIRT_VERSION%-*} diff --git a/tools/overrides/releases/newton/kolla.yaml b/tools/overrides/releases/newton/kolla.yaml index 2de75766dc..335f3d5d81 100644 --- a/tools/overrides/releases/newton/kolla.yaml +++ b/tools/overrides/releases/newton/kolla.yaml @@ -45,6 +45,7 @@ images: ks_endpoints: 'docker.io/kolla/ubuntu-source-heat-engine:3.0.3' ks_service: 'docker.io/kolla/ubuntu-source-heat-engine:3.0.3' ks_user: 'docker.io/kolla/ubuntu-source-heat-engine:3.0.3' + libvirt: 'docker.io/kolla/ubuntu-source-nova-libvirt:3.0.3' magnum_api: 'docker.io/kolla/ubuntu-source-magnum-api:3.0.3' magnum_conductor: 'docker.io/kolla/ubuntu-source-magnum-conductor:3.0.3' magnum_db_sync: 'docker.io/kolla/ubuntu-source-magnum-api:3.0.3'