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

KEP-4939: Support TLS in gRPC probe #5029

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kkoch986
Copy link

@kkoch986 kkoch986 commented Jan 8, 2025

  • One-line PR description: Initial KEP for TLS support in gRPC probes

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory sig/node Categorizes an issue or PR as relevant to SIG Node. labels Jan 8, 2025
@k8s-ci-robot
Copy link
Contributor

Welcome @kkoch986!

It looks like this is your first PR to kubernetes/enhancements 🎉. 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/enhancements 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
Copy link
Contributor

Hi @kkoch986. 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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 8, 2025
@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jan 8, 2025
Comment on lines 239 to 240
either through providing a CA certificate from a secret
or disabling certificate verification.
Copy link
Member

Choose a reason for hiding this comment

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

we don't validate certificates with HTTPS probes, I don't feel we should add this complexity in this iteration and just make grpc probes the same as http probes

Copy link
Author

Choose a reason for hiding this comment

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

👍 that makes sense to me, just pushed up some fixups to update the KEP 09308e9

[Probe GRPCAction](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#Probe).

They can be used to indicate whether or not TLS should be used
as well as provide a reference to the certificate to use or the ability to disable verification.
Copy link
Member

Choose a reason for hiding this comment

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

+100 on supporting TLS without validation certiticates, skeptical about the ROI on adding certificate validation, I suggest moving only with one option

Copy link
Author

Choose a reason for hiding this comment

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

updated that section to remove the part about providing certs 09308e9

Comment on lines 336 to 331
If configured to to no-verify TLS:

```go
tlsConfig := &tls.Config{
InsecureSkipVerify: true,
}
tlsCredentials := credentials.NewTLS(tlsConfig)

opts := []grpc.DialOption{
// ...
grpc.WithTransportCredentials(tlsCredentials),
// ...
}
```
Copy link
Member

Choose a reason for hiding this comment

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

this seems simple to implement, the other need to deal with the input of passing certificates that will make probes more complex

Comment on lines 25 to 31
latest-milestone: "v1.19"

# The milestone at which this feature was, or is targeted to be, at each stage.
milestone:
alpha: "v1.19"
beta: "v1.20"
stable: "v1.22"
Copy link
Member

Choose a reason for hiding this comment

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

I assume this is copy and paste

Copy link
Author

Choose a reason for hiding this comment

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

yea i wasnt 100% sure what to put in there, for now just updated this to 1.33 although since this is my first contribution may take me some more time to actually implement 😄

09308e9

- "@kkoch986"
owning-sig: sig-node
participating-sigs:
- sig-node
Copy link
Member

Choose a reason for hiding this comment

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

you can add sig-network as participating and enlist me as reviewer

Copy link
Author

@kkoch986 kkoch986 Jan 9, 2025

Choose a reason for hiding this comment

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

done, thanks! i pushed up some fixups so its easier to see the changes, i can rebase once everything is looking good

@aojea
Copy link
Member

aojea commented Jan 9, 2025

/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 Jan 9, 2025
@kkoch986 kkoch986 requested a review from aojea January 9, 2025 14:25
@kkoch986
Copy link
Author

kkoch986 commented Jan 30, 2025

pushed up one more fixup to define the config option better. @aojea any other changes i should make to get this KEP merged?

@aojea
Copy link
Member

aojea commented Jan 30, 2025

/lgtm

I think that not having a TLS option reduce significantly the usability of this probes and is worth having parity with the http probes, also the changes requested seem to be very minimal, please @bowei take a look as you were involved with the original implementation so you may have some more historic context

/assign @thockin @dchen1107

for approval

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 30, 2025
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 30, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: kkoch986
Once this PR has been reviewed and has the lgtm label, please ask for approval from dchen1107. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@kkoch986
Copy link
Author

oops @aojea looks like when i rebased it removed the lgtm tag sorry about that, didnt change anything just squashed the fixups down

@aojea
Copy link
Member

aojea commented Jan 30, 2025

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 30, 2025
Copy link
Member

@thockin thockin left a comment

Choose a reason for hiding this comment

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

FTR: I am reading this for API review in particular, but will hold my API comments until @bowei


They can be used to indicate whether or not TLS should be used.

### User Stories (Optional)
Copy link
Member

Choose a reason for hiding this comment

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

Either fill these optional section in or remove them :)

