<p>I am fairly new to Kubernetes.  I am trying to figure out the best structure for a pod that requires configuration depending upon which pod requests its services.</p>
<p>So for example.  Data Stream port might be 8080, this is a stream of data of unknown size. Data is processes as it is received. So I can't really use a REST API with a payload as the payload is a stream which could be days long.</p>
<p>The issue is that I might have 10+ copies of this service, and they need to be configured dynamically upon a client pod connecting to that service.  I would prefer to use a separate port like 9000 to connect to the pod with an XML or INI file type of configuration.</p>
<p>My concern is the following.  Since there is 10 copies and the same pod is making 2 unique requests to a services, are they guaranteed to connect to the same service pod or could they be 2 different ones?  Ultimately, I would want to select a service pod (orchestrator can select, but it be a known IP address now), send a configuration file to 9000, then connect to port 8080 with a data stream for the service to be properly completed.</p>

mazecreator
<p>Since you are trying to open multiple ports for the same service on the same pod, you can assign each port a different name. I’m providing you with a sample yaml file in which a service is communicating outside using both port 80 and port 443.</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
 name: my-service
spec:
 selector:
   app: MyApp
 ports:
   - name: http
     protocol: TCP
     port: 80
     targetPort: 9376
   - name: https
     protocol: TCP
     port: 443
     targetPort: 9377
</code></pre>
<p>For more information and explanation you can refer to this <a href="https://www.devopsschool.com/blog/how-to-expose-multiple-port-in-services-in-kubernetes-or-multi-port-services/" rel="nofollow noreferrer">link</a> from where the above yaml example is provided.</p>
<p><strong>Update:</strong></p>
<ol>
<li>@mazecreator I can suggest a workaround for now, attach a temp or
persistent volume to your service deployment and when you are
trying to push your configuration files using port 9000 push them
to this volume and when your application is performing data stream
operation it will fetch your configs from here and it will be
completed properly.</li>
<li>@mazecreator follow these steps and create separate deployment
files for each application you are going to deploy in this way all
the pods related to that particular application can only access
this volume.</li>
</ol>
