Skip to content

Commit 2a0bed5

Browse files
committed
Add draft decommissioning instructions for cloudscale without Puppet LBs
1 parent b4e5a50 commit 2a0bed5

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

@@ -105,26 +107,32 @@ kubectl get nodes
105107

106108
. Configure Terraform secrets
107109
+
108-
[source,bash]
110+
[source,bash,attributes="subs+"]
109111
----
110112
cat <<EOF > ./terraform.env
111113
CLOUDSCALE_API_TOKEN
114+
ifeval::["{puppet_lbs}" != "no"]
112115
HIERADATA_REPO_TOKEN
116+
endif::[]
113117
EOF
114118
----
115119

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

122+
ifeval::["{puppet_lbs}" != "no"]
118123
include::partial$prepare-for-lb-decommission.adoc[]
124+
endif::[]
119125

120126
. Delete resources from cloudscale using Terraform
121127
+
122-
[source,bash]
128+
[source,bash,attributes="subs+"]
123129
----
124130
# The first time it will fail
125131
terraform destroy
132+
ifeval::["${puppet_lbs}" == "no"]
126133
# Destroy a second time to delete private networks
127134
terraform destroy
135+
endif::[]
128136
----
129137
+
130138
[source,bash]
@@ -148,6 +156,26 @@ for server_group_uuid in $(curl -H"Authorization: Bearer ${CLOUDSCALE_API_TOKEN}
148156
done
149157
----
150158

159+
ifeval::["{puppet_lbs}" == "no"]
160+
. Delete the cloudscale subnet and private network
161+
+
162+
[source,bash]
163+
----
164+
SUBNET_UUID=$(yq '.parameters.openshift.cloudscale.subnet_uuid' \
165+
"inventory/classes/${TENANT_ID}/${CLUSTER_ID}.yml")
166+
NETWORK_UUID=$(curl -sH"Authorization: Bearer ${CLOUDSCALE_API_TOKEN}" \
167+
"https://api.cloudscale.ch/v1/subnets/${SUBNET_UUID}" |\
168+
jq -r ".network.uuid")
169+
170+
curl -H"Authorization: Bearer ${CLOUDSCALE_API_TOKEN}" \
171+
"https://api.cloudscale.ch/v1/subnets/${SUBNET_UUID}" \
172+
-XDELETE
173+
curl -H"Authorization: Bearer ${CLOUDSCALE_API_TOKEN}" \
174+
"https://api.cloudscale.ch/v1/networks/${NETWORK_UUID}" \
175+
-XDELETE
176+
----
177+
endif::[]
178+
151179
. After all resources are deleted we need to remove the buckets
152180
+
153181
[source,bash]

docs/modules/ROOT/partials/nav.adoc

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

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

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)