<p>I am trying to create Kubernetes cluster using kubespray with single master and 3 working node. I cloned the github kubespray repository and running the ansible playbook from my control node for forming cluster.</p>
<p>I am trying the following command:</p>
<pre><code>ansible-playbook \
  -i inventory/sample/hosts.ini \
  cluster.yml \
  --become \
  --ask-become-pass
</code></pre>
<p>When I am running the command, 2 worker node getting final status ok. But for the master node it showing failed and getting error like the following:</p>
<pre><code>fatal: [mildevkub020]: FAILED! =&gt; {
  &quot;changed&quot;: false, 
  &quot;msg&quot;: &quot;error running kubectl (/usr/local/bin/kubectl apply 
  --force --filename=/etc/kubernetes/k8s-cluster-critical-pc.yml) 
  command (rc=1), out='', err='error: unable to recognize 
  \&quot;/etc/kubernetes/k8s-cluster-critical-pc.yml\&quot;: Get 
  http://localhost:8080/api?timeout=32s: dial tcp 127.0.0.1:8080: 
  connect: connection refused\n'&quot;
}
</code></pre>
<p>I am adding the screenshot for the error below:</p>
<p><a href="https://i.stack.imgur.com/M3jkO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/M3jkO.png" alt="enter image description here" /></a></p>
<p><strong>Modification</strong></p>
<p>I removed my older kubespray repo and cloned the fresh one from the following link,</p>
<p><a href="https://github.com/kubernetes-sigs/kubespray.git" rel="nofollow noreferrer">https://github.com/kubernetes-sigs/kubespray.git</a></p>
<p>And updated my inventory. But still getting the same error. When I run &quot;journalctl&quot; command for logs, I am getting like the following:</p>
<pre><code>Oct 15 09:56:17 mildevdcr01 kernel: NX (Execute Disable) protection: active
Oct 15 09:56:17 mildevdcr01 kernel: SMBIOS 2.4 present.
Oct 15 09:56:17 mildevdcr01 kernel: DMI: VMware, Inc. VMware Virtual 
Platform/440BX Desktop Reference Platform, BIOS 6.00 09/22/2009
Oct 15 09:56:17 mildevdcr01 kernel: Hypervisor detected: VMware
Oct 15 09:56:17 mildevdcr01 kernel: Kernel/User page tables isolation: disabled
Oct 15 09:56:17 mildevdcr01 kernel: e820: update [mem 0x00000000-0x00000fff] usable ==&gt; reserved
Oct 15 09:56:17 mildevdcr01 kernel: e820: remove [mem 0x000a0000-0x000fffff] usable
Oct 15 09:56:17 mildevdcr01 kernel: AGP: No AGP bridge found
Oct 15 09:56:17 mildevdcr01 kernel: e820: last_pfn = 0x240000 max_arch_pfn = 0x400000000
Oct 15 09:56:17 mildevdcr01 kernel: MTRR default type: uncachable
Oct 15 09:56:17 mildevdcr01 kernel: MTRR fixed ranges enabled:
Oct 15 09:56:17 mildevdcr01 kernel:   00000-9FFFF write-back
Oct 15 09:56:17 mildevdcr01 kernel:   A0000-BFFFF uncachable
Oct 15 09:56:17 mildevdcr01 kernel:   C0000-CBFFF write-protect
</code></pre>
<p>Error ,</p>
<pre><code>fatal: [mildevkub020]: FAILED! =&gt; {&quot;attempts&quot;: 10, &quot;changed&quot;: false, &quot;msg&quot;: &quot;error running kubectl (/usr/local/bin/kubectl apply --force --filename=/etc/kubernetes/node-crb.yml) command (rc=1), out='', err='W1016 06:50:31.365172   22692 loader.go:223] Config not found: etc/kubernetes/admin.conf\nerror: unable to recognize \&quot;/etc/kubernetes/node-crb.yml\&quot;: Get http://localhost:8080/api?timeout=32s: dial tcp 127.0.0.1:8080: connect: connection refused\n'&quot;}
</code></pre>

Mr.DevEng
<p>Make sure that you have followed all <a href="https://github.com/kubernetes-sigs/kubespray#requirements" rel="nofollow noreferrer">requirements</a> before cluster installation. 
Especially copying ssh key to all the servers part of your inventory.</p>

<p>Reset environment after previous installation:</p>

<pre><code>$ sudo ansible-playbook -i inventory/mycluster/hosts.yml reset.yml -b -v \
  --private-key=~/.ssh/private_key
</code></pre>

<p>Remember to change <a href="https://github.com/kubernetes-sigs/kubespray/blob/master/inventory/sample/group_vars/k8s-cluster/k8s-cluster.yml" rel="nofollow noreferrer">cluster configuration</a> file and personalize it.
You can change network plugin - default is Calico.</p>

<p>Then run ansible playbook again using this command:</p>

<pre><code>$ sudo ansible-playbook -i inventory/sample/hosts.ini cluster.yml -b -v \ 
  --private-key=~/.ssh/private_key
</code></pre>

<p>Try to copy /sample folder and rename it and then change k8s-cluster and hosts file.</p>

<p>Check hosts file:
Remember to not modify the children of k8s-cluster, like putting the etcd group into the k8s-cluster, unless you are certain to do that.</p>

<pre><code>k8s-cluster ⊂ etcd =&gt; kube-node ∩ etcd = etcd
</code></pre>

<p>Example inventory file you can find here: <a href="https://github.com/kubernetes-sigs/kubespray/blob/master/docs/ansible.md" rel="nofollow noreferrer">inventory</a>.</p>

<p>If problem still exists please execute command journalctl and check what logs show.</p>

<p><strong>EDIT:</strong></p>

<p>As you provided more information. From your logs it looks like you have to
set the VM hardware version to the highest available in your VMware setup, and install all available updates on this system.</p>
