<p>I need to create two instances using the same Ubuntu Image in Kubernetes. Each instance used two ports i.e. 8080 and 9090. How can I access these two ports externally? Can we use the IP address of the worker in this case?</p>

Himanshu1310
<p>If you want to access your Ubuntu instances from outside the k8s cluster you should place pods behind the service.</p>
<p>You can access services through public IPs:</p>
<ul>
<li>create <code>Service</code> of type <code>NodePort</code>-  the <code>service</code> will be available on <code>&lt;NodeIp&gt;:&lt;NodePort&gt;</code></li>
<li>create <code>Service</code> of type <code>LoadBalancer</code> - if you are running your workload in the cloud creating service of type <code>LoadBalancer</code> will automatically deploy LoadBalancer for you.</li>
</ul>
<p>Alternatively you can deploy <code>Ingress</code> to expose your <code>Service</code>. You would also need Ingress Controller.</p>
<p>Useful links:</p>
<ul>
<li><a href="https://cloud.google.com/kubernetes-engine/docs/how-to/exposing-apps" rel="nofollow noreferrer">GCP example</a></li>
<li><a href="https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/" rel="nofollow noreferrer">Ingress Controller</a></li>
<li><a href="https://kubernetes.io/docs/concepts/services-networking/ingress/" rel="nofollow noreferrer">Ingress</a></li>
<li><a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">Kubernetes Service</a></li>
</ul>
