Skip to content

Commit 3ff83cd

Browse files
committed
Add draft decommissioning instructions for cloudscale without Puppet LBs
1 parent 3fcc71f commit 3ff83cd

File tree

4 files changed

+40
-2
lines changed

4 files changed

+40
-2
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
:puppet_lbs: no
2+
:needs_hieradata_edit: no
3+
4+
= Uninstallation on cloudscale (no Puppet-managed LBs)
5+
6+
include::page$how-tos/cloudscale/decommission.adoc[]

docs/modules/ROOT/pages/how-tos/cloudscale/decommission.adoc

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
ifeval::["{puppet_lbs}" != "no"]
12
= Uninstallation on cloudscale
3+
endif::[]
24

35
:provider: cloudscale
46

@@ -104,26 +106,32 @@ kubectl get nodes
104106

105107
. Configure Terraform secrets
106108
+
107-
[source,bash]
109+
[source,bash,attributes="subs+"]
108110
----
109111
cat <<EOF > ./terraform.env
110112
CLOUDSCALE_API_TOKEN
113+
ifeval::["{puppet_lbs}" != "no"]
111114
HIERADATA_REPO_TOKEN
115+
endif::[]
112116
EOF
113117
----
114118

115119
include::partial$setup_terraform.adoc[]
116120

121+
ifeval::["{puppet_lbs}" != "no"]
117122
include::partial$prepare-for-lb-decommission.adoc[]
123+
endif::[]
118124

119125
. Delete resources from cloudscale using Terraform
120126
+
121-
[source,bash]
127+
[source,bash,attributes="subs+"]
122128
----
123129
# The first time it will fail
124130
terraform destroy
131+
ifeval::["${puppet_lbs}" == "no"]
125132
# Destroy a second time to delete private networks
126133
terraform destroy
134+
endif::[]
127135
----
128136
+
129137
[source,bash]
@@ -138,6 +146,26 @@ popd
138146
TODO -- we don't have anything to identify server groups by cluster
139147
----
140148

149+
ifeval::["{puppet_lbs}" == "no"]
150+
. Delete the cloudscale subnet and private network
151+
+
152+
[source,bash]
153+
----
154+
SUBNET_UUID=$(yq '.parameters.openshift.cloudscale.subnet_uuid' \
155+
"inventory/classes/${TENANT_ID}/${CLUSTER_ID}.yml")
156+
NETWORK_UUID=$(curl -sH"Authorization: Bearer ${CLOUDSCALE_API_TOKEN}" \
157+
"https://api.cloudscale.ch/v1/subnets/${SUBNET_UUID}" |\
158+
jq -r ".network.uuid")
159+
160+
curl -H"Authorization: Bearer ${CLOUDSCALE_API_TOKEN}" \
161+
"https://api.cloudscale.ch/v1/subnets/${SUBNET_UUID}" \
162+
-XDELETE
163+
curl -H"Authorization: Bearer ${CLOUDSCALE_API_TOKEN}" \
164+
"https://api.cloudscale.ch/v1/networks/${NETWORK_UUID}" \
165+
-XDELETE
166+
----
167+
endif::[]
168+
141169
. After all resources are deleted we need to remove the buckets
142170
+
143171
[source,bash]

docs/modules/ROOT/partials/nav.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
*** xref:oc4:ROOT:how-tos/cloudscale/enable-loadbalancer-service.adoc[Enable LoadBalancer Services]
4545
*** xref:oc4:ROOT:how-tos/cloudscale/recover-etcd.adoc[Restore etcd]
4646
*** xref:oc4:ROOT:how-tos/cloudscale/decommission.adoc[Decommissioning]
47+
*** xref:oc4:ROOT:how-tos/cloudscale/decommission-no-puppet.adoc[Decommissioning (No Puppet LBs)]
4748
*** xref:oc4:ROOT:how-tos/cloudscale/rotate-api-tokens.adoc[Rotate API Tokens]
4849
4950
** Exoscale
@@ -253,6 +254,7 @@
253254

254255
* Decommissioning
255256
** xref:oc4:ROOT:how-tos/cloudscale/decommission.adoc[cloudscale.ch]
257+
*** xref:oc4:ROOT:how-tos/cloudscale/decommission-no-puppet.adoc[cloudscale.ch (No Puppet LBs)]
256258
** xref:oc4:ROOT:how-tos/exoscale/decommission.adoc[Exoscale]
257259
** xref:oc4:ROOT:how-tos/destroy/gcp.adoc[Google Compute Cloud]
258260

docs/modules/ROOT/partials/vshn-decommission.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
ifeval::["{puppet_lbs}" != "no"]
12
. Decommission Puppet-managed LBs
23
+
34
TIP: See the https://vshnwiki.atlassian.net/wiki/spaces/VT/pages/8290422/How+To+Decommission+a+VM[VSHN documentation] (Internal link) for the full instructions.
@@ -86,6 +87,7 @@ for lb in ${LB_FQDNS[*]}; do
8687
ssh "$backup_server" "rm -rfI ${backup}"
8788
done
8889
----
90+
endif::[]
8991

9092
. Remove cluster DNS records from VSHN DNS zonefiles
9193
+

0 commit comments

Comments
 (0)