---
kind: Ingress
apiVersion: networking.k8s.io/v1
metadata:
  name: address-australia
  namespace: address-australia
spec:
  ingressClassName: nginx
  tls:
  - hosts:
    - addressaustralia.com.au
    - www.addressaustralia.com.au
    - api.addressaustralia.com.au
    secretName: address-australia-tls
  rules:
    - host: addressaustralia.com.au
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: address-website-static
                port:
                  number: 80
    - host: www.addressaustralia.com.au
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: address-website-static
                port:
                  number: 80

    - host: addressaustralia.com.au
      http:
        paths:
          - path: /api
            pathType: Prefix
            backend:
              service:
                name: address-website-api
                port:
                  number: 8080
    - host: www.addressaustralia.com.au
      http:
        paths:
          - path: /api
            pathType: Prefix
            backend:
              service:
                name: address-website-api
                port:
                  number: 8080

    - host: api.addressaustralia.com.au
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: address-api
                port:
                  number: 8080
