Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
:puppet_lbs: no
:needs_hieradata_edit: no

= Uninstallation on cloudscale (no Puppet-managed LBs)

include::page$how-tos/cloudscale/decommission.adoc[]
32 changes: 30 additions & 2 deletions docs/modules/ROOT/pages/how-tos/cloudscale/decommission.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
ifeval::["{puppet_lbs}" != "no"]
= Uninstallation on cloudscale
endif::[]

:provider: cloudscale

Expand Down Expand Up @@ -105,26 +107,32 @@ kubectl get nodes

. Configure Terraform secrets
+
[source,bash]
[source,bash,attributes="subs+"]
----
cat <<EOF > ./terraform.env
CLOUDSCALE_API_TOKEN
ifeval::["{puppet_lbs}" != "no"]
HIERADATA_REPO_TOKEN
endif::[]
EOF
----

include::partial$setup_terraform.adoc[]

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

. Delete resources from cloudscale using Terraform
+
[source,bash]
[source,bash,attributes="subs+"]
----
# The first time it will fail
terraform destroy
ifeval::["${puppet_lbs}" == "no"]
# Destroy a second time to delete private networks
terraform destroy
endif::[]
----
+
[source,bash]
Expand All @@ -148,6 +156,26 @@ for server_group_uuid in $(curl -H"Authorization: Bearer ${CLOUDSCALE_API_TOKEN}
done
----

ifeval::["{puppet_lbs}" == "no"]
. Delete the cloudscale subnet and private network
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: add step to request nat gateway deletion from cloudscale

+
[source,bash]
----
SUBNET_UUID=$(yq '.parameters.openshift.cloudscale.subnet_uuid' \
"inventory/classes/${TENANT_ID}/${CLUSTER_ID}.yml")
NETWORK_UUID=$(curl -sH"Authorization: Bearer ${CLOUDSCALE_API_TOKEN}" \
"https://api.cloudscale.ch/v1/subnets/${SUBNET_UUID}" |\
jq -r ".network.uuid")

curl -H"Authorization: Bearer ${CLOUDSCALE_API_TOKEN}" \
"https://api.cloudscale.ch/v1/subnets/${SUBNET_UUID}" \
-XDELETE
curl -H"Authorization: Bearer ${CLOUDSCALE_API_TOKEN}" \
"https://api.cloudscale.ch/v1/networks/${NETWORK_UUID}" \
-XDELETE
----
endif::[]

. After all resources are deleted we need to remove the buckets
+
[source,bash]
Expand Down
2 changes: 2 additions & 0 deletions docs/modules/ROOT/partials/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
*** xref:oc4:ROOT:how-tos/cloudscale/enable-loadbalancer-service.adoc[Enable LoadBalancer Services]
*** xref:oc4:ROOT:how-tos/cloudscale/recover-etcd.adoc[Restore etcd]
*** xref:oc4:ROOT:how-tos/cloudscale/decommission.adoc[Decommissioning]
*** xref:oc4:ROOT:how-tos/cloudscale/decommission-no-puppet.adoc[Decommissioning (No Puppet LBs)]
*** xref:oc4:ROOT:how-tos/cloudscale/rotate-api-tokens.adoc[Rotate API Tokens]

** Exoscale
Expand Down Expand Up @@ -254,6 +255,7 @@

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

Expand Down
2 changes: 2 additions & 0 deletions docs/modules/ROOT/partials/vshn-decommission.adoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
ifeval::["{puppet_lbs}" != "no"]
. Decommission Puppet-managed LBs
+
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.
Expand Down Expand Up @@ -86,6 +87,7 @@ for lb in ${LB_FQDNS[*]}; do
ssh "$backup_server" "rm -rfI ${backup}"
done
----
endif::[]

. Remove cluster DNS records from VSHN DNS zonefiles
+
Expand Down