<p>We recently upgraded to nginx-ingress 0.22. Before this upgrade, my service was using the old namespace <code>ingress.kubernetes.io/affinity: cookie</code> and everything was working as I expected. However, upon the upgrade to 0.22, affinity stopped being applied to my service (I don't see <code>sticky</code> anywhere in the nginx.conf).</p>

<p>I looked at the docs and changed the namespace to <code>nginx.ingress.kubernetes.io</code> as shown <a href="https://kubernetes.github.io/ingress-nginx/examples/affinity/cookie/" rel="nofollow noreferrer">in this example</a>, but it didn't help.</p>

<p>Is there some debug log I can look at that will show the configuration parsing/building process? My guess is that some other setting is preventing this from working (I can't imagine the k8s team shipped a release with this feature completely broken), but I'm not sure what that could be.</p>

<p>My ingress config as shown by the k8s dashboard follows:</p>

<pre><code>  "kind": "Ingress",
  "apiVersion": "extensions/v1beta1",
  "metadata": {
    "name": "example-ingress",
    "namespace": "master",
    "selfLink": "/apis/extensions/v1beta1/namespaces/master/ingresses/example-ingress",
    "uid": "01e81627-3b90-11e9-bb5a-f6bc944a4132",
    "resourceVersion": "23345275",
    "generation": 1,
    "creationTimestamp": "2019-02-28T19:35:30Z",
    "labels": {
    },
    "annotations": {
      "ingress.kubernetes.io/backend-protocol": "HTTPS",
      "ingress.kubernetes.io/limit-rps": "100",
      "ingress.kubernetes.io/proxy-body-size": "100m",
      "ingress.kubernetes.io/proxy-read-timeout": "60",
      "ingress.kubernetes.io/proxy-send-timeout": "60",
      "ingress.kubernetes.io/secure-backends": "true",
      "ingress.kubernetes.io/secure-verify-ca-secret": "example-ingress-ssl",
      "kubernetes.io/ingress.class": "nginx",
      "nginx.ingress.kubernetes.io/affinity": "cookie",
      "nginx.ingress.kubernetes.io/backend-protocol": "HTTPS",
      "nginx.ingress.kubernetes.io/limit-rps": "100",
      "nginx.ingress.kubernetes.io/proxy-body-size": "100m",
      "nginx.ingress.kubernetes.io/proxy-buffer-size": "8k",
      "nginx.ingress.kubernetes.io/proxy-read-timeout": "60",
      "nginx.ingress.kubernetes.io/proxy-send-timeout": "60",
      "nginx.ingress.kubernetes.io/secure-verify-ca-secret": "example-ingress-ssl",
      "nginx.ingress.kubernetes.io/session-cookie-expires": "172800",
      "nginx.ingress.kubernetes.io/session-cookie-max-age": "172800",
      "nginx.ingress.kubernetes.io/session-cookie-name": "route",
      "nginx.org/websocket-services": "example"
    }
  },
  "spec": {
    "tls": [
      {
        "hosts": [
          "*.example.net"
        ],
        "secretName": "example-ingress-ssl"
      }
    ],
    "rules": [
      {
        "host": "*.example.net",
        "http": {
          "paths": [
            {
              "path": "/",
              "backend": {
                "serviceName": "example",
                "servicePort": 443
              }
            }
          ]
        }
      }
    ]
  },
  "status": {
    "loadBalancer": {
      "ingress": [
        {}
      ]
    }
  }
}
</code></pre>

anisoptera
<p>As I tested Sticky session affinity with Nginx Ingress version 0.22, I can assure that it works just fine. Then when I was looking for your configuration, I  replaced wildcard host <code>host: "*.example.net"</code> with i.e <code>host: "stickyingress.example.net"</code> just to ignore wildcard, and it worked fine again. 
So after some search I found out that from this <a href="https://github.com/kubernetes/ingress-nginx/issues/3617" rel="nofollow noreferrer">issue</a></p>

<blockquote>
  <p>Wildcard hostnames are not supported by the Ingress spec (only SSL
  wildcard certificates are) </p>
</blockquote>

<p>Even this issue was opened for NGINX Ingress controller version:
0.21.0</p>
