loader

Detaching Applications
Introduction

Detaching an application from its slice is an easy and straightforward process. This guide can be used when preparing to uninstall a slice, or simply to remove individual applications.

Note
If your application is installed on multiple clusters within a slice, you must complete these steps for each cluster.
Deleting the ServiceExport
Note
If a ServiceExport was created after onboarding the application, it must first be deleted. If there is no ServiceExport, continue to Deleting the Deployment below.
Note
Deleting the ServiceExport will automatically remove the corresponding ServiceImport.

Variables

Description

<cluster name>

The name of the cluster the application is deployed on.

<service export yaml>

The path to the ServiceExport .yaml file.

<namespace>

The namespace the application is deployed on.

First, switch contexts to the cluster you will be detaching the application from:

kubectx <cluster name>

Now that you are targeting the correct cluster kubeconfig, use the below command to delete the ServiceExport from the cluster:

kubectl delete -f <service export yaml> -n <namespace>
Deleting the Deployment

Variables

Description

<deployment yaml>

The path to the application deployment .yaml file.

<namespace>

The namespace the application is deployed on.

First, switch contexts to the cluster you will be detaching the application from:

kubectx <cluster name>

Now that you are targeting the correct cluster kubeconfig, use the below command to delete the application deployment from the cluster:

kubectl delete deploy -f <service export yaml> -n <namespace>
Note
You have successfully detached your application from the KubeSlice slice.
Optional - Redeploying without the Slice

Variables

Description

<deployment yaml>

The path to the application deployment .yaml file.

<namespace>

The namespace the application is deployed on.

First, switch contexts to the cluster you will be deploying the application to:

kubectx <cluster name>

If you would like to redeploy the application to the cluster without it being attached to the slice, you are able to edit the deployment .yaml file to remove the KubeSlice annotation. Specifically, remove the below portion:

metadata:
  annotations:
    avesha.io/slice: <slice name>

Once the above snippet is removed, you can redeploy the application using the below command:

kubectl apply -f <deployment yaml>
Next Steps

You have successfully removed the application from the slice! If you would like to continue removing your KubeSlice installation, remove the remaining applications and then continue to:

Uninstalling Slices


< PREVIOUS
Uninstalling KubeSlice There are three main steps to uninstalling KubeSlice: Detaching Applications, Uninstalling Slices, and Uninstalling the Slice Operator. Avesha has compiled the below guide to walk you through uninstalling a KubeSlice slice. Read More
NEXT >
Uninstalling Slices This will guide you through uninstalling slice(s) from your cluster, either to remove a slice or prepare to deregister a cluster. The order to these steps is very important to ensure proper resource cleanup. Please ensure the tasks in the prerequisites have been completed. Read More