apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: myapp-ingress
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
  rules:
  # - host: localhost
    - http:
        paths:
        - path: "/api/(.*)"
          pathType: Prefix
          backend:
            service:
              name: mybackendlb-clusterip
              port: 
                number: 5000
        - path: "/(.*)"
          pathType: Prefix
          backend:
            service:
              name: myfrontend-clusterip
              port: 
                number: 3000




# apiVersion: networking.k8s.io/v1
# kind: Ingress
# metadata:
#   name: myapp-ingress
#   annotations:
#     kubernetes.io/ingress.class: nginx
#     nginx.ingress.kubernetes.io/rewrite-target: /$1
  
# spec:
#   rules:
#     - http:
#         paths: 
#           - path: /api/(.*)
#             pathType: Prefix
#             backend: 
#               service:
#                 name: newbackend-clusterip
#                 port:
#                   number: 5000
#           - path: /(.*)
#             pathType: Prefix
#             backend: 
#               service:
#                 name: my-nginx-clusterip
#                 port:
#                   number: 80