How to remove a controller

See also: Controller, Removing things reference

There are multiple ways to remove a controller. This document demonstrates each, in order of severity.


Unregister a controller

See also: juju unregister

A controller can be unregistered from a client with:

juju unregister <controller-name>

For example:

juju unregister aws-controller

This removes local connection information from the local client. This command does not affect the controller itself in any way.

Destroy a controller

See also: juju destroy-controller

A controllercan be destroyed with:

juju destroy-controller <controller-name>

You will always be prompted to confirm this action. Use the -y option to override this.

As a safety measure, if there are any models (besides the ‘controller’ model) associated with the controller you will need to pass the --destroy-all-models option.

Additionally, if there is persistent storage in any of the controller’s models you will be prompted to either destroy or release the storage, using the --destroy-storage or --release-storage options respectively.

For example:

juju destroy-controller -y --destroy-all-models --destroy-storage aws

Use the kill-controller command as a last resort if the controller is not accessible for some reason.

Kill a controller

See also: juju kill-controller

The kill-controller command deserves some attention as it is very destructive and also has exceptional behaviour modes. This command will first attempt to remove a controller and its models in an orderly fashion. That is, it will behave like destroy-controller. If this fails, usually due the controller itself being unreachable, then the controller machine and the workload machines will be destroyed by having the client contact the backing cloud’s API directly.