score:0

you seem to answer your own question: that ip address is private.
you'll want to set a service definition in order to expose it to the public.

score:1

the 3 main methods for accessing an internal kubernetes service from outside are: nodeport, loadbalancer, and ingress.

you can read about some of the main differences between them here https://medium.com/google-cloud/kubernetes-nodeport-vs-loadbalancer-vs-ingress-when-should-i-use-what-922f010849e0


nodeport

map a randomly or manually selected high port from a certain range to a service on a 1 to 1 basis.

either allow kubernetes to randomly select a high port, or manually define a high port from a predefined range which is by default 30000–32767 (but can be changed), and map it to an internal service port on a 1 to 1 basis.

warning: although it is possible to manually define a nodeport port number per service, it is generally not recommended due to possible issues such as port conflicts. so in most cases, you should let the cluster randomly select a nodeport port number for you.

from official docs: https://kubernetes.io/docs/concepts/services-networking/service/#nodeport

if you set the type field to nodeport, the kubernetes master will allocate a port from a range specified by --service-node-port-range flag (default: 30000-32767), and each node will proxy that port (the same port number on every node) into your service.


loadbalancer

attach a service to an external ip provided by an ip provider service such as a cloud provider public ip service.

the functionality of this service type depends on external drivers/plugins. most modern clouds offer support to supply public ips for loadbalancer definitions. but if you are spinning a custom cluster with no means to assign public ips (such as with rancher with no ip provider plugins), the best you can probably do with this is assign an ip of a host machine to a single service.

from the official docs: https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer

on cloud providers which support external load balancers, setting the type field to loadbalancer will provision a load balancer for your service. the actual creation of the load balancer happens asynchronously, and information about the provisioned balancer will be published in the service’s .status.loadbalancer field.


ingress

run a central application router service which receives all traffic on a certain port (or ports) and routes it to services based on parameters like the requested domain and path.

to install it you must create an application router service (such as nginx) which runs in your cluster and analyzes every new resource of type ingress that is created. then you create ingress resource that define the routing rules you would like such as which dns request to listen to and which service to forward the request to.

although multiple solutions exist for this purpose, i recommend nginx ingress

https://github.com/helm/charts/tree/master/stable/nginx-ingress https://github.com/kubernetes/ingress-nginx

official docs:

what is ingress? typically, services and pods have ips only routable by the cluster network. all traffic that ends up at an edge router is either dropped or forwarded elsewhere. conceptually, this might look like:

internet
    |   ------------   [ services ] an ingress is a collection of rules that allow inbound connections to reach the cluster services.

internet
    |    [ ingress ]    --|-----|--    [ services ] it can be configured to give services externally-reachable urls, load balance

traffic, terminate ssl, offer name based virtual hosting, and more. users request ingress by posting the ingress resource to the api server. an ingress controller is responsible for fulfilling the ingress, usually with a loadbalancer, though it may also configure your edge router or additional frontends to help handle the traffic in an ha manner.


Related Query

More Query from same tag