<p><strong>I m using Minikube for kubernetes deployment and Operating system i m using is Ubuntu 18.04</strong></p>
<p><em>I have a Deployment of my application with 3 replicas. So when i deploy 3 pods gets deployed .
when i increase the number of http request all the request are forwarded to the a single pod while there are no logs recorded in the other two replicas.</em></p>
<p>Any ideas on how the load get distributed across all the pods.</p>
<p>i have the deployment.yaml and respective service.yaml file below</p>
<pre><code>    deployment.yaml


    apiVersion: apps/v1
    kind: Deployment
    metadata:
          name: master
      labels:
       app: master-container
    spec:
     selector:
       matchLabels:
         app: master-container
     replicas: 3
     template:
       metadata:
         labels:
           app: master-container
       spec:
         volumes:
         - name: logs-dir
           hostPath:
            path: /data/logs/
            type: DirectoryOrCreate
         containers:
          - name: master-container
            image: image:1
            volumeMounts:
            - mountPath: /data/workspace/logs/
              name: logs-dir

    service.yaml
    
apiVersion: v1
kind: Service
metadata:
  name: master-container
  labels:
    app: master-container
spec:
  selector:
    app: master-container
  ports:
  - port: 2000
    protocol: TCP
    targetPort: 2000
    name: can-port
    nodePort: 32000
  - port: 2002
    protocol: TCP
    targetPort: 2002
    name: can-ajp-port
    nodePort: 32002
  - port: 2003
    protocol: TCP
    targetPort: 2003
    name: cas-port
    nodePort: 32003
  - port: 2005
    protocol: TCP
    targetPort: 2005
    name: cas-ajp-port
    nodePort: 32005
  - port: 31900
    protocol: TCP
    targetPort: 31900
    name: cas-master-port
    nodePort: 31900
  type: NodePort
</code></pre>
<p>Have a look at the below image this is the output of the command</p>
<p>kubectl describe svc canmastercontainer</p>
<p>We can see that service is up and all the ports are accessible . The only issue i m facing is that the load distribution is not happening across the pods</p>
<p><a href="https://i.stack.imgur.com/BF6yn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BF6yn.png" alt="enter image description here" /></a></p>
<p>i have tried giving type as NodePort , LoadBalancer and ClusterIp all the three didnt work out .
All the http request are getting transferred to the single pod .</p>
<p>Any solutions would be appriciated thank you</p>

<p>Every node in a Kubernetes cluster runs a <code>kube-proxy</code>. <code>kube-proxy</code> is responsible for implementing a form of <code>virtual IP</code> for <code>Services</code> of type other than <code>ExternalName</code>.</p>
<p><code>kube-proxy</code> can work in a few modes:</p>
<ul>
<li><a href="https://kubernetes.io/docs/concepts/services-networking/service/#proxy-mode-userspace" rel="nofollow noreferrer">User space proxy mode</a></li>
<li><a href="https://kubernetes.io/docs/concepts/services-networking/service/#proxy-mode-iptables" rel="nofollow noreferrer">iptables proxy mode</a></li>
<li><a href="https://kubernetes.io/docs/concepts/services-networking/service/#proxy-mode-ipvs" rel="nofollow noreferrer">IPVS proxy mode</a></li>
</ul>
<p>However, expect built-in Kubernetes methods you can use 3rd party software like <a href="https://kubernetes.github.io/ingress-nginx/deploy/" rel="nofollow noreferrer">Nginx Ingress</a>.</p>
<h3>Test scenario</h3>
<p>Nginx Ingress, bare metal consideration on GCP Ubuntu VM.</p>
<p><strong>Hello world YAML</strong></p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: deployment-1
spec:
  replicas: 1
  selector:
    matchLabels:
      key: application-1
  template:
    metadata:
      labels:
        key: application-1
    spec:
      containers:
      - name: hello1
        image: gcr.io/google-samples/hello-app:1.0
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 8080
</code></pre>
<p><strong>Service Yaml:</strong></p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: service-one
spec:
  selector:
    key: application-1
  ports:
    - port: 80
      targetPort: 8080
</code></pre>
<p><strong>Ingress Yaml:</strong></p>
<pre><code>apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: test-ingress
  annotations:
    kubernetes.io/ingress.class: &quot;nginx&quot;      
spec:
  rules:
  - http:
      paths:
      - path: /one
        backend:
          serviceName: service-one
          servicePort: 80
      - path: /two
        backend:
          serviceName: service-two
          servicePort: 80
</code></pre>
<p><strong>Ingress Description:</strong></p>
<pre><code>Rules:
  Host        Path  Backends
  ----        ----  --------
  *           
              /one   service-one:80 (192.168.243.80:8080,192.168.243.84:8080,192.168.243.85:8080)
              /two   service-two:80 (192.168.243.81:8080,192.168.243.82:8080,192.168.243.83:8080)
          
</code></pre>
<h3>Tests</h3>
<pre><code>$ curl 34.89.244.41:31337/one
Hello, world!
Version: 1.0.0
Hostname: deployment-1-77ddb77d56-4x4pd
$ curl 34.89.244.41:31337/one
Hello, world!
Version: 1.0.0
Hostname: deployment-1-77ddb77d56-vq72x
$ curl 34.89.244.41:31337/one
Hello, world!
Version: 1.0.0
Hostname: deployment-1-77ddb77d56-v5826
$ curl 34.89.244.41:31337/one
Hello, world!
Version: 1.0.0
Hostname: deployment-2-fb984955c-xk5h9
$ curl 34.89.244.41:31337/two
Hello, world!
Version: 2.0.0
Hostname: deployment-2-fb984955c-lw74g
$ curl 34.89.244.41:31337/two
Hello, world!
Version: 2.0.0
Hostname: deployment-2-fb984955c-xk5h9
$ curl 34.89.244.41:31337/two
Hello, world!
Version: 2.0.0
Hostname: deployment-2-fb984955c-lw74g
$ curl 34.89.244.41:31337/two
Hello, world!
Version: 2.0.0
Hostname: deployment-2-fb984955c-8pfls
$ curl 34.89.244.41:31337/two
Hello, world!
Version: 2.0.0
Hostname: deployment-2-fb984955c-8pfls
</code></pre>
<p>As you can see, each request was redirected to different pod.</p>
<p>If this won't work, please provide more details which was asked under your question.</p>
