[libvirt] Implement daemonset overrides for libvirt

The patch implements libvirt daemonset to use overrides daemonset_overrides_root

  .Values:
    overrides:
      libvirt_libvirt:
        labels:
          label::value:
            values:
              override_root_option: override_root_value
              conf:
                dynamic_options:
                  libvirt:
                    listen_interface: null

Change-Id: If4c61f248d752316c54955ebf9712bb3235c06fd
This commit is contained in:
Vasyl Saienko 2020-11-04 09:47:31 +02:00
parent 6fb6253bfb
commit 46cc2c070f
5 changed files with 34 additions and 6 deletions

View File

@ -15,7 +15,7 @@ apiVersion: v1
appVersion: v1.0.0
description: OpenStack-Helm libvirt
name: libvirt
version: 0.1.37
version: 0.1.38
home: https://libvirt.org
sources:
- https://libvirt.org/git/?p=libvirt.git;a=summary

View File

@ -12,13 +12,15 @@ See the License for the specific language governing permissions and
limitations under the License.
*/}}
{{- if .Values.manifests.configmap_bin }}
{{- $envAll := . }}
{{- define "libvirt.configmap.bin" }}
{{- $configMapName := index . 0 }}
{{- $envAll := index . 1 }}
{{- with $envAll }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: libvirt-bin
name: {{ $configMapName }}
data:
{{- if .Values.images.local_registry.active }}
image-repo-sync.sh: |
@ -39,3 +41,7 @@ data:
{{- include "helm-toolkit.snippets.values_template_renderer" (dict "envAll" $envAll "template" .Values.conf.init_modules.script "key" "libvirt-init-modules.sh") | indent 2 }}
{{- include "helm-toolkit.snippets.values_template_renderer" (dict "envAll" $envAll "template" .Values.conf.dynamic_options.script "key" "init-dynamic-options.sh") | indent 2 }}
{{- end }}
{{- end }}
{{- if .Values.manifests.configmap_bin }}
{{- list "libvirt-bin" . | include "libvirt.configmap.bin" }}
{{- end }}

View File

@ -407,8 +407,8 @@ spec:
{{- $_ := include "helm-toolkit.utils.dependency_resolver" $dependencyOpts | toString | fromYaml }}
{{ tuple $envAll "pod_dependency" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
{{- $daemonset_yaml := list $daemonset $configMapName $serviceAccountName . | include "libvirt.daemonset" | toString | fromYaml }}
{{- $configmap_yaml := "libvirt.configmap.etc" }}
{{- list $daemonset $daemonset_yaml $configmap_yaml $configMapName . | include "helm-toolkit.utils.daemonset_overrides" }}
{{/* Preffer using .Values.overrides rather than .Values.conf.overrides */}}
{{- list $daemonset "libvirt.daemonset" $serviceAccountName $configmap_yaml $configMapName "libvirt.configmap.bin" "libvirt-bin" . | include "helm-toolkit.utils.daemonset_overrides_root" }}
{{- end }}

View File

@ -0,0 +1,21 @@
---
# We have two nodes labeled with node-nics-type=4nics and node-nics-type=2nics
# on first node we pick up libvirt bind address from ens3 interface
# on second node we pick up libvirt bind address from ens0 interface
overrides:
libvirt_libvirt:
overrides_default: false
labels:
node-nics-type::4nics:
values:
conf:
dynamic_options:
libvirt:
listen_interface: ens3
node-nics-type::2nics:
values:
conf:
dynamic_options:
libvirt:
listen_interface: ens0
...

View File

@ -38,4 +38,5 @@ libvirt:
- 0.1.35 Allow to initialize virtualization modules
- 0.1.36 Allow to generate dynamic config options
- 0.1.37 Make readiness probes more tiny
- 0.1.38 Implement daemonset overrides for libvirt
...