1

There're some ways to expose services: NodePort, LoadBalancer, etc

K8s cluster is in-network 192.168.10.0/24 but I want to access it from 10.100.10.0/24, assume that we have a firewall configured.

How can I access services in the k8s cluster from an external local network 10.100.10.0/24?

Rico
  • 58,485
  • 12
  • 111
  • 141
Tuyen Pham
  • 300
  • 3
  • 14
  • I guess you already answered your question: NodePort, Load Balancer. Or what to do you want to know? – Vasili Angapov Apr 22 '19 at 16:28
  • @Tuyen Pham: I guess your answer at here: https://stackoverflow.com/questions/55677937/can-i-reach-a-container-by-its-hostname-from-another-container-running-on-anoth/55678129#55678129 Access via service hostname. – Quynh Nguyen Apr 22 '19 at 17:28
  • NodePort consumes ports on nodes, LoadBalancer requires public ip address that supports from "provider"?. externalName requires a valid CNAME. How to specify ip address 10.100.10.21/32 for example for service in k8s cluster with LoadBalancer type? and how to use `mylocaldomain.local` as domain name for externalName type? – Tuyen Pham Apr 23 '19 at 18:25

1 Answers1

3

You've already mentioned it NodePort and LoadBalancer.

In the case of NodePort, you would use the IP address of the node and the specific TCP/UDP port on that node.

In the case of LoadBalancer, you would you use an 'internal' load balancer and use the IP or DNS entry for that load balancer.

Rico
  • 58,485
  • 12
  • 111
  • 141