<p><strong>Requirement</strong> :
I have two docker containers where both expose to different ports. (For eg port 9001 and 9002)</p>

<p>From the requirement,  I try to design the kubernetes objects and their relationships but I am unsure whether A or B is correct.</p>

<p>A) 1 Ingres connect to 1 service. And 1 service connect to 1 statefulset with 1 pod of 2 containers</p>

<p>B) 2 Ingres connect to 2 services. And 2 service connect to 2 statefulset with 2 pod. Every pod have 1 container.</p>

<p>I want to ask the following questions:</p>

<ol>
<li>Can 1 Ingres or 1 service or 1 statefulset or 1 pod serves 2 ports? If can then probably A is correct, else B is correct.</li>
<li>Also base on my question, can anyone tell me whether my understanding of kubernetes is correct or wrong?</li>
</ol>

Charles Brown
<p>1 ingress can serve n number of services and routes external connections to services based on the host and hostPath.</p>

<p>1 service can serve multiple ports and it assigns different nodeports mapping to each port.</p>

<p>1 pod can aslo serve multiple ports and it depends on the port you expose in your manifest.</p>

<p>Statefulsets are more like pods manifest it’s just that they provide a addon functionality of persistence of volumes.</p>
