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

Canary Ingress weight with cookie in response for sticky session #12444

Open
itsstefanpopov opened this issue Dec 6, 2024 · 3 comments
Open
Labels
kind/support Categorizes issue or PR as a support question. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@itsstefanpopov
Copy link

We had an idea to implement canary deployments while using sticky session so, for instance, 20% of our traffic uses canary while the others use 80%, all the while these requests stick with the initial behaviour, meaning if a request went to the canary deployment the first time, we want it there again and again.
Now I have tried setting this by using the file attached below, as the session-cookie-name should write a cookie in the response (i.e. enabling the stickiness) and the canary annotations should just recognize the cookie set before, while the weight is set to 20 so that at first we have 20% of the traffic routed to the canary
`apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
namespace: test
annotations:
name: ingress-echo
spec:
ingressClassName: nginx
rules:

  • host: canary.example.com
    http:
    paths:

  • path: /echo
    pathType: Exact
    backend:
    service:
    name: echo-v1
    port:
    number: 8080
    tls:

    hosts:
    canary.example.com
    secretName: ingress-echo-tls

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
namespace: test
annotations:
nginx.ingress.kubernetes.io/affinity: "cookie"
nginx.ingress.kubernetes.io/session-cookie-name: "http-cookie"
nginx.ingress.kubernetes.io/session-cookie-expires: "172800"
nginx.ingress.kubernetes.io/session-cookie-max-age: "172800"
nginx.ingress.kubernetes.io/canary: "true"
nginx.ingress.kubernetes.io/canary-weight: "20"
name: ingress-echo-canary-cookie
spec:
ingressClassName: nginx
rules:

  • host: canary.example.com
    http:
    paths:

  • path: /echo
    pathType: Exact
    backend:
    service:
    name: echo-v2
    port:
    number: 8080
    tls:

    hosts:
    canary.example.cloud
    secretName: ingress-echo-canary-cookie-tls`

@itsstefanpopov itsstefanpopov added the kind/bug Categorizes issue or PR as related to a bug. label Dec 6, 2024
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Dec 6, 2024
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If Ingress contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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-sigs/prow repository.

@longwuyuan
Copy link
Contributor

/remove-kind bug

@itsstefanpopov if someone else has to reproduce this or compare their tests to yours, then the information you have posted is only a hint and not a real proof for real testing.

If you look at the template of a new bug report, you will see questions. If you edit the issue description of this issue and answer those questions, in markdown format, it will help.

If you actually provide step by step instructions to copy/paste into a kind cluster, it will help. Somoene can copy/paste from your tests and compare your results with the results with their tests.

@k8s-ci-robot k8s-ci-robot added needs-kind Indicates a PR lacks a `kind/foo` label and requires one. and removed kind/bug Categorizes issue or PR as related to a bug. labels Dec 6, 2024
@longwuyuan
Copy link
Contributor

/kind support

@k8s-ci-robot k8s-ci-robot added kind/support Categorizes issue or PR as a support question. and removed needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/support Categorizes issue or PR as a support question. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
Development

No branches or pull requests

3 participants