You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we run kube-aws with personal AWS credentials that we upload to the kube provisioner via kube-up.sh:
mkdir -p ~/.aws
...
mv credentials ~/.aws
However - AWS allows us to assign a "role" to an EC2 instance which exposes temporary credentials to applications via a metadata service that the AWS SDK's (and kube-aws I'm pretty sure) hook into if credentials are not otherwise provided:
First, I would like to extend terraform to assign a 'KubeProvider' role to the kube provider EC2 instance with admin permissions, and remove the code that installs the ~/.aws/credentials of whoever ran terraform, so that kube-aws and the aws-cli will run with the 'KubeProvider' role.
The text was updated successfully, but these errors were encountered:
and stop providing user aws keys as part of terraform config, and stop copying user aws keys to the k8s provider vm
From https://cdis.slack.com/files/U6R4GAN0H/F7Y018BQA/Setup_K8s_IAM_Roles_:
Currently we run kube-aws with personal AWS credentials that we upload to the kube provisioner via kube-up.sh:
mkdir -p ~/.aws
...
mv credentials ~/.aws
However - AWS allows us to assign a "role" to an EC2 instance which exposes temporary credentials to applications via a metadata service that the AWS SDK's (and kube-aws I'm pretty sure) hook into if credentials are not otherwise provided:
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html#instance-metadata-security-credentials
http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html
For example - kube-aws assigns a role the the k8 nodes, so we can fetch a temporary key for that role by querying a node's metadata service:
$ kubectl exec gdcapi-deployment-3057747319-qpt77 curl http://169.254.169.254/latest/meta-data/iam/security-credentials/planxplanetv1-Nodepool-4VY43DV1ISHF-IAMRoleWorker-158QBVD5WMYA7
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 894 100 894 0 0 1064k 0 --:--:-- --:--:-- --:--:-- 873k
{
"Code" : "Success",
"LastUpdated" : "2017-11-09T22:01:42Z",
"Type" : "AWS-HMAC",
"AccessKeyId" :
First, I would like to extend terraform to assign a 'KubeProvider' role to the kube provider EC2 instance with admin permissions, and remove the code that installs the ~/.aws/credentials of whoever ran terraform, so that kube-aws and the aws-cli will run with the 'KubeProvider' role.
The text was updated successfully, but these errors were encountered: