kubespray / kubespray-cli

Easy to use command line tool for kubernetes deployment with kubespray
GNU General Public License v3.0
252 stars 62 forks source link

CoreOS fails without manual bootstraping #120

Closed nazarewk closed 2 years ago

nazarewk commented 6 years ago

As in the title, when trying to deploy with kubespray-cli i have to manually run bootstrapping as in the script below. If i don't RunPlaybook.check_ping() fails because of lacking ansible and doesn't even get to the part where python bootstraping happens on CoreOS.

#!/usr/bin/env bash
set -e

#sudo pip2 install ansible kubespray
get_coreos_nodes() {
  for node in $@
  do
    echo node1[ansible_host=${node},bootstrap_os=coreos,ansible_user=core]
  done
}

NODES=($(get_coreos_nodes 192.168.56.{10,12,13}))
kubespray prepare -y --nodes ${NODES[@]}
cat > ~/.kubespray/bootstrap-os.yml << EOF
- hosts: all
  become: yes
  gather_facts: False
  roles:
  - bootstrap-os
EOF

(cd ~/.kubespray; ansible-playbook -i inventory/inventory.cfg bootstrap-os.yml)
kubespray deploy -y --coreos