Skip to content

Commit 4895786

Browse files
authored
Merge pull request #438 from appuio/fix/cloudscale-decommission
Update cloudscale decommissioning
2 parents 8621ac4 + ae8d80e commit 4895786

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

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

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Steps to remove an OpenShift 4 cluster from https://cloudscale[cloudscale.ch].
1717

1818
include::partial$cloudscale/prerequisites.adoc[]
1919
* `emergency-credentials-receive` https://github.com/vshn/emergency-credentials-receive?tab=readme-ov-file#install-from-binary[Install instructions]
20+
* `mc` >= `RELEASE.2024-01-18T07-03-39Z` https://docs.min.io/docs/minio-client-quickstart-guide.html[Minio client] (aliased to `mc` if necessary)
2021

2122
== Cluster Decommission
2223

@@ -59,6 +60,13 @@ kubectl delete svc --field-selector spec.type=LoadBalancer -A
5960
kubectl delete loadbalancers -A --all
6061
----
6162

63+
. Disable autoscaling
64+
+
65+
[source,bash]
66+
----
67+
kubectl delete machineautoscaler -A --all
68+
----
69+
6270
. Delete all PVs
6371
+
6472
[source,bash]
@@ -124,6 +132,22 @@ terraform destroy
124132
popd
125133
----
126134

135+
. Delete cloudscale server groups
136+
+
137+
TIP: This may not fully clean up server groups for cloudscale clusters which were created earlier than 2025-10-21.
138+
+
139+
[source,bash]
140+
----
141+
for server_group_uuid in $(curl -H"Authorization: Bearer ${CLOUDSCALE_API_TOKEN}" \
142+
https://api.cloudscale.ch/v1/server-groups | \
143+
jq --arg cluster_id "${CLUSTER_ID}" \
144+
'.[]|select(.name|startswith($cluster_id))|.uuid'); do
145+
curl -H"Authorization: Bearer ${CLOUDSCALE_API_TOKEN}" \
146+
"https://api.cloudscale.ch/v1/server-groups/${server_group_uuid}" \
147+
-XDELETE
148+
done
149+
----
150+
127151
. After all resources are deleted we need to remove the buckets
128152
+
129153
[source,bash]
@@ -134,7 +158,7 @@ response=$(curl -sH "Authorization: Bearer ${CLOUDSCALE_API_TOKEN}" \
134158
jq -e ".[] | select(.display_name == \"${CLUSTER_ID}\")")
135159
136160
# configure minio client to use the bucket
137-
mc config host add \
161+
mc alias set \
138162
"${CLUSTER_ID}" "https://objects.${REGION}.cloudscale.ch" \
139163
$(echo $response | jq -r '.keys[0].access_key') \
140164
$(echo $response | jq -r '.keys[0].secret_key')
@@ -162,7 +186,7 @@ At this point in the decommissioning process, you'll have to extract the Restic
162186
[source,bash]
163187
----
164188
# configure minio client to use the bucket
165-
mc config host add \
189+
mc alias set \
166190
"${CLUSTER_ID}_backup" "https://objects.${BACKUP_REGION}.cloudscale.ch" \
167191
$(echo $response | jq -r '.keys[0].access_key') \
168192
$(echo $response | jq -r '.keys[0].secret_key')

0 commit comments

Comments
 (0)