apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: voting-app-stack-ingress
  namespace: voting-app-stack
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:  
  rules:
    - host: result.votingapp.com
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: result-app-service
                port:
                  number: 80
    - host: vote.votingapp.com
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: voting-app-service
                port:
                  number: 80