Skip to content

Instantly share code, notes, and snippets.

@chrisedrego
Created December 28, 2022 07:25
Show Gist options
  • Save chrisedrego/db0b0dc5abead9eda1a649bb3a092ecb to your computer and use it in GitHub Desktop.
Save chrisedrego/db0b0dc5abead9eda1a649bb3a092ecb to your computer and use it in GitHub Desktop.
# IAM User is created
export AWS_ACCESS_KEY_ID=<ENTER_YOUR_AWS_ACCESS_KEY>
export AWS_SECRET_ACCESS_KEY=<ENTER_YOUR_AWS_SECRET_ACCESS_KEY>
export AWS_DEFAULT_REGION=<ENTER_YOUR_AWS_DEFAULT_REGION>
export KOPS_STATE_STORE=s3://<SPECIFY_S3_NAME>
export KOPS_CLUSTER_NAME=<CLUSTER_NAME>.k8s.local
aws s3api create-bucket --bucket $KOPS_STATE_STORE --create-bucket-configuration LocationConstraint=$AWS_DEFAULT_REGION --region $AWS_DEFAULT_REGION
aws s3api put-bucket-versioning --bucket $KOPS_STATE_STORE --region $AWS_DEFAULT_REGION --versioning-configuration Status=Enabled
kops create cluster \
--zones $KOPS_STATE_STORE \
--master-count 1 \
--master-size=t3.medium \
--node-count 1 \
--node-size=t2.micro \
--dry-run \
-oyaml > cluster.yaml
kops update cluster --name $KOPS_CLUSTER_NAME --yes --admin
* list clusters with: kops get cluster
* edit this cluster with: kops edit cluster $KOPS_CLUSTER_NAME
* edit your node instance group: kops edit ig --name=$KOPS_CLUSTER_NAME <NODE_NAME>
* edit your master instance group: kops edit ig --name=$KOPS_CLUSTER_NAME <MASTER_NAME>
mkdir -p ~/$KOPS_CLUSTER_NAME
touch ~/$KOPS_CLUSTER_NAME/config
export KUBECONFIG=~/$KOPS_CLUSTER_NAME/config
kops export kubecfg --name $KOPS_CLUSTER_NAME --admin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment