<p>I'm learning k8s &amp; nodePort</p>
<ol>
<li>made 1 master node &amp; 1 worker node at AWS EC2</li>
<li>installed k8s, kubeadm</li>
<li>Use flannel CNI</li>
<li>deployed a nodejs app. with port 3000</li>
<li>Attach a nodePort to nodejs app. so, 3000:31000</li>
<li>I expected that i access to that nodejs app outside ec2 with url : &quot;[master-node-pub-ip]:31000&quot;</li>
<li>But i can't access to &quot;[master-node-pub-ip]:31000&quot; and can access with &quot;[worker-node-pub-ip]:31000&quot;</li>
</ol>
<p>I don't know what did i wrong...</p>
<p>How can i access that nodejs app via master nodes ip??</p>
<p>Thank you.</p>

mecha kucha
<p>Try to install an ingress controller</p>
<p>I prefer the helm way:</p>
<pre class="lang-sh prettyprint-override"><code>helm repo add nginx-stable https://helm.nginx.com/stable
helm repo update
helm install nginx-ingress nginx-stable/nginx-ingress --set rbac.create=true
</code></pre>
<p>Then you can access to you nodepert via the node public IP.</p>
