Sticky sessions

Sticky sessions, or session persistence, is when you instruct the load balancer to remain linked to a specific node (server) to avoid losing the session data if the request goes to the other server. Essentially, you send the request from a given IP to the delivery server, but continue to send follow-up requests to the same server until the session expires. Session persistence is needed when the project has transactions or required data in the session.

Sticky sessions are typically used in situations where you have some data in the session and the sessions are not replicated between servers, but you also need to ensure that the data doesn’t get lost.

For more on sticky sessions, see here.
sticky sessions majorTom

Enable sticky sessions

To enable sticky sessions:

  1. Go to your values.yml file in your Magnolia PaaS project.

  2. Set the following ingress annotations:

    ingress:
      enabled: true
      annotations:
        kubernetes.io/ingress.class: "nginx"
        nginx.ingress.kubernetes.io/proxy-body-size: 512m
        cert-manager.io/cluster-issuer: "letsencrypt-prod"
        nginx.ingress.kubernetes.io/affinity: "cookie" (1)
        nginx.ingress.kubernetes.io/affinity-mode: "persistent" (2)
        nginx.ingress.kubernetes.io/session-cookie-name: "INGRESSCOOKIE" (3)
        nginx.ingress.kubernetes.io/session-cookie-max-age: "10" (4)
        nginx.ingress.kubernetes.io/default-backend: {{ .Env.DEPLOYMENT }}-magnolia-error-page-svc
        nginx.ingress.kubernetes.io/custom-http-errors: "503"
      hosts:
        - host: {{ .Env.DEPLOYMENT }}.eu-playground.magnolia-platform.com
          paths:
              - path: /
                instance: public
              - path: /author
                instance: author
    .....
    1 Set nginx.ingress.kubernetes.io/affinity to cookie.
    2 Set nginx.ingress.kubernetes.io/affinity-mode to persistent.
    3 Put the INGRESSCOOKIE at nginx.ingress.kubernetes.io/session-cookie-name.
    4 Set nginx.ingress.kubernetes.io/session-cookie-max-age to the time (in seconds) you want the cookie to persist. After this configured time, the cookie is deleted.
Feedback

PaaS

×

Location

This widget lets you know where you are on the docs site.

You are currently perusing through the Magnolia PaaS docs.

Main doc sections

DX Core Headless PaaS Legacy Cloud Incubator modules