<p>Im new to kubernetes. In the yaml file to create services, i define externalIPs value in order to access services from outside the cluster:</p>
<pre><code>kind: Service
apiVersion: v1
metadata:
  name: mytestservice
spec:
  type: ClusterIP
  clusterIP: 10.96.1.113
  externalIPs:
    - 172.16.80.117
  ports:
    - name: tcp-8088
      protocol: TCP
      port: 8088
      targetPort: 8088:
  selector:
    service-app: mytestservice
</code></pre>
<p>and it works just fine, i can call to my service by using externalIp:port (this case 172.16.80.117:8088). But i heard people talking about ingress controller (and some API gateways) that provide access from outside. I do read about them a bit but still cant tell what're the differences!? and does my cluster need them or not?</p>
<p>(According to the accepted answer i found here <a href="https://stackoverflow.com/questions/44110876/kubernetes-service-external-ip-pending">Kubernetes service external ip pending</a></p>
<p><code>With the Ingress Controller you can setup a domain name which maps to your pod; you don't need to give your Service the LoadBalancer type if you use an Ingress Controller.</code></p>
<p>My cluster is a custom K8s Cluster too, using kubeadm. If i have no need of using domain name, just address my services directly by externalip and port then i can totally ignore ingress controller. Am i right?</p>
<p>Thanks!</p>

Left Click
<p>Welcome to the community.</p>
<p><strong>Short answer:</strong></p>
<p>At this point the answer to your question is yes, for simple cases you may completely ignore ingress. It will be a good option when it's time to go to production.</p>
<hr />
<p><strong>A bit more details:</strong></p>
<p>Main point why you may need to look at <code>ingress</code> is because it manages incoming traffic: works with HTTP/HTTPS requests, provides routing based on paths, can work with TLS/SSL and can perform <a href="https://en.wikipedia.org/wiki/TLS_termination_proxy" rel="nofollow noreferrer">TLS termination</a> and many more.</p>
<p>There are different ingresses available, most common is <code>nginx ingress</code>. It has almost all features regular <code>nginx</code> has. You can find <a href="https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/" rel="nofollow noreferrer">nginx ingress annotations</a> to see what it can do.</p>
<p>For example, if you have microservices application, for each service separate load balancer will be required while everything can be directed to single ingress and routed further to services (see examples in useful links).</p>
<p>If you only play with kubernetes and single service, no need to even have a loadbalancer, you can use a <code>nodePort</code> or <code>externalIP</code>.</p>
<p>Also with <code>ingress</code> deployed, there's no need to specify a port. Usually <code>ingress</code> listens to <code>80</code> and <code>443</code> respectively.</p>
<p>I'd say it's worth trying to see how it works and make routing and managing service cleaner.</p>
<hr />
<p><strong>Useful links:</strong></p>
<ul>
<li><a href="https://kubernetes.io/docs/concepts/services-networking/ingress/" rel="nofollow noreferrer">kubernetes ingress - description and examples</a></li>
<li><a href="https://kubernetes.github.io/ingress-nginx/user-guide/basic-usage/" rel="nofollow noreferrer">basic usage - host based routing</a></li>
</ul>
