Skip to content
Switch branches/tags
Go to file
Cannot retrieve contributors at this time
161 lines (109 sloc) 6.16 KB

Preparing Your Local Host Environment

This guide will walk you through the preparation of your local environment if you chose to conduct the labs from your local host. As an alternative, you can go to the Using Vagrant guide for the steps to create a Vagrant box with everything you need already installed.


Below are the tools you need to install on your local host. The commands below are for Linux and you can visit the links for instructions for other platforms. If you are using Windows 10, installing Bash for Windows and then running the commands below is recommended:

# apt-get
sudo apt-get install git jq unzip wget python -y

# yum
sudo yum install epel-release -y
sudo yum install git jq unzip wget python -y
curl -o
sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
rm -rf awscli-bundle/
sudo curl -sSL | sh
sudo usermod -aG docker ${USER}
export HUGO_VERSION="0.27.1"
tar -xf hugo_${HUGO_VERSION}_Linux-64bit.tar.gz
sudo chmod +x hugo
sudo mv hugo /usr/local/bin/hugo
rm -rf hugo_${HUGO_VERSION}_Linux-64bit.tar.gz
export TERRAFORM_VERSION="0.10.6"
unzip terraform_${TERRAFORM_VERSION}
sudo chmod +x terraform
sudo mv terraform /usr/local/bin/terraform
rm -rf terraform_${TERRAFORM_VERSION}
export KUBECTL_VERSION="1.7.6"
sudo chmod +x kubectl
sudo mv kubectl /usr/local/bin/kubectl
export KUBEFED_VERSION="1.7.6"
sudo chmod +x kubefed
sudo mv kubefed /usr/local/bin/kubefed
export KOPS_VERSION="1.7.0"
sudo chmod +x kops-linux-amd64
sudo mv kops-linux-amd64 /usr/local/bin/kops

Clone the Repository

git clone
cd getting-to-know-k8s

AWS API Credentials

Kops, which we will be using to create Kubernetes clusters, requires you to have AWS API credentials configured.

You can use your existing AWS user account or you can choose to create a dedicated user account for Kops.

Use an existing AWS user account

If you are using your existing AWS user account, you must have at a minimum the following IAM policies attached to it (or you can use the AdministratorAccess policy which includes all of these permissions):


Create a dedicated user account for Kops

To create a dedicated user account for Kops, you can either use the management console or the AWS CLI:

aws iam create-group --group-name kops

export arns="

for arn in $arns; do aws iam attach-group-policy --policy-arn "$arn" --group-name kops; done

aws iam create-user --user-name kops

aws iam add-user-to-group --user-name kops --group-name kops

aws iam create-access-key --user-name kops

You should record the values for SecretAccessKey and AccessKeyID in the returned JSON output, which are the AWS API credentials.

Set the Required Environment Variables

Before staring any of the labs, you need to set the environment variables below with the AWS API credentials of the AWS user account you will be using:

export AWS_ACCESS_KEY_ID="AWS Access Key ID"
export AWS_SECRET_ACCESS_KEY="AWS Secret Access Key"

If you are not familiar with how to retrieve these values for your existing AWS user account, refer to the AWS documentation.

SSH Public Key Path

Kops also requires a SSH public key file, which is used to create an AWS EC2 key pair for AWS instances that are created when creating a cluster.

If you don't have a SSH key available, refer to this tutorial from GitHub on how to create one.

If your existing SSH public key file is not located in the default location (~/.ssh/, you will need to modify the --ssh-public-key="~/.ssh/" configuration option whenever creating clusters with Kops.

Enjoy the Labs

You are ready to proceed with the labs.