Table of Contents
This chapter explains how to create a Kubernetes cluster using CloudFormation and Terraform.
AWS CloudFormation gives developers and systems administrators an easy way to create and manage a collection of related AWS resources, provisioning and updating them in an orderly and predictable fashion.
A CloudFormation template is available in the cloudformation directory.
In the example below, create a Kubernetes cluster with cloudformation using the aws cli. Note that a valid EC2 KeyName registered to your account must be supplied to execute successfully.
cd quickdeploy aws cloudformation create-stack \ --stack-name k8s \ --template-body file://cloudformation/k8s-create-no-alb.yaml \ --capabilities CAPABILITY_IAM \ --parameters \ ParameterKey=KeyName,ParameterValue=demo-key-2 \ ParameterKey=MasterInstanceType,ParameterValue=c4.xlarge \ ParameterKey=NetworkProvider,ParameterValue=calico \ ParameterKey=NodeInstanceType,ParameterValue=c4.large \ ParameterKey=Nodes,ParameterValue=3
The following is an explanation of the input parameters:
KeyName: This must be a valid EC2 KeyPair for ssh access. # Required MasterInstanceType: EC2 instance type of master. # Defaulted to c4.xlarge NetworkProvider: Container networking provider. # Defaulted to none NodeInstanceType: EC2 instance type of nodes. # Defaulted to c4.large Nodes: Number of k8s nodes. # Defaulted to 3
Note
|
kubeadm is used to create the cluster. Currently, it allows to create a single master, with a single etcd database running on it. This means your cluster is not highly available. |
The template and instructions need to be added: aws-samples#135
You are now ready to continue on with the workshop!