One Stop solution for installing Kubernetes with Kops on AWS!

Updated 15th april 2019 ! (with correct Dashboard link to install)

Hello Tech MaNiAcs !

Welcome to this blog , I hope and thinks that since you have stopped by this blog it means that you must be a Kubernetes beginner and trying your hands on to install Kubernetes on AWS with an awesome dashboard to work . If yes , then dont worry I will be helping you out to do so .

There are no of blogs published outside which will provide you the solutions but ends up in installing the CLI well but no correct links for dashboard ! I have updated my blog with the correct links to help you install the CLI as well as UI , so lets follow me up on this journey to install K8s.

  1. Launch an Ubuntu(16.04/18/04 or any version)instance(t2.micro or anything) on your AWS platform. SSH into the server and perform a “apt-get update -y”.FYI: I have used 18.04.
  2. Kops Installation:
kops installation

3. AWS cli setup to make our server intertact with AWS services:

  • Create an IAM user and provide necessary permissions( I am providing administrator access for testing purpose) . Make a note of access key and secret access key .
aws cli installation
aws configure

4. Create a S3 bucket and enable versioning:

s3 bucket created by the name kops-msmaniac-bucket

5. Kubectl Installation:

kubectl installation

you can see that , after installing kubectl using snap , if you want to look for kubectl version , you will get some errors. Its because by default /snap/bin is not located in Path env variable, hence we need to export the variable dynamically to make it work. After exporting the PATH variable, it worked absolutely fine.

6. SSH-key generation:

These keys will be used by cluster to login and for generating the passwords

ssh-keys generation

7. Environment variables setup:

Remember cluster name should ends with k8s.local

Imp. Note: If you using export to declare any variable , then it will be saved only for that particular session only. Next time when you will login again, you need to provide all these details again and again on every new session.

So, In order to overcome this problem, you need to update these variables inside .bashrc & .profile in ~ dir.

So we should update all the 3 environment variables till here in .bashrc and in .profile file

updated in ~/.bashrc
updated in ~/.profile

8. Time to Create Cluster:

This will actually prepare the configuration files.

This will create a 3 node cluster : 1 master and 2 worker nodes ! I am using US-EAST-2A zone to create my cluster you can choose whatever you want.

Note: This command will create a 2 node cluster with 1 master, you should min. Choose a t2.medium for master-node for bare minimum performance and t2.micro for worker nodes

9. Create the cluster actually:

RUN if you’re okay withe the configuration run the command with — yes as like below:

creation of our cluster

you can validate the cluster by typing the below command:

It will take some time to create, may be 5 or more minutes to validate everything, keep patience.

your cluster is ready !

10. Deploying Dashboard:

  • Edit master’s security group: Make sure 443 port is allowed from ANYWHERE in aws security group.
  • Now hit the url in the following format:

FYI: At first ,the page shows some errors. Use the advanced option to proceed

Kubernetes Dashboard login screen
  • Now type in the user and password , the user is “admin” and the password you can find by hitting the below command:
password to login

After providing username and password you will get the below window :

Use the “Token” option , now in CLI type the below command to find your token:

Token for admin

11. After providing the token , you will finally get the Kubernetes Dashboard like this :

Kubernetes Dashboard

KABOOM !!!!!

We have successfully installed k8s CLI and UI. Now you can deploy your containers on different pods and orchestrate everything in a cluster using Kubernetes.

I hope this blog helped you! Stay tuned for more awesome blogs, Cheers !

Senior DevOps Engineer