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

Check for invalid L7-ILB HTTPS configuration #877

Merged
merged 1 commit into from
Oct 25, 2019

Conversation

spencerhance
Copy link
Contributor

@spencerhance spencerhance commented Sep 28, 2019

Create a WillNotConfigureFrontend event warning the user if they set up an internal https ingress without the allow-http annotation set to false, since that functionality is currently not supported.

@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. labels Sep 28, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @spencerhance. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Sep 28, 2019
@spencerhance
Copy link
Contributor Author

/assign @bowei

@bowei
Copy link
Member

bowei commented Oct 7, 2019

/ok-to-test

Shouldn't there be a unit test for this?

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 7, 2019
sslConfigured := l.runtimeInfo.TLS != nil || l.runtimeInfo.TLSName != ""

// Check for invalid L7-ILB HTTPS config before attempting sync
if flags.F.EnableL7Ilb &&
Copy link
Member

Choose a reason for hiding this comment

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

put this all on a single line (no line limits for golang style)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 8, 2019
@spencerhance
Copy link
Contributor Author

@bowei added a unit test as well

@spencerhance
Copy link
Contributor Author

@bowei following up on this


// Check for invalid L7-ILB HTTPS config before attempting sync
if flags.F.EnableL7Ilb && utils.IsGCEL7ILBIngress(l.runtimeInfo.Ingress) && sslConfigured && l.runtimeInfo.AllowHTTP {
l.recorder.Eventf(l.runtimeInfo.Ingress, corev1.EventTypeWarning, "WillNotConfigureFrontend", "Will not configure frontend based on Ingress specification. 'kubernetes.io/ingress.allow-http' annotation must be false for gce-internal ingresses using HTTPS")
Copy link
Member

Choose a reason for hiding this comment

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

Make this message a bit friendlier for users:

"gce-internal Ingress class does not currently support both HTTP and HTTPS served on the same IP (kubernetes.io/ingress.allow-http must be false when using HTTPS)."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@spencerhance spencerhance force-pushed the ilb-https-check-config branch 3 times, most recently from fad0c19 to 0fd2f0e Compare October 24, 2019 07:29
@spencerhance
Copy link
Contributor Author

Fixed the prow test

Ingress: newILBIngress(),
}

_, err := j.pool.Ensure(lbInfo)
Copy link
Member

Choose a reason for hiding this comment

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

if _, err := ... ; err == nil {
t.Fatalf("j.pool.Ensure(%v) = nil, want err"...)
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Create a WillNotConfigureFrontend event warning the user if they set
up an internal https ingress without the allow-http annotation
set to false, since that functionality is currently not supported.
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 25, 2019
@bowei
Copy link
Member

bowei commented Oct 25, 2019

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bowei, spencerhance

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 25, 2019
@k8s-ci-robot k8s-ci-robot merged commit 76a509c into kubernetes:master Oct 25, 2019
@spencerhance spencerhance deleted the ilb-https-check-config branch June 29, 2020 22:19
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants