cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Command to get Dynatrace operator version on kubernetes clusters

gurugogi
Helper

Hi All,

Please let me know whether there is any kubectl command to check Dynatrace operator version installed on 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 cmd line to automate operator upgrade process.

Please guide, thanks.
Guru Gogi

6 REPLIES 6

PacoPorro
Dynatrace Leader
Dynatrace Leader
kubectl exec deploy/dynatrace-operator -n dynatrace -- dynatrace-operator troubleshoot

The troubleshoot option reveals the version. There might be a simpler method to obtain it.

 

gurugogi
Helper

@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

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}'
Phani Devulapalli

gurugogi
Helper

@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%


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"}'

 

 

Phani Devulapalli

gurugogi
Helper

@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