-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
490bb9b
commit fd72dd8
Showing
4 changed files
with
86 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Variables | ||
# Image à utiliser | ||
IMAGE_NAME = "bento/ubuntu-20.04" | ||
# RAM | ||
MEM = 2048 | ||
# Nombre de CPU | ||
CPU = 2 | ||
# Nombre de noeuds | ||
WORKER_NB = 1 | ||
# Prefix pour la plage d'adresses IP à utiliser | ||
NODE_NETWORK_BASE = "10.0.0" | ||
# Master IP | ||
MASTER_IP = "#{NODE_NETWORK_BASE}.10" | ||
|
||
Vagrant.configure("2") do |config| | ||
config.ssh.insert_key = true | ||
|
||
# Configuration de la RAM et du CPU | ||
config.vm.provider "virtualbox" do |v| | ||
v.gui = false | ||
v.memory = MEM | ||
v.cpus = CPU | ||
end | ||
|
||
# Configuration du Master | ||
config.vm.define "k8s-master" do |master| | ||
master.vm.box = IMAGE_NAME | ||
master.vm.network "private_network", ip: MASTER_IP | ||
master.vm.hostname = "k8s-master" | ||
end | ||
|
||
# Configuration du/des Worker(s) | ||
(1..WORKER_NB).each do |i| | ||
config.vm.define "k8s-worker#{i}" do |worker| | ||
worker.vm.box = IMAGE_NAME | ||
worker.vm.network "private_network", ip: "#{NODE_NETWORK_BASE}.#{i + 10}" | ||
worker.vm.hostname = "k8s-worker#{i}" | ||
end | ||
end | ||
|
||
config.vm.provision "ansible" do |ansible| | ||
ansible.playbook = "site.yml" | ||
ansible.groups = { | ||
"master" => ["k8s-master"], | ||
"worker" => ["k8s-worker[1:#{WORKER_NB}]"], | ||
"kube_cluster:children" => ["master", "worker"], | ||
"kube_cluster:vars" => { "master_ip" => MASTER_IP } | ||
} | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[defaults] | ||
roles_path = ./roles | ||
inventory = ./hosts.ini | ||
|
||
remote_tmp = $HOME/.ansible/tmp | ||
local_tmp = $HOME/.ansible/tmp | ||
pipelining = True | ||
become = True | ||
host_key_checking = False | ||
deprecation_warnings = False | ||
callback_whitelist = profile_tasks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
- hosts: kube_cluster | ||
gather_facts: yes | ||
become: yes | ||
roles: | ||
- { role: commons/os-checker, tags: commons } | ||
- { role: commons/package-update, tags: commons } | ||
- { role: ntp, tags: ntp } | ||
- { role: locale, tags: locale } | ||
- { role: containerd, tags: containerd } | ||
- { role: commons/pre-install, tags: commons } | ||
|
||
- hosts: master | ||
gather_facts: yes | ||
become: yes | ||
roles: | ||
- { role: kubernetes/master, tags: master } | ||
- { role: cni, tags: cni } | ||
|
||
- hosts: worker | ||
gather_facts: yes | ||
become: yes | ||
roles: | ||
- { role: kubernetes/node, tags: node } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/bash | ||
printf "Installing jenkins" | ||
helm install whanos /whanos/kube/helm/whanos --create-namespace --namespace whanos | ||
helm install whanos kube/helm/whanos --create-namespace --namespace whanos | ||
printf "Installed jenkins ✅" |