I am new to both technologies. My question / understanding problem is: What is the difference between Docker Network and Kubernetes Services? I think both terms mean the same thing. One in the context of Docker without Kubernetes and the other in the context of Kubernetes. Is that correct?
>Solution :
Docker networks and Kubernetes Services are fairly different, and there’s not a lot of overlap between them beyond them both being vaguely network-oriented.
A Docker network provides a dedicated IP address space and DNS namespace for a group of containers. Kubernetes doesn’t have an equivalent; there is a single shared network across a cluster.
A Kubernetes Service provides a cluster-internal load balancer across some number of replicated Pods. Docker doesn’t have an equivalent; you always contact containers directly.
A Kubernetes Service with type: NodePort can be reached from outside the cluster by contacting some port on any node in the cluster. This is similar to Docker’s published-port mechanism. In Kubernetes, the port number is in a restricted range (usually 30000-32767 only). In many Kubernetes environments you can’t directly reach the underlying nodes to make use of a NodePort.
A Kubernetes Service with type: LoadBalancer requests an external load balancer. It’s up to a cluster-level provisioner to actually provide this. Docker has no equivalent.