Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I provide AWS credentials to Kubernetes?

I'm setting up a Kubernetes cluster on AWS and as part of the configuration for say the API Server, I provide the --cloud-provider=aws setting.

Once it starts up, however, I see in the logs that it complains about not having AWS credentials: NoCredentialProviders: no valid providers in chain

After some searching, it seems that this issue was resolved for most people by using the "kube-up" script. However, for those who are not using the script to set up their cluster, how do we provide Kubernetes with AWS credentials?

like image 333
Luis Medina Avatar asked Sep 27 '22 12:09

Luis Medina


1 Answers

It sounds like you don't have the appropriate IAM instance profile set on your master VM. The kube-up script for AWS creates a role and associated policy that is attached to the master VM when it is created. Having the IAM policy attached should give you the credentials necessary to make API calls into AWS.

like image 66
Robert Bailey Avatar answered Sep 29 '22 06:09

Robert Bailey