Updating AutoTrace webhook
Instana AutoTrace webhook cannot automatically update the instrumentation. Therefore, you must manually update it by uninstalling previous instrumentation and then reinstalling the webhook by using Helm deployment.
The instrumentation is delivered over the icr.io/instana/instrumentation
image. Instana specifies a version tag in the values.yaml
file to make sure that the instana-autotrace-webhook
Helm chart is regularly
updated to use the latest icr.io/instana/instrumentation
image.
To update Instana AutoTrace webhook and instrumentation, complete the following steps:
-
Remove the current webhook installation by running the following command:
helm uninstall --namespace instana-autotrace-webhook instana-autotrace-webhook
-
Update the Helm chart repository on your local Helm installation by running the following command:
helm repo update
-
Install the
instana-autotrace-webhook
Helm chart deployment again by running the following command:helm install --create-namespace --namespace instana-autotrace-webhook instana-autotrace-webhook \ --repo https://agents.instana.io/helm instana-autotrace-webhook \ --set webhook.imagePullCredentials.password=<download_key> --set <initial-custom-flags>
-
Re-create the deployment to remove the AutoTrace webhook from deployed applications and to apply the new transformation and instrumentation. Redeploy all higher-order resources (such as ReplicaSets, StatefulStes, Deployments, and DeploymentConfigs) that were formerly mutated by the AutoTrace webhook. This redeployment makes sure that all old AutoTrace configurations (init-containers and environmental variables) are removed from the resource specifications and pod templates, and that the new AutoTrace configuration can be applied.
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.
You cannot use the kubectl rollout restart deployment
command to redeploy because the AutoTrace webhook also modifies higher-order resources, such as ReplicaSets, StatefulStes, Deployments, and DeploymentConfigs,
in addition to the pods. Hence, the kubectl rollout restart deployment
only restarts the pods with the existing configuration.
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>
After the new higher-order resources are created, verify that the new transformation of the resource specification is applied.