<p>I am trying to create two ingress service, one which will expose the frontend to internet and 2nd which will connect backend to frontend. This is in <code>Minikube</code> and I have the <code>ingress addon</code> enabled.</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: angular-ingress
  namespace: default
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
    - host: angular.test
    - http:
        paths:
          - path: /
            pathType: Prefix  
            backend:
              service:
                name: angular-service
                port:
                  number: 8080
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: spring-ingress
  namespace: default
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
    - host: springboot.test
    - http:
        paths:
          - path: /exact/form-config/applicant/field?section=Additional%20Details&amp;page-index=1&amp;enabled-on=
            pathType: Exact
            backend:
              service:
                name: angular-service
                port:
                  number: 8080
</code></pre>
<p>I want to use the name of the backend host url in my angular application for springboot and I am want them to connect without using IP since IP are dynamic. Is this correct?</p>

<p>Given you have a service for your Angular app like this:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: Service
metadata:
  name: your-angular-app
  namespace: dev
spec:
  selector:
    app: your-angular-app
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80
      name: http
</code></pre>
<p>And a service for your Spring Boot app in the same namespace like this:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: Service
metadata:
  name: your-spring-app
  namespace: dev
spec:
  selector:
    app: your-spring-app
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80
      name: http
</code></pre>
<p>Make sure that your deployments (or whatever you use to actually create your app instances in the cluster) have matching labels. Deployment example:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: your-spring-app
  namespace: dev
spec:
  replicas: 1
  selector:
    matchLabels:
      app: your-spring-app # &lt;- this must match the spec.selector.app in the service
</code></pre>
<p>Assuming that your Spring app offers all API endpoints with the <code>/api</code> prefix, you could use an Ingress like this:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: your-ingress
  namespace: dev
spec:
  rules:
    - host: your-site.com
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: your-angular-app
                port:
                 name: http
          - path: /api
            pathType: Prefix
            backend:
              service:
                name: your-spring-app
                port:
                 name: http
</code></pre>
<p>In a cloud environment you would most likely need additional annotations on your Ingress like the Ingress class, but these information can be found in the Cloud provider's documentation.</p>
