Home > Mobile >  How to Resolve 403 error during API call through eks cluster by CURL
How to Resolve 403 error during API call through eks cluster by CURL

Time:10-28

I am trying to access my eks cluster through API . While calling by curl i am getting this error . { "kind": "Status", "apiVersion": "v1", "metadata": {

}, "status": "Failure", "message": "db1 is forbidden: User "system:anonymous" cannot list resource "db1" in API group "" in the namespace "default"", "reason": "Forbidden", "details": { "kind": "db1" }, "code": 403

Can anybody help me how to resolve this error message ?

CodePudding user response:

The forbidden response comes in case of access violation. The curl request you made is not having any authorization involved in it. Further AWS EKS has it's own User access list that can be found with

kubectl describe configmap -n kube-system aws-auth

You need to assume one of the role allowed in the above configmap then you can generate the access token needed with

aws sts get-session-token

Using this token you will be able to access your eks cluster over curl

  • Related