Skip to content

Commit 650170c

Browse files
committed
"Uninstall" instructions
Some basic instructions on disabling and cleaning up a designate deployment. Jira: OSPRH-20142
1 parent fdf8470 commit 650170c

File tree

1 file changed

+214
-0
lines changed

1 file changed

+214
-0
lines changed

UNINSTALLING.md

Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
# Removing designate from an OpenStack on OpenShift environment
2+
3+
The following instructions walk through the steps of disabling designate and
4+
removing artifacts to allow for a clean re-start of designate in the future.
5+
6+
Please note that these instructions do not include the removal of designate
7+
related cluster networking configuration.
8+
9+
## Backup the controlplane
10+
11+
_Note: the following instructions assume an openstackcontrolplane name of
12+
openstack-galera-network-isolation. The name will likely differ in your
13+
deployment so please adjust accordingly._
14+
15+
It is __highly__ recommended that you back up the OpenstackControlPlane CR
16+
before proceeding.
17+
18+
```console
19+
# oc get -n openstack openstackcontrolplane <insert control plane name here> -o yaml > openstackcontrolplane-backup.yaml
20+
oc get -n openstack openstackcontrolplane openstack-galera-network-isolation -o yaml > openstackcontrolplane-backup.yaml
21+
```
22+
23+
## Disable designate in the control plane
24+
25+
```console
26+
oc patch --type=merge -n openstack openstackcontrolplane openstack-galera-network-isolation --patch '
27+
spec:
28+
designate:
29+
enabled: false
30+
'
31+
32+
# wait until done
33+
oc wait --for=delete -n openstack designate/designate
34+
35+
```
36+
37+
## Disable designate-redis
38+
39+
Verify name of the designate Redis instance. Note that there may be other Redis
40+
instances, do not remove them or it may destabilize other deployed OpenStack
41+
services.
42+
43+
```console
44+
oc get -n openstack redis
45+
NAME STATUS MESSAGE
46+
designate-redis True Setup complete
47+
```
48+
49+
To remove the __designate-redis__ instance, run the following command (_note:
50+
change the 'designate-redis' string to the correct name if different than the
51+
defaults_)
52+
53+
```console
54+
oc patch --type merge -n openstack openstackcontrolplane openstack-galera-network-isolation --type json -p='[{"op": "remove", "path": "/spec/redis/templates/designate-redis"}]'
55+
oc wait --for=delete -n openstack redis/designate-redis
56+
```
57+
58+
Now check that it is removed.
59+
60+
```console
61+
# After removal both the pods and the Designate Redis instance should be gone.
62+
oc get -n openstack pods | grep designate-redis # should give no results
63+
oc get -n openstack redis | grep designate # should give no results
64+
```
65+
66+
## Remove leftover designate services
67+
68+
The operator may not complete remove all of the services it creates when
69+
disabling designate. It is a good idea to check and, if necessary, remove them
70+
manually. For example:
71+
72+
```console
73+
oc get -n openstack svc -l 'component in (designate-backendbind9, designate-unbound)'
74+
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
75+
designate-backendbind9-0 LoadBalancer 10.217.4.49 172.19.0.80 53:31722/UDP,53:31722/TCP 8m8s
76+
designate-backendbind9-1 LoadBalancer 10.217.5.175 172.17.0.82 53:32183/UDP,53:32183/TCP 8m8s
77+
designate-backendbind9-2 LoadBalancer 10.217.5.51 192.168.122.81 53:31431/UDP,53:31431/TCP 8m7s
78+
designate-unbound-0 LoadBalancer 10.217.4.230 172.17.0.81 53:32688/UDP,53:32688/TCP 9m12s
79+
```
80+
81+
Run command
82+
83+
```console
84+
oc delete -n openstack svc -l 'component in (designate-backendbind9, designate-unbound)'
85+
service "designate-backendbind9-0" deleted
86+
service "designate-backendbind9-1" deleted
87+
service "designate-backendbind9-2" deleted
88+
service "designate-unbound-0" deleted
89+
```
90+
91+
```console
92+
oc get -n openstack svc | grep designate # should give no results
93+
```
94+
95+
## Check for and remove remnant configmaps and secrets
96+
97+
Check to make sure any secrets created by designate have been cleaned up.
98+
99+
```console
100+
oc get cm -n openstack | grep designate # should give no results
101+
```
102+
103+
There is a secret that is currently left behind after deployment. To remove it, run:
104+
105+
```console
106+
oc delete secret designate-bind-secret -n openstack
107+
```
108+
109+
## Check for unreleased persistent volume claims
110+
111+
In some situations, persistent volumes are not always fully freed and may
112+
prevent persistent volume claims from succeeding in future deployments. To
113+
release them, run the following command.
114+
115+
```console
116+
oc get pv -n openstack | grep Released | cut -f 1 -d ' ' | while read; do oc patch pv $REPLY -n openstack -p '{"spec":{"claimRef": null}}'; done
117+
```
118+
119+
## Check keystone
120+
121+
Double check that the keystone entry has been removed
122+
123+
```console
124+
oc rsh -n openstack openstackclient openstack endpoint list | grep dns # should return no results
125+
```
126+
127+
## Remove designate db from galera
128+
129+
In general, databases for services in OpenStack are not deleted _by design_ in
130+
the event that a service is accidentally disabled. Removing the database is
131+
recommended if the goal is to re-enable a fresh designate deployment. __DO
132+
NOT__ perform this step if you wish to restart with existing zones, recordsets,
133+
etc. However, clearing the state of the BIND9 servers and re-enabling with
134+
an existing database has not been tested. The following is an example on how
135+
to remove the designate database.
136+
137+
```console
138+
oc get secret -n openstack osp-secret -o jsonpath='{.data.DbRootPassword}' | base64 -d
139+
iAmTheRootDbPassword
140+
141+
oc exec -n openstack -it openstack-galera-0 -- mysql -u root -p
142+
Enter Password: iAmTheRootDbPassword
143+
144+
Welcome to the MariaDB monitor. Commands end with ; or \g.
145+
Your MariaDB connection id is 1128608
146+
Server version: 10.5.27-MariaDB MariaDB Server
147+
148+
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
149+
150+
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
151+
152+
mariaDB [(none)]> show databases like '%designate%';
153+
+------------------------+
154+
| Database (%designate%) |
155+
+------------------------+
156+
| designate |
157+
+------------------------+
158+
1 row in set (0.001 sec)
159+
160+
mariaDB[(none)]> drop database designate;
161+
Query OK, 23 rows affected (0.046 sec). # example output may differ
162+
163+
mariaDB[(none)]> exit
164+
```
165+
166+
## Remove queues remaining in rabbitmq
167+
168+
This will remove any designate related queues remaining in rabbitmq.
169+
170+
```console
171+
oc exec -n openstack -it rabbitmq-server-0 -- /bin/bash -c 'for q in `rabbitmqctl list_queues name | grep designate`; do rabbitmqctl delete_queue $q; done'
172+
```
173+
174+
## Remove neutron-designate integration configuration from neutron
175+
176+
remove the following from the neutron customServiceConfig by editing the OpenstackControlPlane CR
177+
178+
```console
179+
oc edit -n openstack openstackcontrolplane openstack-galera-network-isolation
180+
```
181+
182+
```console
183+
[DEFAULT]
184+
dns_domain = <whatever is there>
185+
external_dns_driver = designate
186+
187+
[designate]
188+
... all entries in this section
189+
190+
```
191+
192+
## Re-enabling designate
193+
194+
_Note: this is not a required step. It is just to verify that designate will
195+
come back cleanly. Certain things that were removed will need to be manually
196+
added back to the contol plane to recover the initial state (e.g. the
197+
neutron-designate configuration in neutron) and are not covered here_
198+
199+
Why re-enable? One of _proofs_ of a clean uninstall is that you should be able
200+
to "re-install" designate with 0 left overs, corruptions or conflicting
201+
pre-existing items in the way.
202+
203+
```console
204+
oc patch --type merge -n openstack openstackcontrolplane openstack-galera-network-isolation --type json -p='[{"op": "add", "path": "/spec/redis/templates/designate-redis", "value": {"designate-redis": { "replicas" : 1 }}}]'
205+
206+
oc patch --type=merge -n openstack openstackcontrolplane openstack-galera-network-isolation --patch '
207+
spec:
208+
designate:
209+
enabled: true
210+
'
211+
sleep 10 # to allow time for OpenShift to create the initial designate object before running the next line
212+
# This might fail the first few times if the system is very loaded.
213+
oc wait --for=condition=Ready=true designate/designate --timeout=240s
214+
```

0 commit comments

Comments
 (0)