<p>i have an application that record live traffic and replay them.</p>
<p><a href="https://github.com/buger/goreplay" rel="nofollow noreferrer">https://github.com/buger/goreplay</a></p>
<p>it is a simple app to use, but when i tried to use it with kubernetes i get a problem with connecting or communicating pods.</p>
<p>i created a pod with two containers, one is goreplay and the other is a simple python webserver.
in this pod the goreplay will track the traffic coming from outside to the python server and will forward it to another python server which is in another pod.</p>
<p>here is the first deployment file :</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: goreplay-deployment
  labels:
        app: goreplay-app
spec:
  replicas: 1
  selector:
    matchLabels:
      app: goreplay-app
  template:
    metadata:
      labels:
        app: goreplay-app
    spec:
      containers:
      - name: goreplay
        image: feiznouri/goreplay:2.0
        args:
          - --input-raw
          - :3000
          - --output-http=&quot;http://service-server.default:3200&quot;
        volumeMounts:
          - name: data
            mountPath: /var/lib/goreplay
      - name: myserver
        image: feiznouri/python-server:1.1
        args:
          - &quot;3000&quot;
        ports:
        - name: server-port
          containerPort: 3000
      volumes:
      - name: data
        persistentVolumeClaim:
          claimName: goreplay-claim
</code></pre>
<p>in the args section of the goreplay container i put the parametre , the output is one of them but i'm not sure what adress to put.</p>
<p>here is the service for the first deployment :</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: service-goreplay
spec:
  selector:
    app: goreplay-app
  ports:
    - port: 31001
      nodePort: 31001
      targetPort: server-port
      protocol: TCP
  type: NodePort
</code></pre>
<p>and here is the second deploment which has only the second server :</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: server-deployment
  labels:
        app: server-app
spec:
  replicas: 1
  selector:
    matchLabels:
      app: server-app
  template:
    metadata:
      labels:
        app: server-app
    spec:
      containers:
      - name: myserver
        image: feiznouri/python-server:1.1
        args:
          - &quot;3001&quot;
        ports:
        - name: server-port
          containerPort: 3001
</code></pre>
<p>and here is it's service :</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: service-server
spec:
  selector:
    app: server-app
  ports:
    - port: 3200
      targetPort: server-port
      protocol: TCP

</code></pre>
<p>the problem is that , this way , i'm not getting the traffic to the second server, i am sending request from outside to the first server and i see the traffic coming to the first one , but there is nothing in the second server</p>
<p>What is the correct adress to put in the output parametre of the second server for this to work.</p>

feiz
<p>I reproduced your issue and it seems the only thing you need to fix is the <code>args</code> field.</p>
<p>Add <code>&quot;</code> <code>&quot;</code> to every arguments, it should look like this:<br>
<strong>Note:</strong> <code>http://service-server.default:3200</code> isn't enclosed in additional double quotation mark.</p>
<pre><code>args:
  - &quot;--input-raw&quot;
  - &quot;:3000&quot;
  - &quot;--output-http=http://service-server.default:3200&quot;
      
      
</code></pre>
<p>More information on defining a command and arguments can be found in the <a href="https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/" rel="nofollow noreferrer">documentation</a>.</p>
