Skip to content

eduardomsec/ansible-k8s

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

K8S

About Playbook

SO tested:

  • AlmaLinux
  • Centos

This playbook will install ContaineD with kubernates. The CNI Network is Calico and the network is 10.254.0.0/16. So, for change other network roles/create-cluster/files/calico.yaml and change it.

Create cluster

Run the playbook below to create the entire framework and installation of K8S

ansible-playbook -i hosts main.yml -k

OBS: Remember to feed the file hosts.

Documentation:

About CNI Calico

curl https://docs.projectcalico.org/manifests/calico-typha.yaml -o calico.yaml
# Altere o arquivo CALICO_IPV4POOL_CIDR e coloque o 10.0.0.0/16 
# Altere o calico-typha para o numero de replicas 3 (numero de masters)
kubectl apply -f calico.yaml

Documentation:

Create a new master

To add a new master node you will need to edit the file hosts, leaving the session k8s-master-shadow just with the IP/hostname you want to add. Now run de command:

ansible-playbook -i hosts -k new-master.yaml 

Create a new worker

To add a new master node you will need to edit the file hosts, leaving the session k8s-workers just with the IP/hostname you want to add. Now run de command:

ansible-playbook -i hosts -k new-worker.yaml