Kubernetes API 403 Forbidden error

Hi, I am new to Kubernetes and I am using Kubernetes PHP client for now. When I run the API to retrieve the services in a namespace with cURL, it works perfectly fine and I was able to get the result of a list of services. However, when I try to call the API using the PHP client, it show me the following error.


May I know what does the error mean? I have searched across the Internet but I couldn’t get an answer.

The most likely cause is you’re not passing the correct credentials through PHP.

I’m guessing the PHP script is running through a web server?
If so it may not have permissions to access the kubeconfig that you are using when you run curl on the CLI.

Kind regards,
Stephen