apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/use-regex: "true"
  name: ingress-service
  labels:
    name: ingress-service
spec:
  rules:
    - host: posts.com
      http:
        paths:
          - pathType: Prefix
            path: "/posts/create"
            backend:
              service:
                name: posts-clusterip-service
                port:
                  number: 4000
          - pathType: Prefix
            path: "/posts"
            backend:
              service:
                name: query-clusterip-service
                port:
                  number: 4003
          - pathType: Prefix
            path: "/posts/?(.*)/comments"
            backend:
              service:
                name: comments-clusterip-service
                port:
                  number: 4001
          - pathType: Prefix
            path: "/?(.*)"
            backend:
              service:
                name: client-clusterip-service
                port:
                  number: 3000
