Uninstalling the Instana agent on Kubernetes

To uninstall the Instana agent from Kubernetes deployments, use the following methods:

Uninstalling agents installed by using the operator

To uninstall the Instana agent that is installed by using the operator, follow the steps:

  1. Uninstall the Instana agent by removing the custom resource YAML file:

    kubectl delete -f instana-agent.customresource.yaml
    
  2. Uninstall the operator by running the following command:

    kubectl delete -f https://github.com/instana/instana-agent-operator/releases/latest/download/instana-agent-operator.yaml
    

Uninstalling agents installed by using the Helm Chart

To uninstall the Instana agent that is installed by using the Helm Chart, run the following commands:

kubectl delete agents.instana.io instana-agent -n instana-agent --wait; helm uninstall instana-agent -n instana-agent; kubectl delete crd agents.instana.io; kubectl delete namespace instana-agent

Instana agent Helm chart installations before version 2.0.0 do not install agent custom resources and custom resource definitions. For these installations, you might get notifications about resources that could not be found. This behavior is expected.

All the resources that are related to the host agent are removed.

The Instana Helm chart version 2 or later installs the instana-operator in the background. During uninstallation, Helm does not remove the custom resource definitions or custom resources automatically. Therefore, running only the helm uninstall command is not sufficient.

Uninstalling agents installed by using a static YAML file

To uninstall the Instana agent that is installed by using a static YAML file, run the following command:

kubectl delete -f deployment.yaml