add EC2 nodes to baremetal kubernetes cluster

11/18/2019

I have a Kubernetes cluster setup with on bare-metal local nodes(all nodes are accessible through the public network and private network ). I want to add an EC2 node to this cluster. I have four nodes as MASTER, WORKER-1, WORKER-2, EC2-NODE.

MASTER, WORKER-1, WORKER-2 has full connectivity through the public and private networks. But EC2-NODE is only accessible on public networks from any node.

I have tried joining the EC2 node to the cluster and give --node-ip=$public_ip_of_ec2_node, EC2 node joined successfully and mark as ready but services are not reachable from other nodes to the EC2 node. It joins on the private network interface (eth0) and exposes the private IP of the EC2 node to the cluster.

In the Kubernetes, there is a requirement that all nodes have full internet connectivity between them either private or public. What does it mean? Is it required to have a single network interface among nodes?

Any help would be nice.

Thank you in advance.

System Info:

Kuberenetes version: 1.16.2

Pod network: Flannel

-- irikeish
amazon-ec2
kubeadm
kubernetes
networking

1 Answer

11/19/2019

Let's start with understanding how to implement the Kubernetes networking model:

There are a number of ways that this network model can be implemented. This document is not an exhaustive study of the various methods, but hopefully serves as an introduction to various technologies and serves as a jumping-off point.

There you can find a list of networking options. Among them there is Flannel:

Flannel is a very simple overlay network that satisfies the Kubernetes requirements. Many people have reported success with Flannel and Kubernetes.

Flannel is responsible for providing a layer 3 IPv4 network between multiple nodes in a cluster. Flannel does not control how containers are networked to the host, only how the traffic is transported between hosts. However, flannel does provide a CNI plugin for Kubernetes and a guidance on integrating with Docker.

You are already using Flannel as a CNI plugin.

Please let me know if you find the info above helpful.

-- OhHiMark
Source: StackOverflow