Skip to content

Instantly share code, notes, and snippets.

@wolfeidau
Last active February 12, 2019 14:32
Show Gist options
  • Save wolfeidau/f2d3259c7608a6b22d54 to your computer and use it in GitHub Desktop.
Save wolfeidau/f2d3259c7608a6b22d54 to your computer and use it in GitHub Desktop.
Kubernetes Setup Guide

This is a simple guide to getting up and running with kubernetes on AWS.

Install the aws CLI.

brew install awscli

Setup a profile in the aws CLI and enter some credentials, I create an IAM account in my AWS and give it admin, then generate some credentials.

aws configure --profile wolfeidau_dev

Download the latest kebernetes release.

wget https://github.com/kubernetes/kubernetes/releases/download/v1.0.6/kubernetes.tar.gz

Extract the archive.

tar xvzf kubernetes.tar.gz

Navigate into the directory.

cd kubernetes

Download the awssetup.sh script.

Modify the header of the awssetup.sh to reflect the settings you want, you will want to update AWS_DEFAULT_PROFILE and AWS_S3_BUCKET.

Lastly execute it.

./awssetup.sh start
#!/bin/bash
set -e
export KUBERNETES_PROVIDER=aws
# profile in your ~/.aws/config file.
# mine is wolfeidau_dev
export AWS_DEFAULT_PROFILE=org_name_env
export KUBE_AWS_ZONE=us-west-2a
export NUM_MINIONS=3
# configured small for master as it gets busy
export MASTER_SIZE=t2.small
export MINION_SIZE=t2.micro
# mine is wolfeidau_dev
export AWS_S3_BUCKET=org_name_env-kubernetes-artifacts
export INSTANCE_PREFIX=k8s
set +e
case "$1" in
start)
./cluster/kube-up.sh
echo
echo "kubernetes started"
echo
;;
stop)
./cluster/kube-down.sh
;;
status)
./cluster/kubectl.sh cluster-info
;;
*)
echo $"Usage: $0 {start|stop|status}"
exit 1
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment