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 being included in new applications, redeploy all higher-order resources that were formerly modified by the AutoTrace webhook. The redeployment makes sure that all the AutoTrace configurations (init-containers and environment variables) are removed from the resource specifications and pod templates.
You can run the following commands to redeploy the higher-order resources:
-
Delete the existing deployment by running the following command:
kubectl delete deployment <deployment-name> -n <deployment-ns>
-
Deploy the resources by running the following command:
kubectl apply -f <initial-deployment-spec.yaml>
You can also redeploy the resources by using the operator, Helm chart, or other automation, depending on how you deployed your resources initially.
The kubectl rollout restart deployment
command does not work because the AutoTrace webhook also modifies higher-order resources, such as ReplicaSets, StatefulStes, Deployments, and DeploymentConfigs, in addition
to the pods.
If you cannot redeploy the application, you can remove the instrumentation by using the kubectl rollback
command to roll back to a revision that doesn't include the webhook fields.
To roll back to a previous revision, complete the following steps:
-
Check the history of the deployment by running the following command:
kubectl rollout history deployment <deployment-name> -n <deployment-ns>
-
Determine the revision to which the deployment must be rolled back by running the following command:
kubectl rollout history deployment <deployment-name> -n <deployment-ns> --revision=<n>
-
Roll back to the revision
n
that you require by running the following command:kubectl rollout undo deployment <deployment-name> -n <deployment-ns> --to-revision=<n>
-
Verify that the new pods are created, and the transformation fields are no longer present.