Nova: Move Libvirt into its own chart

This PS moves libvirt into its own chart - decoupling it from nova,
both making it easier to deploy and use seperately and permitting
use of other compute backends.

Partially implements: blueprint split-nova-and-neutron-infra

Change-Id: I06237157244c3cdb5503eafa01229d061b1614f0
This commit is contained in:
Pete Birley 2017-08-14 23:02:52 -05:00
parent 84eecc457e
commit 0252ca776e
19 changed files with 289 additions and 72 deletions

View File

@ -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

View File

@ -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:**

24
libvirt/Chart.yaml Normal file
View File

@ -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

18
libvirt/requirements.yaml Normal file
View File

@ -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

View File

@ -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 <<EOF > /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

View File

@ -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 }}

View File

@ -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 }}

View File

@ -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 }}

76
libvirt/values.yaml Normal file
View File

@ -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

View File

@ -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: |

View File

@ -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: |+

View File

@ -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

View File

@ -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:

View File

@ -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:

View File

@ -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