Specify role that kube2iam will assume.
- Create a role
arn:aws:iam::xxx:role/k8s-alb-controller
with this iam policy - Edit trust relationship with role attached to k8s worker nodes, i.e.
arn:aws:iam::xxx:role/xxx-cluster.kubernetes_worker
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Principal": {
"Service": "ec2.amazonaws.com"
},
"Action": "sts:AssumeRole"
},
{
"Sid": "",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::xxx:role/xxx-cluster.kubernetes_worker"
},
"Action": "sts:AssumeRole"
}
]
}