Skip to content

Commit 2bf0c2f

Browse files
Merge pull request openstack-k8s-operators#2176 from oliashish/feat/upgrade-service
Added: upgrade-services for major 18->19 upgrade for EDPM node
2 parents 9527fce + f803563 commit 2bf0c2f

3 files changed

Lines changed: 54 additions & 0 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apiVersion: dataplane.openstack.org/v1beta1
2+
kind: OpenStackDataPlaneService
3+
metadata:
4+
name: upgrade-services
5+
spec:
6+
playbook: osp.edpm.upgrade_services
7+
edpmServiceType: upgrade-services

‎docs/assemblies/con_data-plane-services.adoc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ spec:
8787
|`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.
8888
|`neutron-dhcp` |Include this service to run a Neutron DHCP agent on the data plane nodes.
8989
|`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.
90+
|`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.
9091
|===
9192

9293
For more information about the available default services, see https://github.com/openstack-k8s-operators/openstack-operator/tree/main/config/services.

‎test/functional/dataplane/openstackdataplanenodeset_controller_test.go‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1322,6 +1322,52 @@ var _ = Describe("Dataplane NodeSet Test", func() {
13221322
})
13231323
})
13241324

1325+
When("A DataPlaneNodeSet is deployed with the upgrade service override", func() {
1326+
BeforeEach(func() {
1327+
dataplanev1.SetupDefaults()
1328+
1329+
deploymentSpec := DefaultDataPlaneDeploymentSpec()
1330+
deploymentSpec["servicesOverride"] = []string{"upgrade-services"}
1331+
1332+
DeferCleanup(th.DeleteInstance,
1333+
CreateNetConfig(dataplaneNetConfigName, DefaultNetConfigSpec()))
1334+
DeferCleanup(th.DeleteInstance,
1335+
CreateDNSMasq(dnsMasqName, DefaultDNSMasqSpec()))
1336+
DeferCleanup(th.DeleteInstance,
1337+
CreateDataplaneNodeSet(
1338+
dataplaneNodeSetName,
1339+
DefaultDataPlaneNoNodeSetSpec(false)))
1340+
DeferCleanup(th.DeleteInstance,
1341+
CreateDataplaneDeployment(dataplaneDeploymentName, deploymentSpec))
1342+
1343+
CreateSSHSecret(dataplaneSSHSecretName)
1344+
CreateCABundleSecret(caBundleSecretName)
1345+
SimulateDNSMasqComplete(dnsMasqName)
1346+
SimulateIPSetComplete(dataplaneNodeName)
1347+
SimulateDNSDataComplete(dataplaneNodeSetName)
1348+
})
1349+
1350+
It("creates an Ansible execution for the upgrade playbook", func() {
1351+
Eventually(func(g Gomega) {
1352+
ansibleeeName := types.NamespacedName{
1353+
Name: fmt.Sprintf("%s-%s-%s",
1354+
"upgrade-services",
1355+
dataplaneDeploymentName.Name,
1356+
dataplaneNodeSetName.Name),
1357+
Namespace: namespace,
1358+
}
1359+
ansibleEE := GetAnsibleee(ansibleeeName)
1360+
container := ansibleEE.Spec.Template.Spec.Containers[0]
1361+
1362+
g.Expect(container.Args).To(ContainElement("osp.edpm.upgrade_services"))
1363+
g.Expect(findEnvVar(container.Env).Value).
1364+
To(ContainSubstring("edpm_service_type"))
1365+
g.Expect(findEnvVar(container.Env).Value).
1366+
To(ContainSubstring("upgrade-services"))
1367+
}, th.Timeout, th.Interval).Should(Succeed())
1368+
})
1369+
})
1370+
13251371
When("A NodeSet and Deployment are created", func() {
13261372
BeforeEach(func() {
13271373
nodeSetSpec := DefaultDataPlaneNodeSetSpec("edpm-compute")

0 commit comments

Comments
 (0)