Skip to content

Latest commit

 

History

History
26 lines (19 loc) · 809 Bytes

File metadata and controls

26 lines (19 loc) · 809 Bytes

Kubespray - ANsible - Kubernetes

k8s

Subindo kubernetes utilizando o kubespray

  1. cd /kubespray
  2. sudo pip3 install -r requirements.txt
  3. cp -rfp inventory/sample inventory/mycluster
  4. declare -a IPS=(192.168.50.30 192.168.50.11 192.168.50.12 192.168.50.20 192.168.50.41)
  5. CONFIG_FILE=inventory/lab-k8s/hosts.yaml python3 contrib/inventory_builder/inventory.py ${IPS[@]}
  6. ansible-playbook -i inventory/lab-k8s/hosts.yaml --become -u vagrant --become-user=root cluster.yml

Kebespray Readme

Configurar KUBECTL

  • Acessar o master
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config