Kubespray: Vagrant - Fails to finish kubernetes deployment

Created on 24 Aug 2019  路  4Comments  路  Source: kubernetes-sigs/kubespray

Kubernetes cluster setup fails, with fail to copy kubectl to host.

  • Environment:
> vagrant version
Installed Version: 2.2.5
Latest Version: 2.2.5
  • OS (printf "$(uname -srm)\n$(cat /etc/os-release)\n"):
    Darwin 17.7.0 x86_64

  • Version of Ansible (ansible --version):

> ansible --version
ansible 2.7.12
  config file = /Volumes/develop/kf/cluster/ansible.cfg
  configured module search path = ['/Volumes/develop/kf/cluster/library']
  ansible python module location = /usr/local/lib/python3.7/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.7.4 (default, Jul  9 2019, 18:15:00) [Clang 10.0.0 (clang-1000.11.45.5)]
  • Kubespray version (commit) (git rev-parse --short HEAD):
> git rev-parse --short HEAD
10e0fe86

Network plugin used:
flannel

Copy of your inventory file:
see https://gist.github.com/butuzov/bde2b0ee95fd1a0a02505a6f8d66b296

Command used to invoke ansible:
inventory invoked via Vagrantfile

if $count == $total
  File.open('.hosts.yml', 'w') { |f| f.write host_vars.to_yaml }
  box.vm.provision "ansible" do |ansible|
    ansible.playbook = $playbook
    $ansible_inventory_path = File.join( $inventory, "hosts.ini")
    if File.exist?($ansible_inventory_path)
      ansible.inventory_path = $ansible_inventory_path
    end
    ansible.become = true
    ansible.limit = "all,localhost"
    ansible.host_key_checking = false
    ansible.raw_arguments = ["--forks=#{$num_instances}", "--flush-cache", "-e ansible_become_pass=vagrant"]
    ansible.host_vars = host_vars
    ansible.groups = {
      "etcd" => ["master-1"],
      "kube-master" => ["master-1"],
      "kube-node" => ["node-sml-1", "node-mid-1", "node-lrg-1"],
      "k8s-cluster:children" => [ "kube-master", "kube-node" ],
    }
  end

end

Output of ansible run:

Setup fails on step "Copy kubectl binary to ansible host" (i have added newlines)

fatal: [master-1]: FAILED! => {
"changed": false, 
"cmd": "/usr/bin/rsync --delay-updates -F --compress --archive --rsh=/usr/bin/ssh -S none -i /Users/butuzov/.vagrant.d/insecure_private_key -o Port=2222 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null --out-format=<<CHANGED>>%i %n%L /usr/local/bin/kubectl [email protected]:/Volumes/develop/kf/cluster/.vagrant/provisioners/ansible/inventory/artifacts/kubectl", 
"msg": "Warning: Permanently added '[127.0.0.1]:2222' (ECDSA) to the list of known hosts.\r\nrsync: connection unexpectedly closed (8 bytes received so far) [sender]\nrsync error: error in rsync protocol data stream (code 12) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-52/rsync/io.c(453) [sender=2.6.9]\n", 
"rc": 12}

Issue at roles/kubernetes/client/tasks/main.yml#L92-L98

kinbug

All 4 comments

Issues was added 2 days ago by @mboglesby in roles/kubernetes/client/tasks/main.yml. My fix - doesn't fix anything. Please ignore it. Wholdn't it be easier just to use copy module instead synchronize?

@butuzov - I just submitted PR #5120 to revert the change from the fetch to the synchronize module that I made with #5084. Changing to synchronize created more problems than it solved.

thank you!

I had the same problem and this solution helped me.

5170

Was this page helpful?
0 / 5 - 0 ratings