Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sticky session annotation cross-affecting ingresses #3168

Closed
michaelgeorgeattard opened this issue Oct 2, 2018 · 3 comments
Closed

Sticky session annotation cross-affecting ingresses #3168

michaelgeorgeattard opened this issue Oct 2, 2018 · 3 comments

Comments

@michaelgeorgeattard
Copy link

michaelgeorgeattard commented Oct 2, 2018

Is this a request for help? (If yes, you should use our troubleshooting guide and community support channels, see https://kubernetes.io/docs/tasks/debug-application-cluster/troubleshooting/.):

What keywords did you search in NGINX Ingress controller issues before filing this one? (If you have found any duplicates, you should instead reply there.):


Is this a BUG REPORT or FEATURE REQUEST? (choose one): BUG REPORT

NGINX Ingress controller version: 0.19.0

Kubernetes version (use kubectl version): v1.10.7

Environment:

  • Cloud provider or hardware configuration: AWS
  • OS (e.g. from /etc/os-release):
  • Kernel (e.g. uname -a):
  • Install tools:
  • Others:

What happened:

We have two ingresses, one with sticky session annotations, one without:

{
  "kind": "Ingress",
  "apiVersion": "extensions/v1beta1",
  "metadata": {
    "name": "one",
    "annotations": {
      "nginx.ingress.kubernetes.io/rewrite-target": "/"
    }
  },
  "spec": {
    "rules": [
      {
        "host": "foo.bar.com",
        "http": {
          "paths": [
            {
              "path": "/common/v1",
              "backend": {
                "serviceName": "service-a",
                "servicePort": 1002
              }
            }
          ]
        }
      }
    ]
  }
}
{
  "kind": "Ingress",
  "apiVersion": "extensions/v1beta1",
  "metadata": {
    "name": "two",
    "annotations": {
      "nginx.ingress.kubernetes.io/affinity": "cookie",
      "nginx.ingress.kubernetes.io/rewrite-target": "/real-time",
      "nginx.ingress.kubernetes.io/session-cookie-hash": "sha1",
      "nginx.ingress.kubernetes.io/session-cookie-name": "sticky"
    }
  },
  "spec": {
    "rules": [
      {
        "host": "foo.bar.com",
        "http": {
          "paths": [
            {
              "path": "/common/v1/real-time",
              "backend": {
                "serviceName": "service-a",
                "servicePort": 1002
              }
            }
          ]
        }
      }
    ]
  }
}

Both curl foo.bar.com/common/v1 and curl foo.bar.com/common/v1/real-time show Set-Cookie: sticky=3bda432b6d65261863c79208ea1c156652e905a7; Domain=foo.bar.com; Path=/; HttpOnly

What you expected to happen:

Only curl foo.bar.com/common/v1/real-time should apply the sticky cookie.

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know:

Looks like stick annotations are per service rather then per ingress.

@michaelgeorgeattard
Copy link
Author

michaelgeorgeattard commented Oct 2, 2018

Fixed temporarily by targeting separate (cloned) services by the two ingresses.

@ElvinEfendi
Copy link
Member

Please use https://github.com/kubernetes/ingress-nginx/releases/tag/nginx-0.21.0 - this should be fixed in that version.

/close

@k8s-ci-robot
Copy link
Contributor

@ElvinEfendi: Closing this issue.

In response to this:

Please use https://github.com/kubernetes/ingress-nginx/releases/tag/nginx-0.21.0 - this should be fixed in that version.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants