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

BackendConfig support for session affinity #526

Merged
merged 4 commits into from
Oct 29, 2018
Merged

BackendConfig support for session affinity #526

merged 4 commits into from
Oct 29, 2018

Conversation

bpineau
Copy link
Contributor

@bpineau bpineau commented Oct 25, 2018

Allow user provided session affinity type and ttl.

Sending e2e/fuzz tests on a distinct PR.

Allow user provided session affinity type and ttl.

Sending e2e/fuzz tests on a distinct PR.
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 25, 2018
Copy link
Contributor

@rramkumar1 rramkumar1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the work!

TimeoutSec *int64 `json:"timeoutSec,omitempty"`
ConnectionDraining *ConnectionDrainingConfig `json:"connectionDraining,omitempty"`
AffinityCookieTtlSec *int64 `json:"affinityCookieTtlSec,omitempty"`
SessionAffinity string `json:"sessionAffinity,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we encapsulate these settings in a struct? Something like this:

type SessionAffinityConfig struct {
SessionAffinityType string
AffinityCookieTtlSec *int64
}

pkg/apis/backendconfig/v1beta1/types.go Show resolved Hide resolved

// Should we check if specified SessionAffinity is among the currently GCP supported values?
// For now let's forward as is to GCP, to inherit API error message (and evolutions).
// Same for TTL (should be in 0-86400 range).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add this validation to pkg/backendconfig/validation.go?

That way, we can give feedback to the user before the LB starts to get created.

@MrHohn
Copy link
Member

MrHohn commented Oct 25, 2018

/ok-to-test

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Oct 25, 2018

if beConfig.Spec.SessionAffinity.AffinityType != "" {
if _, ok := supportedAffinities[beConfig.Spec.SessionAffinity.AffinityType]; !ok {
return fmt.Errorf("unsupported AffinityType: %s, sould be one of NONE, CLIENT_IP, or GENERATED_COOKIE",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should


if beConfig.Spec.SessionAffinity.AffinityCookieTtlSec != nil {
if *beConfig.Spec.SessionAffinity.AffinityCookieTtlSec < 0 || *beConfig.Spec.SessionAffinity.AffinityCookieTtlSec > 86400 {
return fmt.Errorf("unsupported AffinityCookieTtlSec: %d, should be comprised between 0 and 86400",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this word

pkg/backendconfig/validation.go Show resolved Hide resolved
pkg/backends/features/affinity.go Show resolved Hide resolved
@rramkumar1
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 29, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bpineau, rramkumar1

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 29, 2018
@k8s-ci-robot k8s-ci-robot merged commit d379563 into kubernetes:master Oct 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants