Setting up the Kubernetes AWS Cloud Provider
The AWS cloud provider for Kubernetes enables a couple of key integration points for Kubernetes running on AWS; namely, dynamic provisioning of Elastic Block Store (EBS) volumes and dynamic provisioning/configuration of Elastic Load Balancers (ELBs) for exposing Kubernetes Service objects. Unfortunately, the documentation surrounding how to set up the AWS cloud provider with Kubernetes is woefully inadequate. This article is an attempt to help address that shortcoming.
More details are provided below, but at a high-level here’s what you’ll need to make the AWS cloud provider in Kubernetes work:
- The hostname of each node must match EC2’s private DNS entry for that node
- An IAM role and policy that EC2 instances can assume as an instance profile
- Kubernetes-specific tags applied to the AWS resources used by the cluster
- Particular command-line flags added to the Kubernetes API server, Kubernetes controller manager, and the Kubelet
Let’s dig into these requirements in a bit more detail.
Node Hostname
It’s important that the name of the Node object in Kubernetes matches the private DNS entry for the instance in EC2. You can use hostnamectl
or a confiugration management tool (take your pick) to set the instance’s hostname to the FQDN that matches the EC2 Continue reading