<p>I'm trying to create my own k8s cluster for training purpose. I have installed kubernetes with kubedam and my master node is ready:</p>
<pre><code>NAME       STATUS   ROLES    AGE   VERSION
master-1   Ready    master   54s   v1.19.4
</code></pre>
<p>Now I'm trying join my worker instance with the join command with the token given at the end of the <code>kubeadm init</code> but I have this error when I do the command:</p>
<pre><code>sudo kubeadm join my-master-node-ip-here:6443 --token xxxx.xxxxxxxxxxxx \
    --discovery-token-ca-cert-hash sha256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
</code></pre>
<p>The error:</p>
<pre class="lang-sh prettyprint-override"><code>[preflight] Running pre-flight checks
        [WARNING IsDockerSystemdCheck]: detected &quot;cgroupfs&quot; as the Docker cgroup driver. The recommended driver is &quot;systemd&quot;. Please follow the guide at https://kubernetes.io/docs/setup/cri/
        [WARNING SystemVerification]: missing optional cgroups: hugetlb
error execution phase preflight: couldn't validate the identity of the API Server: Get &quot;https://my-master-node-ip-here:6443/api/v1/namespaces/kube-public/configmaps/cluster-info?timeout=10s&quot;: net/http: request canceled
 while waiting for connection (Client.Timeout exceeded while awaiting headers)
To see the stack trace of this error execute with --v=5 or higher
</code></pre>
<p>I have used Weave for the pod network</p>
<pre><code>kubectl apply -f &quot;https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')&quot;
</code></pre>
<p>And with Terraform the 2 instances are in the same VPC called <code>k8s-node</code></p>
<p><code>network.tf</code></p>
<pre><code>resource &quot;google_compute_network&quot; &quot;vpc_network&quot; {
  name = &quot;k8s-node&quot;
}

# We create a public IP address for our google compute instance to utilize
resource &quot;google_compute_address&quot; &quot;static&quot; {
  name = &quot;vm-public-address&quot;
}
</code></pre>
<p><code>instance.tf</code></p>
<pre><code>resource &quot;google_compute_instance&quot; &quot;default&quot; {
    name = var.vm_name
    machine_type = &quot;e2-standard-2&quot;
    zone = &quot;europe-west1-b&quot;

    boot_disk {
        initialize_params {
            image = &quot;debian-cloud/debian-9&quot;
        }
    }

    network_interface {
        network = var.network
        access_config {
            // Include this section to give the VM an external IP address
        }
    }

    metadata_startup_script = file(&quot;./scripts/bootstrap.sh&quot;)

    tags = [&quot;node&quot;]
}
</code></pre>
<p>It seems that the worker can't connect to the master instances, Did I miss something in my configuration?</p>

<p>To solve the issue I have added a firewall rule in teraform and open port <code>6443</code></p>
<pre class="lang-json prettyprint-override"><code>resource &quot;google_compute_network&quot; &quot;vpc_network&quot; {
  name = &quot;k8s-node&quot;
}

resource &quot;google_compute_firewall&quot; &quot;default&quot; {
  name    = &quot;k8s-firewall&quot;
  network = google_compute_network.vpc_network.name

  allow {
    protocol = &quot;icmp&quot;
  }

  allow {
    protocol = &quot;tcp&quot;
    ports    = [&quot;80&quot;, &quot;6443&quot;]
  }

  source_tags = [&quot;node&quot;]
}
</code></pre>
