Cluster service unable to redirect traffic to pods running on different nodes

22 views Asked by At

I have spin a multi node micro k8s clusters locally on my raspberry PI's I deployed A service which exposes a deployment. Now whenever I try to curl the service on which the pod is actually running the traffic from service goes to pod. But once I move the pod to another node and try to do the curl there is no response. Wondering if anyone have faced the same issues

Tried reinstalling the cluster bunch of times and problem is persistent. Adding more insight here

sumit@raspberry3:~$ microk8s kubectl describe svc echo-service -o wide
error: unknown shorthand flag: 'o' in -o
See 'kubectl describe --help' for usage.
sumit@raspberry3:~$ microk8s kubectl describe svc echo-service
Name:              echo-service
Namespace:         default
Labels:            <none>
Annotations:       <none>
Selector:          app=echo-server
Type:              ClusterIP
IP Family Policy:  SingleStack
IP Families:       IPv4
IP:                10.152.183.87
IPs:               10.152.183.87
Port:              <unset>  5678/TCP
TargetPort:        5678/TCP
Endpoints:         10.1.89.195:5678
Session Affinity:  None
Events:            <none>

sumit@raspberry3:~$ microk8s kubectl describe pods echo-deployment-8fff96458-7krlm
Name:             echo-deployment-8fff96458-7krlm
Namespace:        default
Priority:         0
Service Account:  default
Node:             raspberry2/192.168.0.27
Start Time:       Fri, 13 Oct 2023 16:27:41 -0400
Labels:           app=echo-server
                  pod-template-hash=8fff96458
Annotations:      cni.projectcalico.org/containerID: 86bbaba20a9ba4ab461105893c64867caff2f1ba1035890130a1a98963cc16d1
                  cni.projectcalico.org/podIP: 10.1.89.195/32
                  cni.projectcalico.org/podIPs: 10.1.89.195/32
Status:           Running
IP:               10.1.89.195
IPs:
  IP:           10.1.89.195
Controlled By:  ReplicaSet/echo-deployment-8fff96458
Containers:
  echo-server:
    Container ID:  containerd://62479925df8a1ed6ef49b842c52aa2df991042a86b58cb789d692ccf15ec4e25
    Image:         hashicorp/http-echo
    Image ID:      docker.io/hashicorp/http-echo@sha256:fcb75f691c8b0414d670ae570240cbf95502cc18a9ba57e982ecac589760a186
    Port:          <none>
    Host Port:     <none>
    Args:
      -text=newbanana
    State:          Running
      Started:      Fri, 13 Oct 2023 16:27:48 -0400
    Ready:          True
    Restart Count:  0
    Environment:    <none>
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-q7qqh (ro)
Conditions:
  Type              Status
  Initialized       True
  Ready             True
  ContainersReady   True
  PodScheduled      True
Volumes:
  kube-api-access-q7qqh:
    Type:                    Projected (a volume that contains injected data from multiple sources)
    TokenExpirationSeconds:  3607
    ConfigMapName:           kube-root-ca.crt
    ConfigMapOptional:       <nil>
    DownwardAPI:             true
QoS Class:                   BestEffort
Node-Selectors:              <none>
Tolerations:                 node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                             node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:                      <none>

My understanding was that I should be able to reach to this pod from any node by accessing the cluster service and so far I am only able to reach to the pod when I am on the node on which pod is deployed

0

There are 0 answers