When logged into an SSH session of VCF Automation 9.0, the "root" user is unable to run any kubectl commands, encounters a connection or command not found error when attempting to execute standard Kubernetes operations:
VCF Automation 9.X
The Kubernetes configuration is not automatically imported because the kubectl command environment variables are not initialized for the "root" user profile by default.
Follow these steps to initialize the environment and resolve the issue:
SSH into the VCF Automation 9.x appliance as the vmware-system-user.
Switch to the root user by running the following command:
sudo -su root
Export the Kubernetes configuration by running:
export KUBECONFIG=/etc/kubernetes/admin.conf
kubectl commands run successfully: