Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: dataplane.openstack.org/v1beta1
kind: OpenStackDataPlaneService
metadata:
name: upgrade-services
spec:
playbook: osp.edpm.upgrade_services
edpmServiceType: upgrade-services
1 change: 1 addition & 0 deletions docs/assemblies/con_data-plane-services.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ spec:
|`neutron-metadata` |(Deprecated) Include this service to run the standalone Neutron OVN Metadata agent on the data plane nodes. Superseded by the `metadata` extension of the `neutron-ovn` service, which is enabled by default.
|`neutron-dhcp` |Include this service to run a Neutron DHCP agent on the data plane nodes.
|`cleanup` |Include this service to clean up containers and configurations for services that have been removed from the nodeset. The cleanup service compares the current services list with previously deployed services, removes containers for services no longer in the list, removes startup_config and configuration files, and runs service-specific cleanup tasks. Use this service via `servicesOverride` for one-time cleanup after removing services from a nodeset, or add to the services list if cleanup should run on every deployment.
|`upgrade-services` |Include this service explicitly through `servicesOverride` to run the `osp.edpm.upgrade_services` playbook. This service is not enabled by default and should only be used for a major-version upgrade of the data plane.
|===

For more information about the available default services, see https://github.com/openstack-k8s-operators/openstack-operator/tree/main/config/services.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1322,6 +1322,52 @@ var _ = Describe("Dataplane NodeSet Test", func() {
})
})

When("A DataPlaneNodeSet is deployed with the upgrade service override", func() {
BeforeEach(func() {
dataplanev1.SetupDefaults()

deploymentSpec := DefaultDataPlaneDeploymentSpec()
deploymentSpec["servicesOverride"] = []string{"upgrade-services"}

DeferCleanup(th.DeleteInstance,
CreateNetConfig(dataplaneNetConfigName, DefaultNetConfigSpec()))
DeferCleanup(th.DeleteInstance,
CreateDNSMasq(dnsMasqName, DefaultDNSMasqSpec()))
DeferCleanup(th.DeleteInstance,
CreateDataplaneNodeSet(
dataplaneNodeSetName,
DefaultDataPlaneNoNodeSetSpec(false)))
DeferCleanup(th.DeleteInstance,
CreateDataplaneDeployment(dataplaneDeploymentName, deploymentSpec))

CreateSSHSecret(dataplaneSSHSecretName)
CreateCABundleSecret(caBundleSecretName)
SimulateDNSMasqComplete(dnsMasqName)
SimulateIPSetComplete(dataplaneNodeName)
SimulateDNSDataComplete(dataplaneNodeSetName)
})

It("creates an Ansible execution for the upgrade playbook", func() {
Eventually(func(g Gomega) {
ansibleeeName := types.NamespacedName{
Name: fmt.Sprintf("%s-%s-%s",
"upgrade-services",
dataplaneDeploymentName.Name,
dataplaneNodeSetName.Name),
Namespace: namespace,
}
ansibleEE := GetAnsibleee(ansibleeeName)
container := ansibleEE.Spec.Template.Spec.Containers[0]

g.Expect(container.Args).To(ContainElement("osp.edpm.upgrade_services"))
g.Expect(findEnvVar(container.Env).Value).
To(ContainSubstring("edpm_service_type"))
g.Expect(findEnvVar(container.Env).Value).
To(ContainSubstring("upgrade-services"))
}, th.Timeout, th.Interval).Should(Succeed())
})
})

When("A NodeSet and Deployment are created", func() {
BeforeEach(func() {
nodeSetSpec := DefaultDataPlaneNodeSetSpec("edpm-compute")
Expand Down
Loading