Skip to content

Commit

Permalink
change!: using kubespray to configure cluster
Browse files Browse the repository at this point in the history
Signed-off-by: Jonatas Ferreira <[email protected]>
  • Loading branch information
jonatas-lima committed Nov 6, 2023
1 parent ba28d4b commit e5beb0d
Show file tree
Hide file tree
Showing 17 changed files with 47 additions and 435 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "kubespray"]
path = kubespray
url = [email protected]:kubernetes-sigs/kubespray.git
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
SHELL := /bin/bash

cluster:
vagrant up && bash create_hosts.sh && ansible-playbook -i ansible/hosts.ini ansible/cluster.yml
vagrant up && bash create_hosts.sh && cd kubespray && ansible-playbook -b -v -i inventory/vagrant/inventory.ini cluster.yml

reset:
ansible-playbook -i ansible/hosts.ini ansible/reset.yml
cd kubespray && ansible-playbook -i inventory/vagrant/inventory.ini -b -v reset.yml

destroy:
vagrant destroy -f
vagrant destroy -f && rm -rf kubespray/inventory/vagrant
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Why? **Doing this way is more fun and more similar to how it is done in on-premi

Of course this way it's more complicated, but it will be worth it.

Also, it is used [Kubespray](https://github.com/kubernetes-sigs/kubespray) to configure the production-ready K8S cluster.

## Before we start

### Pre requisites
Expand Down Expand Up @@ -54,7 +56,13 @@ sudo yum -y install vagrant

## Managing your cluster

The created cluster will use 6GB of RAM, so it's very likely that your machine will slow down a little.
First of all, clone this repository:

```sh
git clone --recurse-submodules
```

The created cluster will use *GB of RAM, so it's very likely that your machine will slow down a little.

### Creating

Expand Down
2 changes: 1 addition & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Vagrant.configure("2") do |config|
k8s.vm.provider "virtualbox" do |vb|
vb.gui = false
vb.cpus = 2
vb.memory = "2048"
vb.memory = "4096"
end
end
end
Expand Down
20 changes: 0 additions & 20 deletions ansible/cluster.yml

This file was deleted.

9 changes: 0 additions & 9 deletions ansible/hosts.ini

This file was deleted.

7 changes: 0 additions & 7 deletions ansible/reset.yml

This file was deleted.

18 changes: 0 additions & 18 deletions ansible/roles/common/handlers/main.yml

This file was deleted.

52 changes: 0 additions & 52 deletions ansible/roles/common/tasks/main.yml

This file was deleted.

Loading

0 comments on commit e5beb0d

Please sign in to comment.