Why I'm not able to get cluster infor through APIs ?!

Nurhun:
Why I’m not able to get cluster infor through APIs ?!

Nurhun:
Solved by capururing certs from the .kube/config file

client-key-data:
echo -n “LS0…Cg==” | base64 -d > admin.key

client-certificate-data:
echo -n “LS0…Cg==” | base64 -d > admin.crt

certificate-authority-data:
echo -n “LS0…Cg==” | base64 -d > ca.crt

Then, use
curl https://172.26.2.101:6443 --key admin.key --cert admin.crt --cacert ca.crt

Mohamed Ayman:
Yes, you need to add the certs in the command.

I am executing the commands from the master node and I am using cacert from the location /etc/kubernetes/pki/ca.crt. I am using the below command

curl -k https://10.66.40.126:6443 --cert admin.crt --key admin.key --cacert /etc/kubernetes/pki/ca.crt

I am still getting the forbidden error. as below

{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {},
  "status": "Failure",
  "message": "forbidden: User \"system:anonymous\" cannot get path \"/\"",
  "reason": "Forbidden",
  "details": {},
  "code": 403
}

Please can you suggest what needs to be done now?