Skip to content

GEP: Support ClientIp based session persistence #3798

@arihantg

Description

@arihantg

What would you like to be added:
SessionPersistence should support client IP address mode. With this persistence method client will stick to the same BE for the configurable duration of time (Absolutetimeout). User should have an option to set IPMask as well which can be applied on client ip to persist clients from a subnet to stick to the same BE.

2 New fields are needed

  1. IPMask should be added in SessionPersistence struct,
  2. ClientIPBasedSessionPersistence should be a new SessionPersistenceType .
type SessionPersistence struct {
	// SessionName defines the name of the persistent session token
	// which may be reflected in the cookie or the header. Users
	// should avoid reusing session names to prevent unintended
	// consequences, such as rejection or unpredictable behavior.
	//
	// Support: Implementation-specific
	//
	// +optional
	// +kubebuilder:validation:MaxLength=128
	SessionName *string `json:"sessionName,omitempty"`

        // IPMask defines the IP mask to be applied on client this may be
	// used to persist clients from a same subnet to stick to same session
	//
	// Support: Implementation-specific
	//
	// +optional
	IPMask *string `json:"ipMask,omitempty"`

}

type SessionPersistenceType string

const (
    // CookieBasedSessionPersistence specifies cookie-based session
    // persistence.
    //
    // Support: Core
    CookieBasedSessionPersistence   SessionPersistenceType = "Cookie"

    // HeaderBasedSessionPersistence specifies header-based session
    // persistence.
    //
    // Support: Extended
    HeaderBasedSessionPersistence   SessionPersistenceType = "Header"

    // ClientIPBasedSessionPersistence specifies Client IP based session
    // persistence.
    //
    // Support: Implementation-specific
    ClientIPBasedSessionPersistence   SessionPersistenceType = "ClientIP"
)

Why this is needed:
This is needed to support client Ip Persistence in centralised way across gateway implementations.

Metadata

Metadata

Assignees

Labels

kind/featureCategorizes issue or PR as related to a new feature.priority/important-soonMust be staffed and worked on either currently, or very soon, ideally in time for the next release.v1.4-release/targeting-experimentalThis issue is targeting a transition to EXPERIMENTAL as part of the v1.4 release.

Projects

Status

Proposed

Status

Next

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions