<p>I have got 2 deployments in my cluster UI and USER. Both of these are exposed by Cluster IP service. There is an ingress which makes both the services publicly accessible.</p>
<p>Now when I do  &quot;kubectl exec -it UI-POD -- /bin/sh&quot; and then try to &quot;ping USER-SERVICE-CLUSTER-IP:PORT&quot; it doesn't work.</p>
<p>All I get is No packet returned i.e. a failure message.</p>
<p>Attaching my .yml file</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: user-service-app
  labels:
    app: user-service-app
spec:
  replicas: 1
  selector:
    matchLabels:
      app: user-service-app
  template:
    metadata:
      labels:
        app: user-service-app
    spec:
      containers:
      - name: user-service-app
        image: &lt;MY-IMAGE-URL&gt;
        imagePullPolicy: Always
        ports:
        - containerPort: 3000
        livenessProbe:
          httpGet:
            path: /ping
            port: 3000
        readinessProbe:
          httpGet:
            path: /ping
            port: 3000
          
          

---
apiVersion: &quot;v1&quot;
kind: &quot;Service&quot;
metadata:
  name: &quot;user-service-svc&quot;
  namespace: &quot;default&quot;
  labels:
    app: &quot;user-service-app&quot;
spec:
  type: &quot;ClusterIP&quot;
  selector:
    app: &quot;user-service-app&quot;
  ports:
  - protocol: &quot;TCP&quot;
    port: 80
    targetPort: 3000

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: ui-service-app
  labels:
    app: ui-service-app
spec:
  replicas: 1
  selector:
    matchLabels:
      app: ui-service-app
  template:
    metadata:
      labels:
        app: ui-service-app
    spec:
      containers:
      - name: ui-service-app
        image: &lt;MY-IMAGE-URL&gt;
        imagePullPolicy: Always
        ports:
        - containerPort: 3000

---
apiVersion: &quot;v1&quot;
kind: &quot;Service&quot;
metadata:
  name: &quot;ui-service-svc&quot;
  namespace: &quot;default&quot;
  labels:
    app: &quot;ui-service-app&quot;
spec:
  type: &quot;ClusterIP&quot;
  selector:
    app: &quot;ui-service-app&quot;
  ports:
  - protocol: &quot;TCP&quot;
    port: 80
    targetPort: 3000
  


---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: awesome-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /$2
spec:
  ingressClassName: nginx
  defaultBackend:
    service:
      name: ui-service-svc
      port:
        number: 80
  rules:
  - http:
      paths:      
      - path: /login
        pathType: Prefix
        backend:
          service:
            name: ui-service-svc
            port:
              number: 80
      - path: /user(/|$)(.*)
        pathType: Prefix
        backend:
          service:
            name: user-service-svc
            port:
              number: 80
</code></pre>

Yashvardhan Nathawat
<p><a href="https://en.wikipedia.org/wiki/Ping_(networking_utility)" rel="nofollow noreferrer">Ping</a> operates by means of Internet Control Message Protocol (ICMP) packets. This is not what your service is serving. You can try <code>curl USER-SERVICE-CLUSTER-IP/ping</code> or <code>curl http://user-service-svc/ping</code> within your UI pod.</p>
