Skip to content

beacloudgenius/ansible-kubernetes

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ansible playbook to install a development Kubernetes (k8s) cluster on ec2

Basic recipes using the ansible cloudstack module to create ssh keys, sec group etc and deploy Kubernetes on CoreOS. This setup is to be used for development purposes only, as there are no HA features in place.

Prerequisites

You will need Ansible >= 2.0, sshpubkeys and boto

$ sudo apt-get install -y python-pip
$ pip install ansible sshpubkeys boto

Setup ec2

Specify your ec2 credentials with:

$ export AWS_ACCESS_KEY_ID='AK123'
$ export AWS_SECRET_ACCESS_KEY='abc123'

We need to use the http POST method to pass the userdata to the coreOS instances.

Create a Kubernetes cluster

$ ansible-playbook k8s-ec2.yml

Some variables can be edited in the k8s-ec2.yml file. This will start a Kubernetes master node and a number of compute nodes.

Test your cluster

First spawn a tunnel to your master node with:

$ ssh -nNT -L 8080:127.0.0.1:8080 -i ~/.ssh/id_rsa_k8s core@<master-node-ip>

Then run

$ kubectl get nodes

About

Ansible recipes to start Kubernetes on AWS EC2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.9%
  • Shell 0.1%