<p>I am setting up 2 VPC on GCP, I setup kubeadm on each, let's call them kubemaster and kubenode1. So I ran kubeadm on kubemaster and kubenode1 which :</p>

<ul>
<li><code>kubeadm init</code> on kubemaster</li>
<li><code>kubeadm join</code> on kubenode1</li>
</ul>

<p>When I was trying to <code>kubectl apply -f (a deployment which contains a pod with simple webapps inside)</code> and <code>kubectl apply -f (a NodePort type of Service which target the deployment port)</code></p>

<p>After that I simply access the webapps from my browser (on my local machine not on GCP), it just does not work as what I tried on minikube (I setup minikube with same kubectl apply as above too). I dig some search and there are a lot of people saying regarding Ingress and network layer (flannel in kubernetes website example)</p>

<p>My question is what are these Ingress and flannel ? Which one is necessary or both are not necessary at all if  I just want my webapp run ? How does each other works against others ? Because from my understanding the layering is as per below :</p>

<p><code>Traffic -&gt; Services -&gt; Deployments/Pods</code> </p>

<p>Where are these ingress and flannel suits to ? If its not about them both, why my apps does not work as intended (i open all port in GCP setting so its not security issue I suppose), I tried setting up Kubernetes Dashboard-UI, run <code>kubectl proxy</code> and still my browser cannot access both services (my webapp inside the deployment and also Dashboard API), may be I am a little bit lost here.</p>

thegexploit
<p>The flannel and the Ingress are completely different things. </p>

<p>flannel is a CNI or Container Network Interface plugin which task is networking between containers. As coreOS says:</p>

<blockquote>
  <p>each container is assigned an IP address that can be used to
  communicate with other containers on the same host. For communicating
  over a network, containers are tied to the IP addresses of the host
  machines and must rely on port-mapping to reach the desired container.
  This makes it difficult for applications running inside containers to
  advertise their external IP and port as that information is not
  available to them.</p>
  
  <p>flannel solves the problem by giving each container an IP that can be
  used for container-to-container communication. It uses packet
  encapsulation to create a virtual overlay network that spans the whole
  cluster. More specifically, flannel gives each host an IP subnet (/24
  by default) from which the Docker daemon is able to allocate IPs to
  the individual containers.</p>
</blockquote>

<p>The Kubernetes supports some other CNI plugins: Calico, weave, etc. They  vary according to functionality ( e.g. supporting features like NetworkPolicy for restricting resources )</p>

<p>The Ingress is a Kubernetes object which is usually operate at the application layer of the network stack (HTTP) and allow you to expose your Service externally, it also provides a features such as HTTP requests routing, cookie-based session affinity, HTTPS traffic termination and so on. (just like a web server Nginx or Apache)</p>
