<p>I am trying to understand k8s and helm. </p>

<p>When I create a helm chart, there are 2 files: <code>service.yaml</code> and <code>deployment.yaml</code>. Both of them have a <strong>name</strong> field. </p>

<p>If I understand correctly, the deployment will be responsible for managing the pods, replicasets, etc and thus the service.  </p>

<p>Basically, why am I allowed use a separate name for the service and for the deployment? Under what scenario would we want these 2 names to differ? Can a deployment have more than 1 service?</p>

Ufder
<p>The "service" creates a persistent IP address in your cluster which is how everything else connects it. The Deployment creates a ReplicaSet, which creates a Pod, and this Pod is the backend for that service. There can be more than 1 pod, in which case the service load balances, and these pods can change over time, change IP's, but your service remains constant.</p>

<p>Think of the service as a load balancer which points to your pods. It's analogous to interfaces and implementations. The service is like an interface, which is backed by the pods, the impementations.</p>

<p>The mapping is m:n. You can have multiple services backed by a single pod, or multiple pods backing a single service.</p>
