<p>In <code>Kubernetes</code>, a <code>Service</code> is linked to a <code>Deployment</code> with the <code>selector</code> property of the Service and the <code>label</code> property of the Deployment.</p>
<p>Then, can a Service be linked to Deployments or pods with different images?</p>

user11081980
<p>A Service can select all the pods whose <code>labels</code> are matched with service <code>selector</code>. It does not matter what images those pods have.</p>
<p>As far the k8s doc about service:</p>
<blockquote>
<p>An abstract way to expose an application running on a set of Pods as a network service.
With Kubernetes you don't need to modify your application to use an unfamiliar service discovery mechanism. Kubernetes gives Pods their own IP addresses and a single DNS name for a set of Pods, and can load-balance across them.</p>
</blockquote>
<p>So as far your question, the answer is yes.</p>
<p>For example, let's say about this service <code>yaml</code>, for this service it will select all the pods that have <code>app: MyApp</code> label, it does not matter what are in those pods.</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: my-service
spec:
  selector:
    app: MyApp
  ports:
    - protocol: TCP
      port: 80
      targetPort: 9376
</code></pre>
<p>You can read more about <a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="noreferrer">Service</a> then you will clear about it.</p>
