Kubernetes CKA sample exam question 2 with answer

Question
A kubeconfig file called test.kubeconfig has been created in /root/TEST.
There is something wrong with the configuration.
Troubleshoot and fix it.

Answer
Open the file and inspect it:

cat /root/TEST/test.kubeconfig
Compare the output with the current config:
kubectl config view
Check for correctivity sections: clusters, context, users.

In this case everything seems correct, except the port for the controlplane server in which was 4380.
Usually the port is 6443
Modify the file with right values and test it using kubectl:
kubectl config --kubeconfig=/root/TEST/test.kubeconfig get nodes