Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# Generate AWS credentials through if you do NOT have them already
export AWS_ACCESS_KEY_ID=[...] # Replace [...] with the AWS Access Key ID
export AWS_SECRET_ACCESS_KEY=[...] # Replace [...] with the AWS Secret Access Key
export AWS_DEFAULT_REGION=us-east-2
# If Windows, use `tr '\r\n' ', '` instead of `tr '\n' ','`
export ZONES=$(aws ec2 describe-availability-zones \
--region $AWS_DEFAULT_REGION | jq -r \
'.AvailabilityZones[].ZoneName' | tr '\n' ',' | tr -d ' ')
echo $ZONES
mkdir -p cluster/keys
aws ec2 create-key-pair --key-name devops24 | jq -r '.KeyMaterial' >cluster/keys/devops24.pem
chmod 400 cluster/keys/devops24.pem
ssh-keygen -y -f cluster/keys/devops24.pem >cluster/keys/
export NAME=devops24.k8s.local
export BUCKET_NAME=devops24-$(date +%s)
aws s3api create-bucket --bucket $BUCKET_NAME \
--create-bucket-configuration \
kops create cluster --name $NAME --master-count 3 --node-count 3 \
--master-size t2.small --node-size t2.medium --zones $ZONES \
--master-zones $ZONES --ssh-public-key cluster/keys/ \
--networking kubenet --yes
kops validate cluster # Repeat until `Your cluster devops24.k8s.local is ready` is output
kubectl create -f \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.