---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-with-canary-and-sticky
  namespace: default
  annotations:
    nginx.ingress.kubernetes.io/affinity: cookie
    nginx.ingress.kubernetes.io/session-cookie-name: foobar
    nginx.ingress.kubernetes.io/session-cookie-secure: "true"
    nginx.ingress.kubernetes.io/session-cookie-path: "/foobar"
    nginx.ingress.kubernetes.io/session-cookie-domain: "foo.localhost"
    nginx.ingress.kubernetes.io/session-cookie-samesite: "None"
    nginx.ingress.kubernetes.io/session-cookie-max-age: "42"
    nginx.ingress.kubernetes.io/session-cookie-expires: "42"

spec:
  ingressClassName: nginx
  rules:
    - host: production.localhost
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: whoami
                port:
                  number: 80

---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: canary
  namespace: default
  annotations:
    nginx.ingress.kubernetes.io/canary: "true"

spec:
  ingressClassName: nginx
  rules:
    - host: production.localhost
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: canary
                port:
                  number: 80
