Deleting the Admin Console and Removing Applications
This topic describes how to remove installed applications and delete the Replicated Admin Console from a cluster.
Remove an Application
This section describes how to remove an application instance that was installed with KOTS in an existing cluster.
About Removing an Installed Application Instance
The Replicated KOTS CLI kots remove
command removes the reference to an installed application from the Admin Console. When you use kots remove
, the Admin Console no longer manages the application because the record of that application’s installation is removed. This means that you can no longer manage the application through the Admin Console or through the KOTS CLI.
By default, kots remove
does not delete any of the installed Kubernetes resources for the application from the cluster. To remove both the reference to an application from the Admin Console and remove any resources for the application from the cluster, you can run kots remove
with the --undeploy
flag.
It can be useful to remove only the reference to an application from the Admin Console if you want to reinstall the application, but you do not want to recreate the namespace or other Kubernetes resources. For example, if you installed an application using an incorrect license file and need to reinstall with the correct license.
Procedure
To remove an application:
-
Run the following command to list the installed applications for a namespace:
kubectl kots get apps -n NAMESPACE
Replace
NAMESPACE
with the name of the namespace where the Admin Console is installed.In the output of this command, note the slug for the application that you want to remove.
-
Run one of the following commands:
-
Remove only the reference to the application from the Admin Console:
kubectl kots remove APP_SLUG -n NAMESPACE
Replace:
APP_SLUG
with the slug for the application that you want to remove.NAMESPACE
with the name of the namespace where the Admin Console is installed.
-
Remove the reference to the application from the Admin Console and remove its resources from the cluster:
kubectl kots remove APP_SLUG -n NAMESPACE --undeploy
noteOptionally, use the
--force
flag to remove the application reference from the Admin Console when the application has already been deployed. The--force
flag is implied when--undeploy
is used. For more information, see remove in KOTS CLI. -
Delete the Admin Console
This section describes how to remove the KOTS Admin Console from an existing cluster.
About Deleting the Admin Console from an Existing Cluster
When you install an application, KOTS creates the Kubernetes resources for the Admin Console itself on the cluster. The Admin Console includes Deployments and Services, Secrets, and other resources such as StatefulSets and PersistentVolumeClaims.
By default, KOTS also creates Kubernetes ClusterRole and ClusterRoleBinding resources that grant permissions to the Admin Console on the cluster level. These kotsadm-role
and kotsadm-rolebinding
resources are managed outside of the namespace where the Admin Console is installed. Alternatively, when the Admin Console is installed with namespace-scoped access, KOTS creates Role and RoleBinding resources inside the namespace where the Admin Console is installed.
In existing cluster installations, if the Admin Console is not installed in the default
namespace, then you delete the Admin Console by deleting the namespace where it is installed.
If you installed the Admin Console with namespace-scoped access, then the Admin Console Role and RoleBinding RBAC resources are also deleted when you delete the namespace. Alternatively, if you installed with the default cluster-scoped access, then you manually delete the Admin Console ClusterRole and ClusterRoleBindings resources from the cluster. For more information, see supportMinimalRBACPrivileges and requireMinimalRBACPrivileges in Application.
For more information about installing with cluster- or namespace-scoped access, see RBAC Requirements in Installation Requirements.
Procedure
To completely delete the Admin Console from an existing cluster:
-
Run the following command to delete the namespace where the Admin Console is installed:
importantThis command deletes everything inside the specified namespace, including the Admin Console Role and RoleBinding resources if you installed with namespace-scoped access.
kubectl delete ns NAMESPACE
Replace
NAMESPACE
with the name of the namespace where the Admin Console is installed.noteYou cannot delete the
default
namespace. -
(Cluster-scoped Access Only) If you installed the Admin Console with the default cluster-scoped access, run the following commands to delete the Admin Console ClusterRole and ClusterRoleBinding from the cluster:
kubectl delete clusterrole kotsadm-role
kubectl delete clusterrolebinding kotsadm-rolebinding
-
(Optional) To uninstall the KOTS CLI, see Uninstall in Installing the KOTS CLI.