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-target-url annotation will redirect any traffic for "http://foo.com/foo" to "bar.com/bar"
    virtual-server.f5.com/rewrite-target-url: foo.com/foo=bar.com/bar,bar.com/bar=foo.com/foo
  name: sample-url-rewrite-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: /foo
            pathType: ImplementationSpecific
    - host: bar.com
      http:
        paths:
          - backend:
              service:
                name: svc-2
                port:
                  number: 80
            path: /bar
            pathType: ImplementationSpecific
