Commit 4be135b
authored
Fix namespace sync waves (#32)
* Fix namespace sync-wave ordering for openstack namespace
Ensure the 'openstack' namespace is created after the 'openstack-operators'
namespace by setting its sync-wave to -29 (vs -30 for all other namespaces).
This provides more fine-grained ordering in ArgoCD synchronization, ensuring
proper namespace dependencies are respected during deployment.
* Add sync-wave ordering for MetalLB after NMState
Set MetalLB sync-wave to '1' to ensure it is deployed after NMState
(which uses the default sync-wave '0'). This provides proper ordering
for the network infrastructure components during ArgoCD synchronization.
Deployment order:
- Wave 0: NMState, OpenStack operator
- Wave 1: MetalLB, NodeNetworkConfigurationPolicy, VaultConnection
* Add OpenShift Project deletion permissions to ArgoCD ClusterRole
Add permissions for the project.openshift.io API group to allow ArgoCD
to manage OpenShift Projects. This fixes DeletionError when removing
applications that manage namespaces/projects.
This allows the ArgoCD application controller service account to
create, update, and delete OpenShift Projects, which is necessary
for full lifecycle management of applications via GitOps.
* Align sync-wave ordering with RHOSO removal process
This commit reorganizes the ArgoCD sync-wave annotations to ensure
proper resource ordering that aligns with the official RHOSO deployment
removal process documented at:
https://docs.redhat.com/en/documentation/red_hat_openstack_services_on_openshift/18.0/html/maintaining_the_red_hat_openstack_services_on_openshift_deployment/assembly_removing-rhoso-deployment-from-rhocp-environment
Key changes:
- Isolate openstack-operators namespace at wave -31 (created first, deleted last)
- Add sync-wave annotations for DataPlane resources:
* OpenStackDataPlaneNodeSet: wave 15
* OpenStackDataPlaneDeployment: wave 20 (deleted first)
- Set NMState to wave 0 (before MetalLB at wave 1) to respect dependencies
- Reorganize patches in sync-wave order for better readability
The ordering now ensures:
1. DataPlane resources are removed first (highest waves)
2. ControlPlane follows (wave 10)
3. Vault/secrets cleanup (waves 1-3)
4. openstack namespace removal (wave -29)
5. Infrastructure operators (MetalLB, NMState) removal (waves 0-1)
6. Operator subscriptions removal (wave -10)
7. OperatorGroups removal (wave -20)
8. General namespaces removal (wave -30)
9. openstack-operators namespace removal last (wave -31)
This guarantees a clean removal process following RHOSO documentation,
preventing resource conflicts and ensuring proper cleanup order when
using ArgoCD's automated sync-wave deletion.
* Add RBAC permissions for ArgoCD-based cleanup operations
Extend the gitops-openstack ClusterRole to support ArgoCD-driven
cleanup operations that align with the RHOSO removal process.
Added permissions for:
- PersistentVolumeClaims: Required for cleaning up storage resources
- Pods: Required for listing and monitoring pod cleanup in namespaces
- VaultConnection and VaultAuth: Required for managing Vault resources
(in addition to existing VaultStaticSecret permissions)
These permissions enable ArgoCD to properly handle cascade deletion
of applications with sync-wave ordering, ensuring resources are
removed in the correct sequence as defined by the sync-wave annotations.
Note: OpenStackDataPlaneServices permissions were already present.
* Fix OpenStack operator initialization sync-wave ordering
Set the OpenStack operator initialization (kind: OpenStack) to sync-wave -5
to ensure proper deletion order.
Current issue:
- OpenStack operator init was at wave 0 (default)
- Infrastructure (MetalLB, etc.) at wave 1
- This caused operator init to be deleted AFTER infrastructure
Correct deletion order (highest to lowest):
- DataPlane/ControlPlane resources (waves 20-10)
- Infrastructure components (waves 5-1)
- NMState (wave 0)
- OpenStack operator init (wave -5) ← Fixed position
- Subscriptions (wave -10)
- OperatorGroups/Namespaces (waves -20 to -31)
This aligns with the RHOSO removal documentation where the operator
is deleted after infrastructure but before operator subscriptions.1 parent d9c1e0c commit 4be135b
2 files changed
Lines changed: 94 additions & 40 deletions
Lines changed: 84 additions & 40 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
| 7 | + | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
17 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
18 | 37 | | |
19 | 38 | | |
20 | 39 | | |
| |||
29 | 48 | | |
30 | 49 | | |
31 | 50 | | |
32 | | - | |
| 51 | + | |
33 | 52 | | |
34 | 53 | | |
35 | 54 | | |
36 | 55 | | |
37 | 56 | | |
38 | 57 | | |
39 | 58 | | |
40 | | - | |
41 | 59 | | |
42 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
43 | 63 | | |
44 | 64 | | |
45 | 65 | | |
46 | 66 | | |
47 | 67 | | |
| 68 | + | |
| 69 | + | |
48 | 70 | | |
49 | | - | |
| 71 | + | |
50 | 72 | | |
51 | 73 | | |
52 | 74 | | |
53 | 75 | | |
54 | 76 | | |
55 | 77 | | |
56 | | - | |
| 78 | + | |
57 | 79 | | |
58 | 80 | | |
59 | 81 | | |
60 | 82 | | |
61 | 83 | | |
62 | 84 | | |
63 | | - | |
| 85 | + | |
64 | 86 | | |
65 | 87 | | |
66 | 88 | | |
67 | 89 | | |
68 | 90 | | |
69 | | - | |
70 | | - | |
71 | | - | |
| 91 | + | |
72 | 92 | | |
73 | 93 | | |
74 | 94 | | |
| |||
78 | 98 | | |
79 | 99 | | |
80 | 100 | | |
81 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
82 | 111 | | |
83 | 112 | | |
84 | 113 | | |
| |||
89 | 118 | | |
90 | 119 | | |
91 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
92 | 132 | | |
93 | 133 | | |
94 | 134 | | |
| |||
100 | 140 | | |
101 | 141 | | |
102 | 142 | | |
103 | | - | |
104 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
105 | 146 | | |
106 | 147 | | |
107 | 148 | | |
108 | 149 | | |
109 | 150 | | |
110 | | - | |
| 151 | + | |
| 152 | + | |
111 | 153 | | |
112 | 154 | | |
113 | | - | |
| 155 | + | |
114 | 156 | | |
115 | 157 | | |
116 | 158 | | |
117 | 159 | | |
118 | 160 | | |
119 | | - | |
| 161 | + | |
120 | 162 | | |
121 | | - | |
| 163 | + | |
122 | 164 | | |
123 | | - | |
| 165 | + | |
124 | 166 | | |
125 | 167 | | |
126 | 168 | | |
127 | 169 | | |
128 | 170 | | |
129 | | - | |
| 171 | + | |
| 172 | + | |
130 | 173 | | |
131 | | - | |
132 | | - | |
133 | | - | |
| 174 | + | |
| 175 | + | |
134 | 176 | | |
135 | 177 | | |
136 | 178 | | |
137 | 179 | | |
138 | 180 | | |
139 | | - | |
140 | | - | |
| 181 | + | |
| 182 | + | |
141 | 183 | | |
142 | | - | |
| 184 | + | |
143 | 185 | | |
144 | | - | |
| 186 | + | |
145 | 187 | | |
146 | 188 | | |
147 | 189 | | |
148 | 190 | | |
149 | 191 | | |
150 | | - | |
| 192 | + | |
| 193 | + | |
151 | 194 | | |
152 | | - | |
| 195 | + | |
153 | 196 | | |
154 | | - | |
| 197 | + | |
155 | 198 | | |
156 | 199 | | |
157 | 200 | | |
158 | 201 | | |
159 | 202 | | |
160 | | - | |
| 203 | + | |
| 204 | + | |
161 | 205 | | |
162 | | - | |
| 206 | + | |
163 | 207 | | |
164 | | - | |
| 208 | + | |
165 | 209 | | |
166 | 210 | | |
167 | 211 | | |
168 | 212 | | |
169 | 213 | | |
170 | | - | |
171 | | - | |
| 214 | + | |
| 215 | + | |
172 | 216 | | |
173 | | - | |
174 | | - | |
175 | | - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
176 | 220 | | |
177 | 221 | | |
178 | 222 | | |
179 | 223 | | |
180 | 224 | | |
181 | | - | |
| 225 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
44 | 52 | | |
45 | 53 | | |
46 | 54 | | |
| |||
78 | 86 | | |
79 | 87 | | |
80 | 88 | | |
| 89 | + | |
| 90 | + | |
81 | 91 | | |
82 | 92 | | |
83 | 93 | | |
| |||
0 commit comments