diff --git a/doc/source/install/developer/all-in-one.rst b/doc/source/install/developer/all-in-one.rst index acb6424d3a..adb27f8ff2 100644 --- a/doc/source/install/developer/all-in-one.rst +++ b/doc/source/install/developer/all-in-one.rst @@ -190,6 +190,7 @@ OpenStack services depend upon them. helm install --name=etcd-rabbitmq ./etcd --namespace=openstack helm install --name=rabbitmq ./rabbitmq --namespace=openstack helm install --name=ingress ./ingress --namespace=openstack + helm install --name=libvirt ./libvirt --namespace=openstack Once the OpenStack infrastructure components are installed and running, the OpenStack services can be installed. In the below examples the default values diff --git a/doc/source/install/multinode.rst b/doc/source/install/multinode.rst index 767d7d1efa..4efc0eed07 100644 --- a/doc/source/install/multinode.rst +++ b/doc/source/install/multinode.rst @@ -372,7 +372,7 @@ Installation of Other Services Now you can easily install the other services simply by going in order: -**Install Memcached/Etcd/RabbitMQ/Ingress:** +**Install Memcached/Etcd/RabbitMQ/Ingress/Libvirt:** :: @@ -380,6 +380,7 @@ Now you can easily install the other services simply by going in order: helm install --name=etcd-rabbitmq ./etcd --namespace=openstack helm install --name=rabbitmq ./rabbitmq --namespace=openstack helm install --name=ingress ./ingress --namespace=openstack + helm install --name=libvirt ./libvirt --namespace=openstack **Install Keystone:** diff --git a/libvirt/Chart.yaml b/libvirt/Chart.yaml new file mode 100644 index 0000000000..8dc577baa7 --- /dev/null +++ b/libvirt/Chart.yaml @@ -0,0 +1,24 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: v1 +description: OpenStack-Helm libvirt +name: libvirt +version: 0.1.0 +home: https://libvirt.org +sources: + - https://libvirt.org/git/?p=libvirt.git;a=summary + - https://git.openstack.org/cgit/openstack/openstack-helm +maintainers: + - name: OpenStack-Helm Authors diff --git a/libvirt/requirements.yaml b/libvirt/requirements.yaml new file mode 100644 index 0000000000..53782e69b2 --- /dev/null +++ b/libvirt/requirements.yaml @@ -0,0 +1,18 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +dependencies: + - name: helm-toolkit + repository: http://localhost:8879/charts + version: 0.1.0 diff --git a/libvirt/templates/bin/_ceph-keyring.sh.tpl b/libvirt/templates/bin/_ceph-keyring.sh.tpl new file mode 100644 index 0000000000..f4c3f63aa7 --- /dev/null +++ b/libvirt/templates/bin/_ceph-keyring.sh.tpl @@ -0,0 +1,31 @@ +#!/bin/bash + +{{/* +Copyright 2017 The Openstack-Helm Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/}} + +set -ex +export HOME=/tmp + +cat < /etc/ceph/ceph.client.${CEPH_CINDER_USER}.keyring +[client.{{ .Values.ceph.cinder_user }}] +{{- if .Values.ceph.cinder_keyring }} + key = {{ .Values.ceph.cinder_keyring }} +{{- else }} + key = $(cat /tmp/client-keyring) +{{- end }} +EOF + +exit 0 diff --git a/nova/templates/bin/_ceph-secret-define.sh.tpl b/libvirt/templates/bin/_ceph-secret-define.sh.tpl similarity index 100% rename from nova/templates/bin/_ceph-secret-define.sh.tpl rename to libvirt/templates/bin/_ceph-secret-define.sh.tpl diff --git a/nova/templates/bin/_libvirt.sh.tpl b/libvirt/templates/bin/_libvirt.sh.tpl similarity index 100% rename from nova/templates/bin/_libvirt.sh.tpl rename to libvirt/templates/bin/_libvirt.sh.tpl diff --git a/libvirt/templates/configmap-bin.yaml b/libvirt/templates/configmap-bin.yaml new file mode 100644 index 0000000000..9f7a670fb9 --- /dev/null +++ b/libvirt/templates/configmap-bin.yaml @@ -0,0 +1,33 @@ +{{/* +Copyright 2017 The Openstack-Helm Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/}} + +{{- if .Values.manifests.configmap_bin }} +{{- $envAll := . }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: libvirt-bin +data: + libvirt.sh: | +{{ tuple "bin/_libvirt.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} +{{- if .Values.ceph.enabled }} + ceph-secret-define.sh: | +{{ tuple "bin/_ceph-secret-define.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} + ceph-keyring.sh: |+ +{{ tuple "bin/_ceph-keyring.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} +{{- end }} +{{- end }} diff --git a/libvirt/templates/configmap-etc.yaml b/libvirt/templates/configmap-etc.yaml new file mode 100644 index 0000000000..b72184d167 --- /dev/null +++ b/libvirt/templates/configmap-etc.yaml @@ -0,0 +1,29 @@ +{{/* +Copyright 2017 The Openstack-Helm Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/}} + +{{- if .Values.manifests.configmap_etc }} + +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: libvirt-etc +data: + libvirtd.conf: |+ +{{ tuple "etc/_libvirtd.conf.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} + qemu.conf: |+ +{{ tuple "etc/_qemu.conf.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} +{{- end }} diff --git a/nova/templates/daemonset-libvirt.yaml b/libvirt/templates/daemonset-libvirt.yaml similarity index 80% rename from nova/templates/daemonset-libvirt.yaml rename to libvirt/templates/daemonset-libvirt.yaml index 829c7d8f28..653eaa2fed 100644 --- a/nova/templates/daemonset-libvirt.yaml +++ b/libvirt/templates/daemonset-libvirt.yaml @@ -16,20 +16,19 @@ limitations under the License. {{- if .Values.manifests.daemonset_libvirt }} {{- $envAll := . }} -{{- $dependencies := .Values.dependencies.libvirt }} -{{- $mounts_nova_libvirt := .Values.pod.mounts.nova_libvirt.nova_libvirt }} -{{- $mounts_nova_libvirt_init := .Values.pod.mounts.nova_libvirt.init_container }} +{{- $mounts_libvirt := .Values.pod.mounts.libvirt.libvirt }} +{{- $mounts_libvirt_init := .Values.pod.mounts.libvirt.init_container }} --- apiVersion: extensions/v1beta1 kind: DaemonSet metadata: - name: nova-libvirt + name: libvirt spec: {{ tuple $envAll "libvirt" | include "helm-toolkit.snippets.kubernetes_upgrades_daemonset" | indent 2 }} template: metadata: labels: -{{ tuple $envAll "nova" "libvirt" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} +{{ tuple $envAll "libvirt" "libvirt" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }} @@ -39,9 +38,8 @@ spec: hostNetwork: true hostPID: true dnsPolicy: ClusterFirstWithHostNet +{{- if .Values.ceph.enabled }} initContainers: -{{ tuple $envAll $dependencies $mounts_nova_libvirt_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} - {{- if .Values.ceph.enabled }} - name: ceph-keyring-placement image: {{ .Values.images.libvirt }} imagePullPolicy: {{ .Values.images.pull_policy }} @@ -61,7 +59,7 @@ spec: volumeMounts: - name: etcceph mountPath: /etc/ceph - - name: nova-bin + - name: libvirt-bin mountPath: /tmp/ceph-keyring.sh subPath: ceph-keyring.sh readOnly: true @@ -69,9 +67,9 @@ spec: mountPath: /tmp/client-keyring subPath: key readOnly: true - {{ end }} +{{- end }} containers: - - name: nova-libvirt + - name: libvirt image: {{ .Values.images.libvirt }} imagePullPolicy: {{ .Values.images.pull_policy }} {{ tuple $envAll $envAll.Values.pod.resources.libvirt | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} @@ -106,33 +104,25 @@ spec: - /tmp/ceph-secret-define.sh {{- end }} volumeMounts: - - name: nova-bin + - name: libvirt-bin mountPath: /tmp/libvirt.sh subPath: libvirt.sh readOnly: true - - name: nova-etc + - name: libvirt-etc mountPath: /etc/libvirt/libvirtd.conf subPath: libvirtd.conf readOnly: true - - name: nova-etc + - name: libvirt-etc mountPath: /etc/libvirt/qemu.conf subPath: qemu.conf readOnly: true - - name: nova-etc - mountPath: /etc/nova/nova.conf - subPath: nova.conf - readOnly: true - - name: nova-etc - mountPath: /etc/nova/api-paste.ini - subPath: api-paste.ini - readOnly: true - mountPath: /lib/modules name: libmodules readOnly: true - - name: varlibnova - mountPath: /var/lib/nova - - name: varliblibvirt + - name: var-lib-libvirt mountPath: /var/lib/libvirt + - name: var-lib-nova + mountPath: /var/lib/nova - name: run mountPath: /run - name: dev @@ -153,20 +143,20 @@ spec: mountPath: /tmp/client-keyring subPath: key readOnly: true - - name: nova-bin + - name: libvirt-bin mountPath: /tmp/ceph-secret-define.sh subPath: ceph-secret-define.sh readOnly: true {{- end }} -{{ if $mounts_nova_libvirt.volumeMounts }}{{ toYaml $mounts_nova_libvirt.volumeMounts | indent 12 }}{{ end }} +{{ if $mounts_libvirt.volumeMounts }}{{ toYaml $mounts_libvirt.volumeMounts | indent 12 }}{{ end }} volumes: - - name: nova-bin + - name: libvirt-bin configMap: - name: nova-bin + name: libvirt-bin defaultMode: 0555 - - name: nova-etc + - name: libvirt-etc configMap: - name: nova-etc + name: libvirt-etc defaultMode: 0444 {{- if .Values.ceph.enabled }} - name: etcceph @@ -182,12 +172,12 @@ spec: - name: libmodules hostPath: path: /lib/modules - - name: varlibnova - hostPath: - path: /var/lib/nova - - name: varliblibvirt + - name: var-lib-libvirt hostPath: path: /var/lib/libvirt + - name: var-lib-nova + hostPath: + path: /var/lib/nova - name: run hostPath: path: /run @@ -200,5 +190,5 @@ spec: - name: machine-id hostPath: path: /etc/machine-id -{{ if $mounts_nova_libvirt.volumes }}{{ toYaml $mounts_nova_libvirt.volumes | indent 8 }}{{ end }} +{{ if $mounts_libvirt.volumes }}{{ toYaml $mounts_libvirt.volumes | indent 8 }}{{ end }} {{- end }} diff --git a/nova/templates/etc/_libvirtd.conf.tpl b/libvirt/templates/etc/_libvirtd.conf.tpl similarity index 100% rename from nova/templates/etc/_libvirtd.conf.tpl rename to libvirt/templates/etc/_libvirtd.conf.tpl diff --git a/nova/templates/etc/_qemu.conf.tpl b/libvirt/templates/etc/_qemu.conf.tpl similarity index 100% rename from nova/templates/etc/_qemu.conf.tpl rename to libvirt/templates/etc/_qemu.conf.tpl diff --git a/libvirt/values.yaml b/libvirt/values.yaml new file mode 100644 index 0000000000..dd8c06f1de --- /dev/null +++ b/libvirt/values.yaml @@ -0,0 +1,76 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Default values for libvirt. +# This is a YAML-formatted file. +# Declare name/value pairs to be passed into your templates. +# name: value + +release_group: null + +labels: + agent: + libvirt: + node_selector_key: openstack-compute-node + node_selector_value: enabled + +images: + libvirt: docker.io/kolla/ubuntu-source-nova-libvirt:3.0.3 + pull_policy: "IfNotPresent" + + +ceph: + enabled: true + monitors: [] + cinder_user: "admin" + cinder_keyring: null + secret_uuid: 457eb676-33da-42ec-9a8c-9293d545c337 + +libvirt: + listen_addr: 0.0.0.0 + log_level: 3 + +pod: + affinity: + anti: + type: + default: preferredDuringSchedulingIgnoredDuringExecution + topologyKey: + default: kubernetes.io/hostname + mounts: + libvirt: + init_container: null + libvirt: + lifecycle: + upgrades: + daemonsets: + pod_replacement_strategy: RollingUpdate + libvirt: + enabled: true + min_ready_seconds: 0 + max_unavailable: 1 + resources: + enabled: false + libvirt: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + +manifests: + configmap_bin: true + configmap_etc: true + daemonset_libvirt: true diff --git a/nova/templates/configmap-bin.yaml b/nova/templates/configmap-bin.yaml index 5841861cfc..4a7ed6440c 100644 --- a/nova/templates/configmap-bin.yaml +++ b/nova/templates/configmap-bin.yaml @@ -35,11 +35,9 @@ data: {{- include "helm-toolkit.scripts.keystone_endpoints" . | indent 4 }} ks-user.sh: |+ {{- include "helm-toolkit.scripts.keystone_user" . | indent 4 }} - libvirt.sh: | -{{ tuple "bin/_libvirt.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} {{- if .Values.ceph.enabled }} - ceph-secret-define.sh: | -{{ tuple "bin/_ceph-secret-define.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} + ceph-keyring.sh: |+ +{{ tuple "bin/_ceph-keyring.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} {{- end }} bootstrap.sh: | {{ tuple "bin/_bootstrap.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} @@ -59,8 +57,6 @@ data: {{ tuple "bin/_nova-scheduler.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} fake-iptables.sh: | {{ tuple "bin/_fake-iptables.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} - ceph-keyring.sh: |+ -{{ tuple "bin/_ceph-keyring.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} nova-novncproxy.sh: | {{ tuple "bin/_nova-novncproxy.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} nova-vnc-compute-init.sh: | diff --git a/nova/templates/configmap-etc.yaml b/nova/templates/configmap-etc.yaml index d11dd21c91..5e16a396af 100644 --- a/nova/templates/configmap-etc.yaml +++ b/nova/templates/configmap-etc.yaml @@ -106,10 +106,6 @@ data: {{- tuple .Values.conf.paste "etc/_api-paste.ini.tpl" . | include "helm-toolkit.utils.configmap_templater" }} policy.yaml: |+ {{ toYaml .Values.conf.policy | indent 4 }} - libvirtd.conf: |+ -{{- tuple .Values.conf.libvirtd "etc/_libvirtd.conf.tpl" . | include "helm-toolkit.utils.configmap_templater" }} - qemu.conf: |+ -{{- tuple .Values.conf.qemu "etc/_qemu.conf.tpl" . | include "helm-toolkit.utils.configmap_templater" }} nova_sudoers: |+ {{- tuple .Values.conf.neutron_sudoers "etc/_nova_sudoers.tpl" . | include "helm-toolkit.utils.configmap_templater" }} rootwrap.conf: |+ diff --git a/nova/values.yaml b/nova/values.yaml index 08fc44afa1..fc43c2c29d 100644 --- a/nova/values.yaml +++ b/nova/values.yaml @@ -24,9 +24,6 @@ labels: compute: node_selector_key: openstack-compute-node node_selector_value: enabled - libvirt: - node_selector_key: openstack-compute-node - node_selector_value: enabled conductor: node_selector_key: openstack-control-plane node_selector_value: enabled @@ -63,7 +60,6 @@ images: novncproxy_assets: docker.io/kolla/ubuntu-source-nova-novncproxy:3.0.3 consoleauth: docker.io/kolla/ubuntu-source-nova-consoleauth:3.0.3 compute: docker.io/kolla/ubuntu-source-nova-compute:3.0.3 - libvirt: docker.io/kolla/ubuntu-source-nova-libvirt:3.0.3 bootstrap: docker.io/kolla/ubuntu-source-heat-engine:3.0.3 dep_check: docker.io/kolla/ubuntu-source-kubernetes-entrypoint:4.0.0 pull_policy: "IfNotPresent" @@ -136,10 +132,6 @@ ceph: cinder_keyring: null secret_uuid: 457eb676-33da-42ec-9a8c-9293d545c337 -libvirt: - listen_addr: 0.0.0.0 - log_level: 3 - dependencies: api: jobs: @@ -196,11 +188,9 @@ dependencies: - service: network endpoint: internal daemonset: + - libvirt # this should be set to corresponding neutron L2 agent - ovs-agent - libvirt: - jobs: - - nova-db-sync consoleauth: jobs: - nova-db-sync @@ -834,9 +824,6 @@ pod: nova_compute: init_container: null nova_compute: - nova_libvirt: - init_container: null - nova_libvirt: nova_api_metadata: init_container: null nova_api_metadata: @@ -882,10 +869,6 @@ pod: enabled: true min_ready_seconds: 0 max_unavailable: 1 - libvirt: - enabled: true - min_ready_seconds: 0 - max_unavailable: 1 disruption_budget: metadata: min_available: 0 @@ -905,13 +888,6 @@ pod: limits: memory: "1024Mi" cpu: "2000m" - libvirt: - requests: - memory: "128Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" api_metadata: requests: memory: "128Mi" @@ -1009,7 +985,6 @@ manifests: configmap_bin: true configmap_etc: true daemonset_compute: true - daemonset_libvirt: true deployment_api_metadata: true deployment_api_osapi: true deployment_conductor: true diff --git a/tools/deployment/armada/openstack-master-aio.yaml b/tools/deployment/armada/openstack-master-aio.yaml index aff4225bce..8122294a26 100644 --- a/tools/deployment/armada/openstack-master-aio.yaml +++ b/tools/deployment/armada/openstack-master-aio.yaml @@ -239,6 +239,28 @@ data: - helm-toolkit --- schema: armada/Chart/v1 +metadata: + schema: metadata/Document/v1 + name: libvirt +data: + chart_name: libvirt + release: libvirt + namespace: openstack + timeout: 300 + install: + no_hooks: false + upgrade: + no_hooks: false + values: {} + source: + type: local + location: /opt/openstack-helm/charts + subpath: libvirt + reference: master + dependencies: + - helm-toolkit +--- +schema: armada/Chart/v1 metadata: schema: metadata/Document/v1 name: keystone @@ -704,6 +726,7 @@ data: - rabbitmq - memcached - ingress + - libvirt --- schema: armada/ChartGroup/v1 metadata: diff --git a/tools/deployment/armada/openstack-master.yaml b/tools/deployment/armada/openstack-master.yaml index 6f3ebbed13..480f7cf4db 100644 --- a/tools/deployment/armada/openstack-master.yaml +++ b/tools/deployment/armada/openstack-master.yaml @@ -232,6 +232,28 @@ data: - helm-toolkit --- schema: armada/Chart/v1 +metadata: + schema: metadata/Document/v1 + name: libvirt +data: + chart_name: libvirt + release: libvirt + namespace: openstack + timeout: 300 + install: + no_hooks: false + upgrade: + no_hooks: false + values: {} + source: + type: local + location: /opt/openstack-helm/charts + subpath: libvirt + reference: master + dependencies: + - helm-toolkit +--- +schema: armada/Chart/v1 metadata: schema: metadata/Document/v1 name: keystone @@ -697,6 +719,7 @@ data: - rabbitmq - memcached - ingress + - libvirt --- schema: armada/ChartGroup/v1 metadata: diff --git a/tools/gate/launch-osh/basic.sh b/tools/gate/launch-osh/basic.sh index ce5deda409..304b5af032 100755 --- a/tools/gate/launch-osh/basic.sh +++ b/tools/gate/launch-osh/basic.sh @@ -74,6 +74,7 @@ fi helm install --namespace=openstack ${WORK_DIR}/memcached --name=memcached helm install --namespace=openstack ${WORK_DIR}/etcd --name=etcd-rabbitmq helm install --namespace=openstack ${WORK_DIR}/rabbitmq --name=rabbitmq +helm install --namespace=openstack ${WORK_DIR}/libvirt --name=libvirt kube_wait_for_pods openstack ${SERVICE_LAUNCH_TIMEOUT} helm install --namespace=openstack ${WORK_DIR}/keystone --name=keystone if [ "x$PVC_BACKEND" == "xceph" ]; then