diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/pci_irq_affinity_agent.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/pci_irq_affinity_agent.py index 52f55ad2..8e04af03 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/pci_irq_affinity_agent.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/pci_irq_affinity_agent.py @@ -18,6 +18,8 @@ class PciIrqAffinityAgentHelm(openstack.OpenstackBaseHelm): """Class to encapsulate helm operations for the PCI IRQ affinity agent chart""" CHART = app_constants.HELM_CHART_PCI_IRQ_AFFINITY_AGENT + AUTH_USERS = ['pci-irq-affinity-agent'] + SERVICE_NAME = app_constants.HELM_CHART_PCI_IRQ_AFFINITY_AGENT def __init__(self, operator): super(PciIrqAffinityAgentHelm, self).__init__(operator) @@ -46,6 +48,12 @@ class PciIrqAffinityAgentHelm(openstack.OpenstackBaseHelm): )['nova'] overrides = { + 'identity': { + 'auth': self._get_endpoints_identity_overrides( + self.SERVICE_NAME, + self.AUTH_USERS + ), + }, 'rabbit': { 'rabbit_userid': nova_oslo_messaging_data['username'], 'rabbit_password': nova_oslo_messaging_data['password'], diff --git a/stx-openstack-helm/stx-openstack-helm/helm-charts/pci-irq-affinity-agent/templates/bin/_patch_keyring.sh.tpl b/stx-openstack-helm/stx-openstack-helm/helm-charts/pci-irq-affinity-agent/templates/bin/_patch_keyring.sh.tpl deleted file mode 100644 index 9936b8a9..00000000 --- a/stx-openstack-helm/stx-openstack-helm/helm-charts/pci-irq-affinity-agent/templates/bin/_patch_keyring.sh.tpl +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -# -# Copyright (c) 2021 Wind River Systems, Inc. -# -# SPDX-License-Identifier: Apache-2.0 -# - -# Script to patch the keyring library so that it allows automation -# by not asking for user input on the keyring password -# This 'change' was taken from the platform keyring library -KEYRING_LIB=$(find / -name file.py) -sed -i '/self.keyring_key *= *getpass.getpass(/,/)/s/^/#/;/self.keyring_key *= *getpass.getpass/i\ # TAKEN FROM PLATFORM KEYRING CODE\n\ self.keyring_key = "Please set a password for your new keyring: "' $KEYRING_LIB diff --git a/stx-openstack-helm/stx-openstack-helm/helm-charts/pci-irq-affinity-agent/templates/bin/_start.sh.tpl b/stx-openstack-helm/stx-openstack-helm/helm-charts/pci-irq-affinity-agent/templates/bin/_start.sh.tpl index 2464e41b..61875d72 100644 --- a/stx-openstack-helm/stx-openstack-helm/helm-charts/pci-irq-affinity-agent/templates/bin/_start.sh.tpl +++ b/stx-openstack-helm/stx-openstack-helm/helm-charts/pci-irq-affinity-agent/templates/bin/_start.sh.tpl @@ -7,5 +7,4 @@ # # Script to encapsulate the starting routines -sh -c /tmp/patch_keyring.sh python /tmp/start.py diff --git a/stx-openstack-helm/stx-openstack-helm/helm-charts/pci-irq-affinity-agent/templates/configmap-bin.yaml b/stx-openstack-helm/stx-openstack-helm/helm-charts/pci-irq-affinity-agent/templates/configmap-bin.yaml index e56afc9b..9eefe732 100644 --- a/stx-openstack-helm/stx-openstack-helm/helm-charts/pci-irq-affinity-agent/templates/configmap-bin.yaml +++ b/stx-openstack-helm/stx-openstack-helm/helm-charts/pci-irq-affinity-agent/templates/configmap-bin.yaml @@ -19,8 +19,6 @@ data: {{ tuple "bin/_start.py.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} health-probe.py: | {{ tuple "bin/_health-probe.py.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} - patch_keyring.sh: | -{{ tuple "bin/_patch_keyring.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} start.sh: | {{ tuple "bin/_start.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} {{- end }} diff --git a/stx-openstack-helm/stx-openstack-helm/helm-charts/pci-irq-affinity-agent/templates/configmap-etc.yaml b/stx-openstack-helm/stx-openstack-helm/helm-charts/pci-irq-affinity-agent/templates/configmap-etc.yaml index 9f93db41..54afd04c 100644 --- a/stx-openstack-helm/stx-openstack-helm/helm-charts/pci-irq-affinity-agent/templates/configmap-etc.yaml +++ b/stx-openstack-helm/stx-openstack-helm/helm-charts/pci-irq-affinity-agent/templates/configmap-etc.yaml @@ -17,5 +17,4 @@ metadata: type: Opaque data: {{- include "helm-toolkit.snippets.values_template_renderer" (dict "envAll" $envAll "template" .Values.conf.template "key" "config.ini" "format" "Secret") | indent 2 }} -{{- include "helm-toolkit.snippets.values_template_renderer" (dict "envAll" $envAll "template" .Values.conf.keyring "key" "keyringrc.cfg" "format" "Secret") | indent 2 }} {{- end }} diff --git a/stx-openstack-helm/stx-openstack-helm/helm-charts/pci-irq-affinity-agent/templates/daemonset.yaml b/stx-openstack-helm/stx-openstack-helm/helm-charts/pci-irq-affinity-agent/templates/daemonset.yaml index 4bcbe310..1fd22bc8 100644 --- a/stx-openstack-helm/stx-openstack-helm/helm-charts/pci-irq-affinity-agent/templates/daemonset.yaml +++ b/stx-openstack-helm/stx-openstack-helm/helm-charts/pci-irq-affinity-agent/templates/daemonset.yaml @@ -10,9 +10,10 @@ {{- $daemonset := "pci-irq-affinity-agent" }} {{- $configMapName := "pci-irq-affinity-agent-etc" }} {{- $binConfigMapName := "pci-irq-affinity-agent-bin" }} +{{- $mounts_pci_irq_affinity_agent_init := .Values.pod.mounts.pci_irq_affinity_agent.init_container }} {{- $envAll := . }} -{{- tuple $envAll "agent" $daemonset | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} +{{- tuple $envAll "pci_irq_affinity_agent" $daemonset | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- apiVersion: apps/v1 kind: DaemonSet @@ -36,6 +37,8 @@ spec: {{ .Values.labels.agent.pci_irq_affinity_agent.node_selector_key }}: {{ .Values.labels.agent.pci_irq_affinity_agent.node_selector_value }} tolerations: {{ toYaml .Values.tolerations | indent 8 }} + initContainers: +{{ tuple $envAll "pci_irq_affinity_agent" $mounts_pci_irq_affinity_agent_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: - name: pci-irq-affinity-agent image: {{ .Values.images.tags.pci_irq_affinity_agent }} @@ -77,13 +80,6 @@ spec: mountPath: /etc/pci_irq_affinity/config.ini subPath: config.ini readOnly: true - - name: {{ $configMapName }} - mountPath: /root/.local/share/python_keyring/keyringrc.cfg - subPath: keyringrc.cfg - readOnly: true - - name: keyring - mountPath: /root/.local/share/python_keyring/crypted_pass.cfg - readOnly: true - name: libvirt-sock-ro mountPath: /var/run/libvirt/libvirt-sock-ro readOnly: true @@ -97,10 +93,6 @@ spec: mountPath: /tmp/start.py subPath: start.py readOnly: true - - name: {{ $binConfigMapName }} - mountPath: /tmp/patch_keyring.sh - subPath: patch_keyring.sh - readOnly: true - name: {{ $binConfigMapName }} mountPath: /tmp/start.sh subPath: start.sh @@ -117,10 +109,6 @@ spec: secret: defaultMode: 0644 secretName: {{ $configMapName }} - - name: keyring - hostPath: - path: /opt/platform/.keyring/21.12/python_keyring/crypted_pass.cfg # TODO (hmatsui): dynamically get version (e.g. 21.12) - type: File - name: libvirt-sock-ro hostPath: path: /var/run/libvirt/libvirt-sock-ro diff --git a/stx-openstack-helm/stx-openstack-helm/helm-charts/pci-irq-affinity-agent/values.yaml b/stx-openstack-helm/stx-openstack-helm/helm-charts/pci-irq-affinity-agent/values.yaml index a734c880..2a2cd559 100644 --- a/stx-openstack-helm/stx-openstack-helm/helm-charts/pci-irq-affinity-agent/values.yaml +++ b/stx-openstack-helm/stx-openstack-helm/helm-charts/pci-irq-affinity-agent/values.yaml @@ -30,15 +30,20 @@ labels: dependencies: static: pci_irq_affinity_agent: - services: - - endpoint: internal - service: keystone - - endpoint: internal - service: rabbitmq - - endpoint: internal - service: nova + pod: + - requireSameNode: true + labels: + application: libvirt + component: libvirt + - requireSameNode: true + labels: + application: nova + component: compute pod: + mounts: + pci_irq_affinity_agent: + init_container: null security_context: pci_irq_affinity_agent: pod: @@ -60,6 +65,7 @@ conf: auth: admin: username: admin + password: password project_name: admin user_domain_name: default project_domain_name: default @@ -80,6 +86,7 @@ conf: [openstack] openstack_enabled={{ .Values.conf.endpoints.keystone.openstack_enabled }} username={{ .Values.conf.endpoints.identity.auth.admin.username }} + password={{ .Values.conf.endpoints.identity.auth.admin.password }} tenant={{ .Values.conf.endpoints.identity.auth.admin.username }} authorization_protocol={{ .Values.conf.endpoints.keystone.openstack_auth_protocol }} authorization_ip={{ .Values.conf.endpoints.keystone.openstack_auth_host }} @@ -99,9 +106,6 @@ conf: user_id={{ .Values.conf.endpoints.rabbit.rabbit_userid }} password={{ .Values.conf.endpoints.rabbit.rabbit_password }} virt_host={{ .Values.conf.endpoints.rabbit.rabbit_virtual_host }} - keyring: | - [backend] - default-keyring=keyrings.alt.file.EncryptedKeyring host: mount_path: pci_devices: /compute/sys/bus/pci/devices