Uninstalling AutoTrace webhook

If you want to uninstall the AutoTrace webhook or remove the instrumentation, see the following sections:

To uninstall the Instana AutoTrace webhook, run the following command:

helm uninstall instana-autotrace-webhook \
    --namespace instana-autotrace-webhook \
    --no-hooks

After you run the helm uninstall command, the following output is displayed: release "instana-autotrace-webhook" uninstalled.

Verify that the Instana AutoTrace webhook was uninstalled correctly. You can verify by going to Kubernetes > Clusters in the Instana UI or by running the following command:

kubectl get pods --namespace instana-autotrace-webhook

If uninstallation is successful, the instana-autotrace-webhook pod does not appear in the namespace.

Removing the instrumentation

To remove the AutoTrace webhook from deployed applications and prevent it from affecting in new applications, restart all higher-level resources that the AutoTrace webhook previously modified. The restart makes sure that all the AutoTrace configurations (init containers and environment variables) are removed from the resource specifications and pod templates.

Restart the higher-level resources by running the following command:

kubectl rollout restart deployment <deployment-name> -n <deployment-ns>

Starting with webhook release 1.304.6, the removal process is simplified. The webhook now mutates pods directly instead of higher-level resources by default. You can restart deployments to remove instrumentation.

If you use a webhook version earlier than 1.304.6, or if you manually enable --set autotrace.enableHigherLevelResourceMutation=true, the webhook mutates resources at the deployment level. In this case, a simple deployment restart is not sufficient. Redeploy the higher-level resources to make sure that all AutoTrace configurations are removed.

Important: Upgrade to webhook release 1.304.6 or later to simplify your removal process and enable the restart-based approach.

Cleaning up unused secret

Until AutoTrace webhook 1.303.6, the secret instana-autotrace-webhook-certs got replaced with instana-autotrace-webhook-serving-tls and instana-autotrace-webhook-ca. Due to missing ownership labels, the old instana-autotrace-webhook-certs does not get removed with helm upgrade commands. Hence, you can safely delete it manually by running the following command:

kubectl delete secret instana-autotrace-webhook-certs -n instana-autotrace-webhook