<p>I have a scenario where I need to have two instances of an app container run within the same pod. 
I have them setup to listen on different ports.  Below is how the Deployment manifest looks like. 
The Pod launches just fine with the expected number of containers.
I can even connect to both ports on the podIP from other pods. </p>

<pre><code>kind: Deployment
metadata:
  labels:
    service: app1-service
  name: app1-dep
  namespace: exp
spec:
  template:
    spec:
      contianers:
        - image: app1:1.20
          name: app1
          ports:
          - containerPort: 9000
            protocol: TCP
        - image: app1:1.20
          name: app1-s1
          ports:
          - containerPort: 9001
            protocol: TCP
</code></pre>

<p>I can even create two different Services one for each port of the container, and that works great as well. 
I can individually reach both Services and end up on the respective container within the Pod.</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: app1
  namespace: exp
spec:
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: 9000
  selector:
    service: app1-service
  sessionAffinity: None
  type: ClusterIP

---
apiVersion: v1
kind: Service
metadata:
  name: app1-s1
  namespace: exp
spec:
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: 9001
  selector:
    service: app1-service
  sessionAffinity: None
  type: ClusterIP
</code></pre>

<p>I want both the instances of the container behind a single service, that round robins between both the containers.
How can I achieve that? Is it possible within the realm of services? Or would I need to explore ingress for something like this?</p>

Naga
<p>Kubernetes services has three proxy modes: <code>iptables</code> (is the default), <code>userspace</code>, <code>IPVS</code>.</p>

<ul>
<li><code>Userspace</code>: is the older way and it distribute in round-robin as the only way.</li>
<li><code>Iptables</code>: is the default and select at random one pod and stick with it.</li>
<li><code>IPVS</code>: Has multiple ways to distribute traffic but first you have to install it on your node, for example on centos node with this command:
<code>yum install ipvsadm</code> and then make it available.</li>
</ul>

<p>Like i said, Kubernetes service by default has no round-robin.
To activate <code>IPVS</code> you have to add a parameter to kube-proxy</p>

<p><code>--proxy-mode=ipvs</code></p>

<p><code>--ipvs-scheduler=rr</code>  (to select round robin)</p>
