apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    # Provide an IP address for the BIG-IP Virtual Server.
    virtual-server.f5.com/ip: 10.8.3.19
    # rewrite-app-root annotation will redirect any traffic for root path(http://foo.com/) to path(https://foo.com/approot1)
    virtual-server.f5.com/rewrite-app-root: foo.com=/approot1,bar.com=/approot2
  name: sample-app-root-ingress
  namespace: default
spec:
  # Provide the IngressClassName as "f5"
  ingressClassName: f5
  rules:
    - host: foo.com
      http:
        paths:
          - backend:
              service:
                name: svc-1
                port:
                  number: 80
            path: /approot1
            pathType: ImplementationSpecific
    - host: bar.com
      http:
        paths:
          - backend:
              service:
                name: svc-2
                port:
                  number: 80
            path: /approot2
            pathType: ImplementationSpecific
