Skip to content

Instantly share code, notes, and snippets.

@jruels
Created March 13, 2019 03:45
Show Gist options
  • Save jruels/1788ef75999f4777f307dd2aaf2104aa to your computer and use it in GitHub Desktop.
Save jruels/1788ef75999f4777f307dd2aaf2104aa to your computer and use it in GitHub Desktop.

To create a Kops cluster

Install AWSCLI

pip install awscli

Add to path

export PATH=~/.local/bin:$PATH

Create unique bucket for state

aws s3api create-bucket --bucket my-unique-bucket-name --region us-west-1 --create-bucket-configuration LocationConstraint=us-west-1

Enable versioning

aws s3api put-bucket-versioning --bucket bucket-name-from-above --region us-west-1 --versioning-configuration Status=Enabled

Enable encryption

aws s3api put-bucket-encryption --bucket bucket-name-from-above --region us-west-1 --server-side-encryption-configuration '{"Rules":[{"ApplyServerSideEncryptionByDefault":{"SSEAlgorithm":"AES256"}}]}'

Variable for state

export KOPS_STATE_STORE=s3://bucket-name-from-above

Variable for cluster name

export NAME=yourcluster.k8s.local 

Create cluster config

kops create cluster --zones us-west-1a --master-size t3.small --node-size t2.medium --node-count 3 ${NAME}

SSH access

kops create secret --name ${NAME} sshpublickey admin -i /path/to/ssh.pub

Deploy cluster

kops update cluster --yes 

After the cluster is built you will see instructions for managing and accessing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment