Deploy a fully-functional Kubernetes cluster using AWS CloudFormation. Your cluster will be configured to use AWS features to enhance Kubernetes. For example, Kubernetes may automatically provision an Elastic Load Balancer for each Kubernetes Service. At CoreOS, we use the kube-aws CLI tool to automate cluster deployment to AWS.
After completing this guide, a deployer will be able to interact with the Kubernetes API from their workstation using the kubectl
CLI tool.
Each of the steps will cover:
- Step 1: Configure (this document)
- Download the kube-aws CloudFormation generator
- Define account and cluster settings
- Step 2: Render
- Compile a re-usable CloudFormation template for the cluster
- Optionally adjust template configuration
- Validate the rendered CloudFormation stack
- Step 3: Launch
- Create the CloudFormation stack and start our EC2 machines
- Set up CLI access to the new cluster
- Step 4: Update
- Update the CloudFormation stack
- Step 5: Add Node Pool
- Create the additional pool of worker nodes
- Adjust template configuration for each pool of worker nodes
- Required to support cluster-autoscaler
- Step 6: Configure add-ons
- Configure various Kubernetes add-ons
- Step 7: Destroy
- Destroy the cluster
Let's get started.
Older versions of kube-aws releases had been signed by the CoreOS key and were able to be verified with CoreOS Application Signing Public Key. However, the signing process is postponed since v0.9.3. Please read the issue #288 for more information.
Go to the releases and download the latest release tarball for your architecture.
Extract the binary:
tar zxvf kube-aws-${PLATFORM}.tar.gz
Add kube-aws to your path:
mv ${PLATFORM}/kube-aws /usr/local/bin
Configure your local workstation with AWS credentials using one of the following methods:
Provide the values of your AWS access and secret keys, and optionally default region and output format:
$ aws configure
AWS Access Key ID [None]: AKID1234567890
AWS Secret Access Key [None]: MY-SECRET-KEY
Default region name [None]: us-west-2
Default output format [None]: text
Write your credentials into the file ~/.aws/credentials
using the following template:
[default]
aws_access_key_id = AKID1234567890
aws_secret_access_key = MY-SECRET-KEY
Provide AWS credentials to kube-aws by exporting the following environment variables:
export AWS_ACCESS_KEY_ID=AKID1234567890
export AWS_SECRET_ACCESS_KEY=MY-SECRET-KEY
Test that your credentials work by describing any instances you may already have running on your account:
$ aws ec2 describe-instances
Did you download kube-aws?
Did your credentials work? We will use the AWS CLI in the next step.
Yes, ready to configure my cluster options No, I need more info on the AWS CLI