[testing-guidelines]: https://git.k8s.io/community/contributors/devel/sig-testing/testing.md
-->

[ ] I/we understand the owners of the involved components may require updates to
Copy link
Member

Choose a reason for hiding this comment

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

you gotta check the box :) It's like your bank's EULA - what are you going to do, not sign it?

implementing this enhancement to ensure the enhancements have also solid foundations.
-->

##### Unit tests
Copy link
Member

Choose a reason for hiding this comment

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

please describe the tests you think will be needed. Take a look at nearby tests and see how you would extend them - unit seems obvious, maybe node_e2e is sufficient?


- <test>: <link to test coverage>

### Graduation Criteria
Copy link
Member

Choose a reason for hiding this comment

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

Please fill in the rest of the doc.

reviewers:
- aojea
approvers:
- TBD
Copy link
Member

Choose a reason for hiding this comment

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

@SergeyKanzhelev @dchen1107 @mrunalp can you suggest an approver?

@bowei
Copy link
Member

bowei commented Jan 30, 2025

Antonio probably did the heavy lifting here. I didn't find much other than some prods filling out the testing and production related templates. Thanks!


### Test Plan

<!--
Copy link
Member

Choose a reason for hiding this comment

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

It would be good to spec out what tests you plan on adding -- probably mirror those already done for gRPC.


We should add a boolean field to the
[GRPCAction](https://github.com/kubernetes/kubernetes/blob/f422a58398d457a88ac7b05afca85a0e6b805605/pkg/apis/core/types.go#L2665-L2676)
named `useTLS` which is optional and would default to `false`.
Copy link
Member

Choose a reason for hiding this comment

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

Proposal looks generally OK.

There are couple of things. Note: I don't think these will change the general design and KEP:

  • In HTTP, we chose based on scheme, but it looks like gRPC does not have such a notion exposed, so there is no need to push for consistency in naming there.
  • gRPC over QUIC only works with TLS. This means if/when we support gRPC over HTTP/3, this will require adding some validation that UseTLS is true.


### Graduation Criteria

<!--
Copy link
Member

Choose a reason for hiding this comment

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

Please fill this out -- you can use the original gRPC probe KEP as a reference.


## Production Readiness Review Questionnaire

<!--
Copy link
Member

Choose a reason for hiding this comment

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

Make sure to get a PRR review.

-->

We should add a boolean field to the
[GRPCAction](https://github.com/kubernetes/kubernetes/blob/f422a58398d457a88ac7b05afca85a0e6b805605/pkg/apis/core/types.go#L2665-L2676)
Copy link
Member

Choose a reason for hiding this comment

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

Boolean flags are generally a bad idea. They almost always end up insufficient. For example, I can imagine a future where someone wants to do secure verification against a known CA or set of CAs. Perhaps they load a volume with their CA's pubkey or something.

In this particular case it doesn't seem terrible, it's just hard to know what we don't know.

For example, this could evolve to:

grpcAction:
    port: 12345
    useTLS: true
    tlsConfig:
      mode: Verify
      certVolume: my-certs

But let's consider options. What if this was instead framed as:

grpcAction:
    port: 12345
    tls:
        mode: NoVerify

The existence of the tls field implies a demand for TLS. The mode only has one value, so it's optional. People could write: tls: {}

It's not markedly better, so I'm not demanding it (yet?).

Are there ANY OTHER configuration knobs we want in the short term?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory 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. sig/node Categorizes an issue or PR as relevant to SIG Node. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
Status: Pre-Alpha
Development

Successfully merging this pull request may close these issues.

6 participants