How to Route to specific pod through Kubernetes Service (like a Gateway API)

后端 未结 3 1406
情话喂你
情话喂你 2021-01-05 07:05

I am running Kubernetes on \"Docker Desktop\" in Windows.

I have a LoadBalancer Service for a deployment which has 3 replicas. I would like to access SPECIFIC pod th

3条回答
  •  [愿得一人]
    2021-01-05 07:45

    You can use StatefulSets if you are not required to use deployment.

    For replica 3, you will have 3 pods named

    1. stream-deployment-0
    2. stream-deployment-1
    3. stream-deployment-2

    You can access each pod as $(podname).$(service name).$(namespace).svc.cluster.local

    For details, check this

    You may also want to set up an ingress to point each pod from outside of the cluster.

提交回复
热议问题