16 Sep 2024
07:59 AM
- last edited on
26 Jan 2026
11:05 AM
by
IzabelaRokita
Summary: This post provides the command used to check the Dynatrace Operator version deployed in Kubernetes. It explains where the version information resides and how to query it via kubectl.
Hi All,
Please let me know whether there is any kubectl command to check the Dynatrace operator version installed on the k8s cluster. I know we can check it from DT UI (from kubernetes UI or from Host->Properties UI), but I want it to fetch from the command line to automate the operator upgrade process.
Please guide, thanks.
Guru Gogi
Solved! Go to Solution.
16 Sep 2024 08:16 AM
kubectl exec deploy/dynatrace-operator -n dynatrace -- dynatrace-operator troubleshootThe troubleshoot option reveals the version. There might be a simpler method to obtain it.
16 Sep 2024 10:35 AM
@PacoPorro thanks for your reply. I know this command output has operator version, but I was checking whether we can modify this command so that it shows only operator version.
kubectl exec -n dynatrace deployment/dynatrace-operator -- dynatrace-operator support-archive --stdout > operator-support-archive.zip
[support-archive] dynatrace-operator {"version": "v0.11.0", "gitCommit": "...", "buildDate": "...", "goVersion": "...", "platform": "linux/amd64"}
[support-archive] Storing operator version into operator-version.txt
17 Sep 2024 07:00 AM
If you are after only the operator version you can try the below
kubectl get deployment dynatrace-operator -n dynatrace -o jsonpath='{.metadata.labels.app\.kubernetes\.io/version}'
17 Sep 2024 07:16 AM
@p_devulapalli thanks for reply, its working, its printing % also at the end, need to check how I can remove this % from output.
kubectl get deployment dynatrace-operator -n dynatrace -o jsonpath='{.metadata.labels.app\.kubernetes\.io/version}' 1.0.0%
17 Sep 2024 07:27 AM - edited 17 Sep 2024 07:52 AM
It should not be adding any % , may be a issue with prompt/formatting. Can you please try the below, it should output to next line clearly
kubectl get deployment dynatrace-operator -n dynatrace -o jsonpath='{.metadata.labels.app\.kubernetes\.io/version}{"\n"}'
17 Sep 2024 08:03 AM
@p_devulapalli this has eliminated %, thank you very much.
kubectl get deployment dynatrace-operator -n dynatrace -o jsonpath='{.metadata.labels.app\.kubernetes\.io/version}{"\n"}'
Featured Posts