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

feat: support to configure multiple certificates on GatewayTLSConfig #852

Merged

Conversation

tokers
Copy link
Contributor

@tokers tokers commented Sep 7, 2021

What type of PR is this?

/kind feature

What this PR does / why we need it:

This PR uses CertificateRefs to instead CertificateRef so that multiple certificates can be configured for a Listener. With this feature, we can support things like following items:

  • When hostname is empty on the Listener, and Routes attach multiple unique Hostnames
  • Providing RSA and EC certs
  • Temporarily including new and old certs during an upgrade

Which issue(s) this PR fixes:

Fixes #851

Does this PR introduce a user-facing change?:

Use `CertificateRefs` field to instead the `CertificateRef` in `GatewayTLSConfig`.

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Sep 7, 2021
@k8s-ci-robot
Copy link
Contributor

Welcome @tokers!

It looks like this is your first PR to kubernetes-sigs/gateway-api 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/gateway-api has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 7, 2021
@k8s-ci-robot
Copy link
Contributor

Hi @tokers. Thanks for your PR.

I'm waiting for a kubernetes-sigs 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.

@tokers tokers changed the title feature: support to configure multiple certificates on GatewayTLSConfig feat: support to configure multiple certificates on GatewayTLSConfig Sep 7, 2021
Copy link
Contributor

@howardjohn howardjohn left a comment

Choose a reason for hiding this comment

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

Can we define the behavior when there are multiple?

@robscott
Copy link
Member

robscott commented Sep 7, 2021

I think this one is likely sufficiently complex that we'll need a GEP first, I created #851 to track that, will try to get a GEP PR out later today. I can add some details on how multiple should be handled there.

@robscott
Copy link
Member

robscott commented Sep 7, 2021

Adding a hold until GEP is approved.

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 7, 2021
@tokers
Copy link
Contributor Author

tokers commented Sep 8, 2021

I think this one is likely sufficiently complex that we'll need a GEP first, I created #851 to track that, will try to get a GEP PR out later today. I can add some details on how multiple should be handled there.

Cool, look forward to it.

@robscott
Copy link
Member

robscott commented Sep 8, 2021

Update: I've opened #856 to introduce a GEP for this. Once that merges in, we can remove the hold here.

@robscott
Copy link
Member

Are you still able to take this on @tokers? Would love to get this in in the next couple of days. If you're not able to, I'm happy to take this on.

@tokers
Copy link
Contributor Author

tokers commented Sep 23, 2021

Are you still able to take this on @tokers? Would love to get this in in the next couple of days. If you're not able to, I'm happy to take this on.

Yeah, I still focus on this.

Copy link
Member

@robscott robscott 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 on this @tokers! This mostly LGTM, just had a few nits. I think the k8s automation will complain about merge commits in this PR - please rebase and squash your commits when you get a chance.

apis/v1alpha2/gateway_types.go Outdated Show resolved Hide resolved
apis/v1alpha2/gateway_types.go Outdated Show resolved Hide resolved
apis/v1alpha2/gateway_types.go Outdated Show resolved Hide resolved
@robscott
Copy link
Member

/ok-to-test

@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 Sep 24, 2021
@robscott
Copy link
Member

One more thing that's difficult to comment on in the diff - as part of this change you'll also need to update the TLS examples in the examples/v1alpha2 directory.

@tokers
Copy link
Contributor Author

tokers commented Sep 24, 2021

Thanks for the work on this @tokers! This mostly LGTM, just had a few nits. I think the k8s automation will complain about merge commits in this PR - please rebase and squash your commits when you get a chance.

OK, I rebased all the commits.

Copy link
Member

@robscott robscott left a comment

Choose a reason for hiding this comment

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

Thanks @tokers! I think you need to run make generate again, I can add a LGTM after that.

/approve

// Listener has a TLS configuration with a TLS CertificateRef
// that is invalid or cannot be resolved.
// Listener has a TLS configuration with at least one TLS CertificateRef
// that are invalid or cannot be resolved.
Copy link
Member

Choose a reason for hiding this comment

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

Nit: I think this should still be "is"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's right, let me tweak it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: robscott, tokers

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 Sep 24, 2021
@tokers tokers force-pushed the feat/multi-certs-on-listener branch 2 times, most recently from b39dbf1 to e7d51ed Compare September 24, 2021 09:44
@tokers
Copy link
Contributor Author

tokers commented Sep 24, 2021

/test pull-gateway-api-verify

@hbagdi
Copy link
Contributor

hbagdi commented Sep 24, 2021

@tokers Can you run make generate to fix the CI error?

@tokers
Copy link
Contributor Author

tokers commented Sep 26, 2021

@tokers Can you run make generate to fix the CI error?

Sorry for the delay, I will fix the CI errors today.

@tokers
Copy link
Contributor Author

tokers commented Sep 26, 2021

@tokers Can you run make generate to fix the CI error?

Sorry for the delay, I will fix the CI errors today.

It seems that this is due to the version of go language (the go:build flags and +build flags), I ran make generate on my local for several times but no changes happened.

@tokers
Copy link
Contributor Author

tokers commented Sep 26, 2021

@tokers Can you run make generate to fix the CI error?

Sorry for the delay, I will fix the CI errors today.

It seems that this is due to the version of go language (the go:build flags and +build flags), I ran make generate on my local for several times but no changes happened.

What's the go version in the CI? Maybe I can try to switch to that one and re-execute the make generate directive.

@robscott
Copy link
Member

Thanks!

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 27, 2021
@robscott
Copy link
Member

Hold was waiting for GEP to be approved, which happened ~weeks ago.

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 27, 2021
@k8s-ci-robot k8s-ci-robot merged commit 0df0f34 into kubernetes-sigs:master Sep 27, 2021
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. kind/feature Categorizes issue or PR as related to a new feature. 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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GEP: Allow Multiple Certificate Refs per Gateway Listener
5 participants