1 - AWS


To enable the AWS cloud provider, there are no configuration options. You only need to set the name as aws. In order to use the AWS cloud provider, all cluster nodes must have already been configured with an appropriate IAM role and your AWS resources must be tagged with a cluster ID.

  1. cloud_provider:
  2. name: aws

IAM Requirements

The nodes used in RKE that will be running the AWS cloud provider must have at least the following IAM policy.

  1. {
  2. "Effect": "Allow",
  3. "Action": "ec2:Describe*",
  4. "Resource": "*"
  5. }

In order to use Elastic Load Balancers (ELBs) and EBS with Kubernetes, the node(s) will need to have the an IAM role with appropriate access.

Example Policy for IAM Role:

  1. {
  2. "Version": "2012-10-17",
  3. "Statement": [
  4. {
  5. "Effect": "Allow",
  6. "Action": "ec2:Describe*",
  7. "Resource": "*"
  8. },
  9. {
  10. "Effect": "Allow",
  11. "Action": "ec2:AttachVolume",
  12. "Resource": "*"
  13. },
  14. {
  15. "Effect": "Allow",
  16. "Action": "ec2:DetachVolume",
  17. "Resource": "*"
  18. },
  19. {
  20. "Effect": "Allow",
  21. "Action": ["elasticloadbalancing:*"],
  22. "Resource": ["*"]
  23. }
  24. ]
  25. }

Tagging Amazon Resources

Any resources used in a Kubernetes cluster with the Amazon cloud provider must be tagged with a cluster ID.

Amazon Documentation: Tagging Your Amazon EC2 Resources

The following resources need to tagged with a ClusterID:

  • Nodes: All hosts added in Rancher.
  • Subnet: The subnet used for your cluster
  • Security Group: The security group used for your cluster.

Note: Do not tag multiple security groups. Tagging multiple groups generates an error when creating Elastic Load Balancer.

The tag that should be used is:

  1. Key=kubernetes.io/cluster/<CLUSTERID>, Value=owned

<CLUSTERID> can be any string you choose. However, the same string must be used on every resource you tag. Setting the tag value to owned informs the cluster that all resources tagged with the <CLUSTERID> are owned and managed by this cluster.

If you share resources between clusters, you can change the tag to:

  1. Key=kubernetes.io/cluster/CLUSTERID, Value=shared