Skip to content

Commit 8a75693

Browse files
committed
Add cleanup service CR
This adds a new cleanup osdps that can be used to clean stale services, containers and configs that are not in service list. Depends-On: openstack-k8s-operators/edpm-ansible#1054 Jira: OSPRH-23162 Signed-off-by: rabi <ramishra@redhat.com>
1 parent 0b7b865 commit 8a75693

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed
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: cleanup
5+
spec:
6+
playbook: osp.edpm.cleanup
7+
edpmServiceType: cleanup

docs/assemblies/con_data-plane-services.adoc

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ spec:
8383
|`neutron-metadata` |Include this service to run the Neutron OVN Metadata agent on the data plane nodes. This agent is required to provide metadata services to the Compute nodes.
8484
|`neutron-ovn` |Include this service to run the Neutron OVN agent on the data plane nodes. This agent is required to provide QoS to hardware offloaded ports on the Compute nodes.
8585
|`neutron-dhcp` |Include this service to run a Neutron DHCP agent on the data plane nodes.
86+
|`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.
8687
|===
8788

8889
For more information about the available default services, see https://github.com/openstack-k8s-operators/openstack-operator/tree/main/config/services.
@@ -154,3 +155,38 @@ spec:
154155
- install-certs
155156
- ovn
156157
....
158+
159+
=== Cleaning up removed services
160+
161+
When services are removed from a nodeset's services list, their containers and
162+
configuration files remain on the data plane nodes. Use the `cleanup` service
163+
to remove these artifacts.
164+
165+
The cleanup service tracks which services were previously deployed on each node.
166+
When executed, it identifies services that are no longer in the nodeset's
167+
services list and removes their:
168+
169+
* Containers
170+
* Startup configuration files
171+
* Other configuration files
172+
* Service-specific artifacts (via cleanup tasks defined in each role)
173+
174+
To enable cleanup of orphaned containers, set the `edpm_cleanup_orphaned_containers`
175+
Ansible variable to `true` using `ansibleExtraVars` on the deployment.
176+
177+
The following example shows how to run a one-time cleanup after removing
178+
services from a nodeset:
179+
180+
....
181+
apiVersion: dataplane.openstack.org/v1beta1
182+
kind: OpenStackDataPlaneDeployment
183+
metadata:
184+
name: openstack-edpm-cleanup
185+
spec:
186+
nodeSets:
187+
- openstack-edpm
188+
ansibleExtraVars:
189+
edpm_cleanup_orphaned_containers: true
190+
servicesOverride:
191+
- cleanup
192+
....

0 commit comments

Comments
 (0)