AKSarav/KubeNodeUsage

Failed to execute the Kubectl get nodes command

Closed this issue · 1 comments

As the title says, when I run any command it says
"Failed to execute the Kubectl get nodes command"

This is a kubernetes running on oracle cloud, with 3 nodes.
If I run kubectl get nodes I get the correct info, but running the python script I get the error.

After some investigation, found that python3? doesn't have capture_output option for subprocess.run().
Replace "capture_output=True" with "stdout=PIPE, stderr=PIPE" and add "from subprocess import PIPE" to kube-node-usage.py

Its working.