AWS Naming Cluster
Name Your Cluster
In AWS it is critical that the name is unique, as no two clusters in the same AWS account can have the same name.
The cluster name may only contain the following characters: a-z
, 0-9
, .
, and -
. Cluster creation will fail if the name has capital letters. See Kubernetes for more naming information.
Follow these steps:
Give your cluster a unique name suitable for your environment.
Set the environment variable:
export CLUSTER_NAME=<aws-example>
Cluster Name List in AWS
To get a list of names used in your AWS account, use the aws
CLI. After downloading, use the following command:
aws ec2 describe-vpcs --filter "Name=tag-key,Values=kubernetes.io/cluster" --query "Vpcs[*].Tags[?Key=='kubernetes.io/cluster'].Value | sort(@[*][0])"
"alex-aws-cluster-afe98",
"sam-aws-cluster-8if9q"
(Optional) To create a cluster name that is unique, use the following command:
CODEexport CLUSTER_NAME=aws-example-$(LC_CTYPE=C tr -dc 'a-z0-9' </dev/urandom | fold -w 5 | head -n1) echo $CLUSTER_NAME
CODEaws-example-pf4a3
This will create a unique name every time you run it, so use it with forethought.