title: Accessing application inside a kubernetes pod from an another application in a different pod
body: <p>I have a kubernetes cluster having two deployments ui-service-app and user-service-app. Both of the deployments are exposed through Cluster IP services namely ui-service-svc and user-service-svc. In addition there is a Ingress for accessing both of my applications inside those deployments from outside the cluster.</p>
  <p>Now I want to make a api call from my application inside ui-service-app to user-service-app. Currently I am using the ingress-ip/user to do so. But there should be some way to do this internally?</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>
  <p>UPDATE 1:
  <a href="https://i.stack.imgur.com/R9oET.jpg" rel="nofollow noreferrer">THIS IS THE ERROR PAGE WHEN I CHANGE THE URL IN REACT APP TO HTTP://USER-SERVICE-SVC</a></p>