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