From 90e6ab96d530392dd570737133ea2c5bb16546fe Mon Sep 17 00:00:00 2001 From: Yadnesh Kulkarni Date: Tue, 27 Aug 2024 16:38:06 +0530 Subject: [PATCH] Export environment variables for Kepler deployment Required for openstack-k8s-operators/edpm-ansible#723 Jira: https://issues.redhat.com/browse/OSP-31399 --- apis/bases/core.openstack.org_openstackcontrolplanes.yaml | 2 ++ apis/bases/core.openstack.org_openstackversions.yaml | 6 ++++++ apis/core/v1beta1/openstackversion_types.go | 1 + apis/core/v1beta1/zz_generated.deepcopy.go | 5 +++++ apis/dataplane/v1beta1/openstackdataplanenodeset_types.go | 4 +++- .../bases/core.openstack.org_openstackcontrolplanes.yaml | 2 ++ config/crd/bases/core.openstack.org_openstackversions.yaml | 6 ++++++ config/default/manager_default_images.yaml | 2 ++ ...taplane_v1beta1_openstackdataplaneservice_telemetry.yaml | 1 + docs/assemblies/common_configurations.adoc | 2 ++ docs/assemblies/ctlplane_resources.adoc | 5 +++++ .../assemblies/proc_creating-a-set-of-data-plane-nodes.adoc | 2 ++ hack/export_related_images.sh | 1 + pkg/dataplane/inventory.go | 3 +++ pkg/dataplane/util/version.go | 2 ++ pkg/openstack/version.go | 1 + .../functional/ctlplane/openstackversion_controller_test.go | 2 ++ 17 files changed, 46 insertions(+), 1 deletion(-) diff --git a/apis/bases/core.openstack.org_openstackcontrolplanes.yaml b/apis/bases/core.openstack.org_openstackcontrolplanes.yaml index 665ff2def..8e2905c40 100644 --- a/apis/bases/core.openstack.org_openstackcontrolplanes.yaml +++ b/apis/bases/core.openstack.org_openstackcontrolplanes.yaml @@ -17583,6 +17583,8 @@ spec: type: string edpmIscsidImage: type: string + edpmKeplerImage: + type: string edpmLogrotateCrondImage: type: string edpmMultipathdImage: diff --git a/apis/bases/core.openstack.org_openstackversions.yaml b/apis/bases/core.openstack.org_openstackversions.yaml index 81eab2b18..9d3d4ceda 100644 --- a/apis/bases/core.openstack.org_openstackversions.yaml +++ b/apis/bases/core.openstack.org_openstackversions.yaml @@ -97,6 +97,8 @@ spec: type: string edpmIscsidImage: type: string + edpmKeplerImage: + type: string edpmLogrotateCrondImage: type: string edpmMultipathdImage: @@ -302,6 +304,8 @@ spec: type: string edpmIscsidImage: type: string + edpmKeplerImage: + type: string edpmLogrotateCrondImage: type: string edpmMultipathdImage: @@ -478,6 +482,8 @@ spec: type: string edpmIscsidImage: type: string + edpmKeplerImage: + type: string edpmLogrotateCrondImage: type: string edpmMultipathdImage: diff --git a/apis/core/v1beta1/openstackversion_types.go b/apis/core/v1beta1/openstackversion_types.go index 9e99e619f..62ced7a94 100644 --- a/apis/core/v1beta1/openstackversion_types.go +++ b/apis/core/v1beta1/openstackversion_types.go @@ -106,6 +106,7 @@ type ContainerTemplate struct { EdpmNeutronSriovAgentImage *string `json:"edpmNeutronSriovAgentImage,omitempty"` EdpmOvnBgpAgentImage *string `json:"edpmOvnBgpAgentImage,omitempty"` EdpmNodeExporterImage *string `json:"edpmNodeExporterImage,omitempty"` + EdpmKeplerImage *string `json:"edpmKeplerImage,omitempty"` GlanceAPIImage *string `json:"glanceAPIImage,omitempty"` HeatAPIImage *string `json:"heatAPIImage,omitempty"` HeatCfnapiImage *string `json:"heatCfnapiImage,omitempty"` diff --git a/apis/core/v1beta1/zz_generated.deepcopy.go b/apis/core/v1beta1/zz_generated.deepcopy.go index f6e970226..6bfa2ad11 100644 --- a/apis/core/v1beta1/zz_generated.deepcopy.go +++ b/apis/core/v1beta1/zz_generated.deepcopy.go @@ -423,6 +423,11 @@ func (in *ContainerTemplate) DeepCopyInto(out *ContainerTemplate) { *out = new(string) **out = **in } + if in.EdpmKeplerImage != nil { + in, out := &in.EdpmKeplerImage, &out.EdpmKeplerImage + *out = new(string) + **out = **in + } if in.GlanceAPIImage != nil { in, out := &in.GlanceAPIImage, &out.GlanceAPIImage *out = new(string) diff --git a/apis/dataplane/v1beta1/openstackdataplanenodeset_types.go b/apis/dataplane/v1beta1/openstackdataplanenodeset_types.go index 7c64340d1..aac7e4ecc 100644 --- a/apis/dataplane/v1beta1/openstackdataplanenodeset_types.go +++ b/apis/dataplane/v1beta1/openstackdataplanenodeset_types.go @@ -228,7 +228,8 @@ var ContainerImageDefaults = openstackv1.ContainerImages{ EdpmOvnBgpAgentImage: getStrPtr("quay.io/podified-antelope-centos9/openstack-ovn-bgp-agent:current-podified"), CeilometerComputeImage: getStrPtr("quay.io/podified-antelope-centos9/openstack-telemetry-ceilometer-compute:current-podified"), CeilometerIpmiImage: getStrPtr("quay.io/podified-antelope-centos9/openstack-telemetry-ceilometer-ipmi:current-podified"), - EdpmNodeExporterImage: getStrPtr("quay.io/podified-antelope-centos9/openstack-telemetry-node-exporter:current-podified"), + EdpmNodeExporterImage: getStrPtr("quay.io/prometheus/node-exporter:v1.5.0"), + EdpmKeplerImage: getStrPtr("quay.io/sustainable_computing_io/kepler:release-0.7.11"), OsContainerImage: getStrPtr("quay.io/podified-antelope-centos9/edpm-hardened-uefi:current-podified"), }} @@ -253,6 +254,7 @@ func SetupDefaults() { EdpmNeutronOvnAgentImage: getImageDefault("RELATED_IMAGE_EDPM_NEUTRON_OVN_AGENT_IMAGE_URL_DEFAULT", ContainerImageDefaults.EdpmNeutronOvnAgentImage), EdpmNeutronSriovAgentImage: getImageDefault("RELATED_IMAGE_EDPM_NEUTRON_SRIOV_AGENT_IMAGE_URL_DEFAULT", ContainerImageDefaults.EdpmNeutronSriovAgentImage), EdpmNodeExporterImage: getImageDefault("RELATED_IMAGE_EDPM_NODE_EXPORTER_IMAGE_URL_DEFAULT", ContainerImageDefaults.EdpmNodeExporterImage), + EdpmKeplerImage: getImageDefault("RELATED_IMAGE_EDPM_KEPLER_IMAGE_URL_DEFAULT", ContainerImageDefaults.EdpmKeplerImage), EdpmOvnBgpAgentImage: getImageDefault("RELATED_IMAGE_EDPM_OVN_BGP_AGENT_IMAGE_URL_DEFAULT", ContainerImageDefaults.EdpmOvnBgpAgentImage), CeilometerComputeImage: getImageDefault("RELATED_IMAGE_CEILOMETER_COMPUTE_IMAGE_URL_DEFAULT", ContainerImageDefaults.CeilometerComputeImage), CeilometerIpmiImage: getImageDefault("RELATED_IMAGE_CEILOMETER_IPMI_IMAGE_URL_DEFAULT", ContainerImageDefaults.CeilometerIpmiImage), diff --git a/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml b/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml index 665ff2def..8e2905c40 100644 --- a/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml +++ b/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml @@ -17583,6 +17583,8 @@ spec: type: string edpmIscsidImage: type: string + edpmKeplerImage: + type: string edpmLogrotateCrondImage: type: string edpmMultipathdImage: diff --git a/config/crd/bases/core.openstack.org_openstackversions.yaml b/config/crd/bases/core.openstack.org_openstackversions.yaml index 81eab2b18..9d3d4ceda 100644 --- a/config/crd/bases/core.openstack.org_openstackversions.yaml +++ b/config/crd/bases/core.openstack.org_openstackversions.yaml @@ -97,6 +97,8 @@ spec: type: string edpmIscsidImage: type: string + edpmKeplerImage: + type: string edpmLogrotateCrondImage: type: string edpmMultipathdImage: @@ -302,6 +304,8 @@ spec: type: string edpmIscsidImage: type: string + edpmKeplerImage: + type: string edpmLogrotateCrondImage: type: string edpmMultipathdImage: @@ -478,6 +482,8 @@ spec: type: string edpmIscsidImage: type: string + edpmKeplerImage: + type: string edpmLogrotateCrondImage: type: string edpmMultipathdImage: diff --git a/config/default/manager_default_images.yaml b/config/default/manager_default_images.yaml index 0ba9c4cb2..dba58bc7e 100644 --- a/config/default/manager_default_images.yaml +++ b/config/default/manager_default_images.yaml @@ -81,6 +81,8 @@ spec: value: quay.io/podified-antelope-centos9/openstack-neutron-sriov-agent:current-podified - name: RELATED_IMAGE_EDPM_NODE_EXPORTER_IMAGE_URL_DEFAULT value: quay.io/prometheus/node-exporter:v1.5.0 + - name: RELATED_IMAGE_EDPM_KEPLER_IMAGE_URL_DEFAULT + value: quay.io/sustainable_computing_io/kepler:release-0.7.11 - name: RELATED_IMAGE_EDPM_OVN_BGP_AGENT_IMAGE_URL_DEFAULT value: quay.io/podified-antelope-centos9/openstack-ovn-bgp-agent:current-podified - name: RELATED_IMAGE_GLANCE_API_IMAGE_URL_DEFAULT diff --git a/config/services/dataplane_v1beta1_openstackdataplaneservice_telemetry.yaml b/config/services/dataplane_v1beta1_openstackdataplaneservice_telemetry.yaml index b8a48fd2d..6f98be9c8 100644 --- a/config/services/dataplane_v1beta1_openstackdataplaneservice_telemetry.yaml +++ b/config/services/dataplane_v1beta1_openstackdataplaneservice_telemetry.yaml @@ -16,3 +16,4 @@ spec: - CeilometerComputeImage - CeilometerIpmiImage - EdpmNodeExporterImage + - EdpmKeplerImage diff --git a/docs/assemblies/common_configurations.adoc b/docs/assemblies/common_configurations.adoc index f74c27664..24d13a1ec 100644 --- a/docs/assemblies/common_configurations.adoc +++ b/docs/assemblies/common_configurations.adoc @@ -69,6 +69,7 @@ ifeval::["{build}" != "downstream"] edpm_ovn_bgp_agent_local_ovn_northd_image: "quay.io/podified-antelope-centos9/openstack-ovn-northd edpm_ovn_bgp_agent_local_ovn_controller_image: "quay.io/podified-antelope-centos9/openstack-ovn-controller edpm_telemetry_node_exporter_image: quay.io/prometheus/node-exporter + edpm_telemetry_kepler_image: "quay.io/sustainable_computing_io/kepler" edpm_telemetry_ceilometer_compute_image: quay.io/podified-antelope-centos9/openstack-ceilometer-compute edpm_telemetry_ceilometer_ipmi_image: quay.io/podified-antelope-centos9/openstack-ceilometer-ipmi edpm_nova_compute_image: "quay.io/podified-antelope-centos9/openstack-nova-compute @@ -93,6 +94,7 @@ ifeval::["{build}" == "downstream"] edpm_ovn_bgp_agent_local_ovn_northd_image: "redhat.registry.io/rhoso-beta/openstack-ovn-northd-rhel9:18.0.0 edpm_ovn_bgp_agent_local_ovn_controller_image: "redhat.registry.io/rhoso-beta/openstack-ovn-controller-rhel9:18.0.0 edpm_telemetry_node_exporter_image: redhat.registry.io/prometheus/node-exporter-rhel9:18.0.0 + edpm_telemetry_kepler_image: "registry.redhat.io/openshift-power-monitoring/kepler-rhel9:v0.7.10-2" edpm_telemetry_ceilometer_compute_image: redhat.registry.io/rhoso-beta/openstack-ceilometer-compute-rhel9:18.0.0 edpm_telemetry_ceilometer_ipmi_image: redhat.registry.io/rhoso-beta/openstack-ceilometer-ipmi-rhel9:18.0.0 edpm_nova_compute_image: "redhat.registry.io/rhoso-beta/openstack-nova-compute-rhel9:18.0.0 diff --git a/docs/assemblies/ctlplane_resources.adoc b/docs/assemblies/ctlplane_resources.adoc index 20e3720ff..799905826 100644 --- a/docs/assemblies/ctlplane_resources.adoc +++ b/docs/assemblies/ctlplane_resources.adoc @@ -1931,6 +1931,11 @@ ContainerTemplate - struct that contains container image URLs for each service i | *string | false +| edpmKeplerImage +| +| *string +| false + | glanceAPIImage | | *string diff --git a/docs/assemblies/proc_creating-a-set-of-data-plane-nodes.adoc b/docs/assemblies/proc_creating-a-set-of-data-plane-nodes.adoc index c5f26dcc3..838792dfa 100644 --- a/docs/assemblies/proc_creating-a-set-of-data-plane-nodes.adoc +++ b/docs/assemblies/proc_creating-a-set-of-data-plane-nodes.adoc @@ -276,6 +276,7 @@ ifeval::["{build}" != "downstream"] edpm_frr_image: "quay.io/podified-antelope-centos9/openstack-frr:current-podified" edpm_ovn_bgp_agent_image: "quay.io/podified-antelope-centos9/openstack-ovn-bgp-agent:current-podified" telemetry_node_exporter_image: "quay.io/prometheus/node-exporter:v1.5.0" + edpm_telemetry_kepler_image: "quay.io/sustainable_computing_io/kepler" edpm_libvirt_image: "quay.io/podified-antelope-centos9/openstack-nova-libvirt:current-podified" edpm_nova_compute_image: "quay.io/podified-antelope-centos9/openstack-nova-compute:current-podified" edpm_neutron_sriov_image: "quay.io/podified-antelope-centos9/openstack-neutron-sriov-agent:current-podified" @@ -289,6 +290,7 @@ ifeval::["{build}" == "downstream"] edpm_frr_image: "registry.redhat.io/rhosp-dev-preview/openstack-frr:18.0" edpm_ovn_bgp_agent_image: "registry.redhat.io/rhosp-dev-preview/openstack-ovn-bgp-agent:18.0" telemetry_node_exporter_image: "quay.io/prometheus/node-exporter:v1.5.0" + edpm_telemetry_kepler_image: "registry.redhat.io/openshift-power-monitoring/kepler-rhel9:v0.7.10-2" edpm_libvirt_image: "registry.redhat.io/rhosp-dev-preview/openstack-nova-libvirt:18.0" edpm_nova_compute_image: "registry.redhat.io/rhosp-dev-preview/openstack-nova-compute:18.0" edpm_neutron_sriov_image: "registry.redhat.io/rhosp-dev-preview/openstack-neutron-sriov-agent:18.0" diff --git a/hack/export_related_images.sh b/hack/export_related_images.sh index ccc0fd980..9a9f4ee87 100755 --- a/hack/export_related_images.sh +++ b/hack/export_related_images.sh @@ -80,6 +80,7 @@ export RELATED_IMAGE_EDPM_NEUTRON_OVN_AGENT_IMAGE_URL_DEFAULT=quay.io/podified-a export RELATED_IMAGE_EDPM_NEUTRON_SRIOV_AGENT_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-neutron-sriov-agent:current-podified export RELATED_IMAGE_EDPM_OVN_BGP_AGENT_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-ovn-bgp-agent:current-podified export RELATED_IMAGE_EDPM_NODE_EXPORTER_IMAGE_URL_DEFAULT=quay.io/prometheus/node-exporter:v1.5.0 +export RELATED_IMAGE_EDPM_KEPLER_IMAGE_URL_DEFAULT=quay.io/sustainable_computing_io/kepler:release-0.7.11 export RELATED_IMAGE_TEST_TEMPEST_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-tempest-all:current-podified export RELATED_IMAGE_TEST_TOBIKO_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-tobiko:current-podified export RELATED_IMAGE_TEST_ANSIBLETEST_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-ansible-tests:current-podified diff --git a/pkg/dataplane/inventory.go b/pkg/dataplane/inventory.go index fde583708..6b5db8199 100644 --- a/pkg/dataplane/inventory.go +++ b/pkg/dataplane/inventory.go @@ -296,6 +296,9 @@ func resolveGroupAnsibleVars(template *dataplanev1.NodeTemplate, group *ansible. if template.Ansible.AnsibleVars["edpm_telemetry_node_exporter_image"] == nil { group.Vars["edpm_telemetry_node_exporter_image"] = containerImages.EdpmNodeExporterImage } + if template.Ansible.AnsibleVars["edpm_telemetry_kepler_image"] == nil { + group.Vars["edpm_telemetry_kepler_image"] = containerImages.EdpmKeplerImage + } err := unmarshalAnsibleVars(template.Ansible.AnsibleVars, group.Vars) if err != nil { diff --git a/pkg/dataplane/util/version.go b/pkg/dataplane/util/version.go index 6a883075b..51d358b6f 100644 --- a/pkg/dataplane/util/version.go +++ b/pkg/dataplane/util/version.go @@ -72,6 +72,7 @@ func GetContainerImages(version *openstackv1.OpenStackVersion) openstackv1.Conta containerImages.EdpmNeutronOvnAgentImage = version.Status.ContainerImages.EdpmNeutronOvnAgentImage containerImages.EdpmNeutronSriovAgentImage = version.Status.ContainerImages.EdpmNeutronSriovAgentImage containerImages.EdpmNodeExporterImage = version.Status.ContainerImages.EdpmNodeExporterImage + containerImages.EdpmKeplerImage = version.Status.ContainerImages.EdpmKeplerImage containerImages.EdpmOvnBgpAgentImage = version.Status.ContainerImages.EdpmOvnBgpAgentImage containerImages.NovaComputeImage = version.Status.ContainerImages.NovaComputeImage containerImages.OvnControllerImage = version.Status.ContainerImages.OvnControllerImage @@ -91,6 +92,7 @@ func GetContainerImages(version *openstackv1.OpenStackVersion) openstackv1.Conta containerImages.EdpmNeutronOvnAgentImage = dataplanev1.ContainerImages.EdpmNeutronOvnAgentImage containerImages.EdpmNeutronSriovAgentImage = dataplanev1.ContainerImages.EdpmNeutronSriovAgentImage containerImages.EdpmNodeExporterImage = dataplanev1.ContainerImages.EdpmNodeExporterImage + containerImages.EdpmKeplerImage = dataplanev1.ContainerImages.EdpmKeplerImage containerImages.EdpmOvnBgpAgentImage = dataplanev1.ContainerImages.EdpmOvnBgpAgentImage containerImages.NovaComputeImage = dataplanev1.ContainerImages.NovaComputeImage containerImages.OvnControllerImage = dataplanev1.ContainerImages.OvnControllerImage diff --git a/pkg/openstack/version.go b/pkg/openstack/version.go index 1054e9208..79f6246cb 100644 --- a/pkg/openstack/version.go +++ b/pkg/openstack/version.go @@ -118,6 +118,7 @@ func GetContainerImages(defaults *corev1beta1.ContainerDefaults, instance corev1 EdpmNeutronSriovAgentImage: getImg(instance.Spec.CustomContainerImages.EdpmNeutronSriovAgentImage, defaults.EdpmNeutronSriovAgentImage), EdpmOvnBgpAgentImage: getImg(instance.Spec.CustomContainerImages.EdpmOvnBgpAgentImage, defaults.EdpmOvnBgpAgentImage), EdpmNodeExporterImage: getImg(instance.Spec.CustomContainerImages.EdpmNodeExporterImage, defaults.EdpmNodeExporterImage), + EdpmKeplerImage: getImg(instance.Spec.CustomContainerImages.EdpmKeplerImage, defaults.EdpmKeplerImage), GlanceAPIImage: getImg(instance.Spec.CustomContainerImages.GlanceAPIImage, defaults.GlanceAPIImage), HeatAPIImage: getImg(instance.Spec.CustomContainerImages.HeatAPIImage, defaults.HeatAPIImage), HeatCfnapiImage: getImg(instance.Spec.CustomContainerImages.HeatCfnapiImage, defaults.HeatCfnapiImage), diff --git a/tests/functional/ctlplane/openstackversion_controller_test.go b/tests/functional/ctlplane/openstackversion_controller_test.go index f5deccd39..5536b881c 100644 --- a/tests/functional/ctlplane/openstackversion_controller_test.go +++ b/tests/functional/ctlplane/openstackversion_controller_test.go @@ -131,6 +131,7 @@ var _ = Describe("OpenStackOperator controller", func() { g.Expect(version.Status.ContainerImages.EdpmNeutronMetadataAgentImage).ShouldNot(BeNil()) g.Expect(version.Status.ContainerImages.EdpmNeutronSriovAgentImage).ShouldNot(BeNil()) g.Expect(version.Status.ContainerImages.EdpmNodeExporterImage).ShouldNot(BeNil()) + g.Expect(version.Status.ContainerImages.EdpmKeplerImage).ShouldNot(BeNil()) g.Expect(version.Status.ContainerImages.EdpmOvnBgpAgentImage).ShouldNot(BeNil()) g.Expect(version.Status.ContainerImages.GlanceAPIImage).ShouldNot(BeNil()) g.Expect(version.Status.ContainerImages.HeatAPIImage).ShouldNot(BeNil()) @@ -175,6 +176,7 @@ var _ = Describe("OpenStackOperator controller", func() { g.Expect(version.Status.ContainerImages.SwiftObjectImage).ShouldNot(BeNil()) g.Expect(version.Status.ContainerImages.SwiftProxyImage).ShouldNot(BeNil()) g.Expect(version.Status.ContainerImages.EdpmNodeExporterImage).ShouldNot(BeNil()) + g.Expect(version.Status.ContainerImages.EdpmKeplerImage).ShouldNot(BeNil()) }, timeout, interval).Should(Succeed()) })