Skip to content

Commit

Permalink
[backport] feat: add annotation for FLB session sticky (#292)
Browse files Browse the repository at this point in the history
Signed-off-by: Lin Yang <[email protected]>
  • Loading branch information
reaver-flomesh committed Jul 10, 2024
1 parent 978e3a9 commit db78fad
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,9 @@ const (
// FLBLimitSyncRateAnnotation is the annotation used to indicate the limit sync rate
FLBLimitSyncRateAnnotation = FLBPrefix + "/limit-sync-rate"

// FLBSessionStickyAnnotation is the annotation used to indicate if session sticky is enabled
FLBSessionStickyAnnotation = FLBPrefix + "/session-sticky"

// FLBConfigSecretLabel is the label used to indicate the secret
FLBConfigSecretLabel = FLBPrefix + "/config"

Expand Down
1 change: 1 addition & 0 deletions pkg/controllers/flb/service_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ func (r *serviceReconciler) getFLBParameters(svc *corev1.Service) map[string]str
flbXForwardedForEnabledHeaderName: svc.Annotations[constants.FLBXForwardedForEnabledAnnotation],
flbLimitSizeHeaderName: svc.Annotations[constants.FLBLimitSizeAnnotation],
flbLimitSyncRateHeaderName: svc.Annotations[constants.FLBLimitSyncRateAnnotation],
flbSessionStickyHeaderName: svc.Annotations[constants.FLBSessionStickyAnnotation],
}

if flb.IsTLSEnabled(svc) {
Expand Down
1 change: 1 addition & 0 deletions pkg/controllers/flb/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const (
flbXForwardedForEnabledHeaderName = "X-FLB-XForwardedFor"
flbLimitSizeHeaderName = "X-FLB-Limit-Size"
flbLimitSyncRateHeaderName = "X-FLB-Limit-SyncRate"
flbSessionStickyHeaderName = "X-FLB-Sticky"
)

var (
Expand Down

0 comments on commit db78fad

Please sign in to comment.