Containers and Kubernetes

Get Involved. Join the Conversation.


    Joydeepta Bhattacharjee
    Pod to Pod communication with service name Should be...
    Topic posted July 20, 2019 by Joydeepta BhattacharjeeRed Ribbon: 250+ Points, last edited July 25, 2019, tagged Containers, Docker, Kubernetes, Tip 
    58 Views, 1 Comment
    Pod to Pod communication with service name Should be followed with Ingress Resource to realise a decouple connection
    Instead of accessing IP which changes with deployment I would like to access pod deployment with service created which is not working in OCI OKE setup

    kubectl describe services kube-dns --namespace kube-system


    Name:              kube-dns
    Namespace:         kube-system
    Selector:          k8s-app=kube-dns
    Type:              ClusterIP
    Port:              dns  53/UDP
    TargetPort:        53/UDP
    Port:              dns-tcp  53/TCP
    TargetPort:        53/TCP
    Session Affinity:  None
    Events:            <none>
    [opc@test ~]$


    , kubectl describe svc my-api 

    [opc@test ~]$ kubectl describe svc springbootapp-demo-service
    Name:                     springbootapp-demo-service
    Namespace:                default
    Labels:                   <none>
    Annotations:              <none>
    Selector:                 app=app
    Type:                     LoadBalancer
    LoadBalancer Ingress:
    Port:                     <unset>  80/TCP
    TargetPort:               8035/TCP
    NodePort:                 <unset>  30963/TCP
    Endpoints:      ,, + 1 more...
    Session Affinity:         None
    External Traffic Policy:  Cluster
    Events:                   <none>


    Now  when i exec(kubectl exec -it  **Pod) to a pod and wget the other pod by FQDN it's not reached. I also connected a busy-box image to debug the kube-dns networking between pods. 

    Exec to the pod takes to prompt as  kubectl exec -it nodejs-deployment-6bffdcb99c-lf8gn sh and tried to wget below end point dummy but unreachable though IP is looked up.

     wget http://springbootapp-demo-service/demo/test
    Connecting to springbootapp-demo-service(

    This has been fixed now by renaming the selector lebel in deployment yml to unique name as they are in default name space