Deleting an Environment

Deleting (or maybe just disconnecting) your Altinity.Cloud Environment

If for whatever reason you don’t need an environment anymore, you can delete it. However…

Disconnecting your environment

It’s much easier to simply disconnect your ClickHouse clusters from Altinity.Cloud. (It’s also easy to reconnect it later.) If you use kubectl to scale the cloud-connect pods in the altinity-cloud-system namespace to zero, the ACM won’t be able to connect to your ClickHouse cluster. Your ClickHouse cluster and the applications that use it will be unaffected; they’ll simply be disconnected from Altinity.

To start, we’ll look at the ACM Environment view:

A connected environment

Figure 1 - A connected environment

Tthe indicator appears next to the environment name, letting us know our environment is connected to Altinity.Cloud. At the bottom of the display we can see the nodes in the environment, the types of those nodes, their zones, etc.

Now we’ll go to the command line and look at the deployments in the altinity-cloud-system namespace:

> kubectl get deployments -n altinity-cloud-system
NAME                 READY   UP-TO-DATE   AVAILABLE   AGE
cloud-connect        1/1     1            1           34m
crtd                 1/1     1            1           34m
edge-proxy           3/3     3            3           33m
grafana              1/1     1            1           34m
kube-state-metrics   1/1     1            1           34m
statuscheck          1/1     1            1           34m

And we’ll scale the cloud-connect pods to zero:

> kubectl scale deployment cloud-connect --replicas=0 -n altinity-cloud-system
deployment.apps/cloud-connect scaled

Looking at our deployments, cloud-connect has been scaled to zero, as we’d expect:

> kubectl get deployments -n altinity-cloud-system
NAME                 READY   UP-TO-DATE   AVAILABLE   AGE
cloud-connect        0/0     0            0           39m
crtd                 1/1     1            1           38m
edge-proxy           3/3     3            3           38m
grafana              1/1     1            1           38m
kube-state-metrics   1/1     1            1           38m
statuscheck          1/1     1            1           38m

Pretty soon we’ll get a notification that the environment has been disconnected:

A disconnected environment

Figure 2 - A disconnected environment

Three things have changed:

  • There’s a notification at the top of the panel that the environment has been disconnected
  • The button appears next to the environment name
  • The list of nodes at the bottom of the display is empty.

At this point, Altinity has no access to your environment or the ClickHouse clusters in it.

Reconnecting, of course, is simple:

> kubectl scale deployment cloud-connect --replicas=1 -n altinity-cloud-system
deployment.apps/cloud-connect scaled

Shortly after rescaling the deployment, you’ll get a notification that the environment has been reconnected:

Environment is reconnected

Figure 3 - Notification of a reconnected environment

This technique makes it easy to disconnect and reconnect your environment without disturbing your ClickHouse clusters and the applications that use them.

Deleting your environment

If you’re sure you’re ready to delete the Altinity.Cloud environment, go to the list of environments, click the vertical dots icon next to your environment name and select Delete from the menu:

The Delete Environment menu

Figure 4 - The Delete Environment menu

There are three choices in the dialog:

  • Do not de-provision Kubernetes resources - By default the Kubernetes resources created in a BYOK Altinity.Cloud environment will be deleted. Check this button if you plan to delete those resources some other way.
  • Do not de-provision cloud resources - By default cloud resources created in a BYOC Altinity.Cloud environment will be deleted. Check this button if you plan to delete those resources some other way.
  • Delete Clusters - By default the data for the ClickHouse clusters in the environment is not deleted. Check this button to delete everything associated with your ClickHouse clusters along with your environment. If you check this button, you’ll have to type the name of your environment before it can be deleted.

How and when to use each choice depends on the status of your Altinity.Cloud environment and its underlying infrastructure. There are three scenarios when deleting an Altinity.Cloud environment:

Deleting everything in your environment

That includes any Kubernetes or cloud resources Altinity.Cloud might have created. The simplest case is an environment that doesn’t have any ClickHouse clusters:

Deleting an Altinity.Cloud environment with no ClickHouse clusters

Figure 5 - Deleting an Altinity.Cloud environment with no ClickHouse clusters

Clicking OK deletes the Altinity.Cloud environment and its associated Kubernetes or cloud resources. (It’s somewhat confusing, but leaving the two sliders off tells Altinity.Cloud to go ahead and delete the resources in your environment. You’re basically saying, “No, don’t not deprovision my resources.”) If the environment does have ClickHouse clusters, though, things are slightly more complicated:

Deleting an Altinity.Cloud environment with ClickHouse clusters

Figure 6 - Deleting an Altinity.Cloud environment with ClickHouse clusters

You should delete your ClickHouse clusters by hand before deleting your Altinity.Cloud environment. However, you can click the Delete Clusters slider and have the ACM delete your ClickHouse clusters along with the resources that host them. If that’s your choice, you need to type the name of your environment before you click OK. The choices selected and not selected in Figure 6 delete everything.

Deleting your environment because Altinity.Cloud can’t connect to it anymore

Another scenario is when Altinity.Cloud can no longer connect to your environment. In this case, you need to tell the ACM that you’ll take the responsibility of deleting any Kubernetes or cloud resources that Altinity.Cloud created:

Deleting an Altinity.Cloud environment, deleting resources by hand

Figure 7 - Deleting an Altinity.Cloud environment, deleting resources by hand

The ACM deletes the Altinity.Cloud environment, but you’ll have to delete its resources by hand.

Delete the environment, but not the underlying resources

Finally, it’s possible that you’ve decided you want to delete the environment entirely, but keep your ClickHouse clusters running. You can permanently delete Altinity.Cloud’s access to your ClickHouse clusters without deleting your ClickHouse clusters and their data.

NOTE: Deleting your environment also deletes all the DNS records Altinity.Cloud created for your ClickHouse clusters. Your ClickHouse clusters will still be running, but you (and your applications) likely won’t have access to them anymore. Contact us if you want to access your clusters after deleting your environment; we’ll need to work with you on DNS records and other issues before you delete the Altinity.Cloud environment.

If this is how you want to delete your environment, tell the ACM not to delete the Kubernetes and cloud resources it created or your ClickHouse clusters:

Deleting an Altinity.Cloud environment, but nothing else

Figure 8 - Deleting the Altinity.Cloud environment, but nothing in your infrastructure

The first two choices feel like a double negative (“Yes, don’t delete my resources), but these three options (yes / yes / no) delete the Altinity.Cloud environment without disturbing your ClickHouse clusters, their data, and the infrastructure where they’re running.