diff --git a/keps/sig-node/4939-tls-in-grpc-probe/README.md b/keps/sig-node/4939-tls-in-grpc-probe/README.md new file mode 100644 index 00000000000..0b6216f4035 --- /dev/null +++ b/keps/sig-node/4939-tls-in-grpc-probe/README.md @@ -0,0 +1,880 @@ + +# KEP-4939: Support TLS in GRPC Probe + + + + +- [Release Signoff Checklist](#release-signoff-checklist) +- [Summary](#summary) +- [Motivation](#motivation) + - [Goals](#goals) + - [Non-Goals](#non-goals) +- [Proposal](#proposal) + - [User Stories (Optional)](#user-stories-optional) + - [Notes/Constraints/Caveats (Optional)](#notesconstraintscaveats-optional) + - [Risks and Mitigations](#risks-and-mitigations) +- [Design Details](#design-details) + - [Test Plan](#test-plan) + - [Prerequisite testing updates](#prerequisite-testing-updates) + - [Unit tests](#unit-tests) + - [Integration tests](#integration-tests) + - [e2e tests](#e2e-tests) + - [Graduation Criteria](#graduation-criteria) + - [Upgrade / Downgrade Strategy](#upgrade--downgrade-strategy) + - [Version Skew Strategy](#version-skew-strategy) +- [Production Readiness Review Questionnaire](#production-readiness-review-questionnaire) + - [Feature Enablement and Rollback](#feature-enablement-and-rollback) + - [Rollout, Upgrade and Rollback Planning](#rollout-upgrade-and-rollback-planning) + - [Monitoring Requirements](#monitoring-requirements) + - [Dependencies](#dependencies) + - [Scalability](#scalability) + - [Troubleshooting](#troubleshooting) +- [Implementation History](#implementation-history) +- [Drawbacks](#drawbacks) +- [Alternatives](#alternatives) +- [Infrastructure Needed (Optional)](#infrastructure-needed-optional) + + +## Release Signoff Checklist + + + +Items marked with (R) are required *prior to targeting to a milestone / release*. + +- [ ] (R) Enhancement issue in release milestone, which links to KEP dir in [kubernetes/enhancements] (not the initial KEP PR) +- [ ] (R) KEP approvers have approved the KEP status as `implementable` +- [ ] (R) Design details are appropriately documented +- [ ] (R) Test plan is in place, giving consideration to SIG Architecture and SIG Testing input (including test refactors) + - [ ] e2e Tests for all Beta API Operations (endpoints) + - [ ] (R) Ensure GA e2e tests meet requirements for [Conformance Tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/conformance-tests.md) + - [ ] (R) Minimum Two Week Window for GA e2e tests to prove flake free +- [ ] (R) Graduation criteria is in place + - [ ] (R) [all GA Endpoints](https://github.com/kubernetes/community/pull/1806) must be hit by [Conformance Tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/conformance-tests.md) +- [ ] (R) Production readiness review completed +- [ ] (R) Production readiness review approved +- [ ] "Implementation History" section is up-to-date for milestone +- [ ] User-facing documentation has been created in [kubernetes/website], for publication to [kubernetes.io] +- [ ] Supporting documentation—e.g., additional design documents, links to mailing list discussions/SIG meetings, relevant PRs/issues, release notes + + + +[kubernetes.io]: https://kubernetes.io/ +[kubernetes/enhancements]: https://git.k8s.io/enhancements +[kubernetes/kubernetes]: https://git.k8s.io/kubernetes +[kubernetes/website]: https://git.k8s.io/website + +## Summary + + + +The new gRPC health probe enables developers to probe +[gRPC health servers](https://github.com/grpc-ecosystem/grpc-health-probe) +from the node. +This allows them to stop using workarounds such as this +[grpc-health-probe](https://github.com/grpc-ecosystem/grpc-health-probe) +paired with `exec` probes. + +It allows natively running health checks on gRPC services +without deploying additional binaries as well as other benefits +outlined in [the announcement](https://kubernetes.io/blog/2022/05/13/grpc-probes-now-in-beta/). + +A limitation in the current implementation is that it only supports +gRPC servers that do not leverage TLS connections. +Even if they are not concerned about certificate verification for the health check, +a connection cannot be established at all if the server is expecting TLS and the client +is not. + +This enhancement aims to add configuration options to enable TLS on the gRPC probe. + +## Motivation + + + +We often deploy internal gRPC services on our cluster. +These deployments provide internal services and it's simple to add +the health server to them so they can be verified through a single interface. + +It's also worth noting we have and internal CA that signs certs for communicating +with these servers and all of them use TLS. + +Currently, we are using the `exec` probe for readiness and liveness configured as: + +``` +liveness_probe { + exec { + command = [ + "/bin/grpc_health_probe", + "-addr=:8443", + "-tls", + "-tls-no-verify", + ] + } +} +``` + +We would really like to switch to the gRPC probes introduced in 1.24 +but are unable to do so since there is no way to configure it to use a TLS connection +when reaching out to the health server. + +Instead we must continue to rely on the `exec` probe and cannot reap the benefits +described in [the announcement](https://kubernetes.io/blog/2022/05/13/grpc-probes-now-in-beta/). + + +### Goals + + + +The primary goal is to support TLS connections when using the `grpc` probe. +The probe will use TLS but not verify the certificate. + +### Non-Goals + + + +It is not a goal of this KEP to support providing a certificate to verify the TLS +connection. + +## Proposal + + + +I would like to add new configuration fields alongside `port` and `service` in the +[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. + +### User Stories (Optional) + + + + +### Notes/Constraints/Caveats (Optional) + + + +### Risks and Mitigations + + + +1. Adds more code to Kubelet and surface area to `Pod.Spec` + +## Design Details + + + +Looking for feedback on how to structure the configuration fields. +I have however identified the relevant code changes once the configuration +structure is hammered out. + +Currently, the gRPC probe uses `insecure.NewCredentials()` when +[establishing the connection](https://github.com/kubernetes/kubernetes/blob/d9441212d3e11dc13198f9d4df273c3555ecad11/pkg/probe/grpc/grpc.go#L59). + +If configured to use TLS, that `DialOption` should be replaced with: + +```go +tlsConfig := &tls.Config{ + InsecureSkipVerify: true, +} +tlsCredentials := credentials.NewTLS(tlsConfig) + +opts := []grpc.DialOption{ + // ... + grpc.WithTransportCredentials(tlsCredentials), + // ... +} +``` + +### Test Plan + + + +[ ] I/we understand the owners of the involved components may require updates to +existing tests to make this code solid enough prior to committing the changes necessary +to implement this enhancement. + +##### Prerequisite testing updates + + + +##### Unit tests + + + + + +- ``: `` - `` + +##### Integration tests + + + + + +- : + +##### e2e tests + + + +- : + +### Graduation Criteria + + + +### Upgrade / Downgrade Strategy + + + +### Version Skew Strategy + + + +## Production Readiness Review Questionnaire + + + +### Feature Enablement and Rollback + + + +###### How can this feature be enabled / disabled in a live cluster? + + + +- [ ] Feature gate (also fill in values in `kep.yaml`) + - Feature gate name: + - Components depending on the feature gate: +- [ ] Other + - Describe the mechanism: + - Will enabling / disabling the feature require downtime of the control + plane? + - Will enabling / disabling the feature require downtime or reprovisioning + of a node? + +###### Does enabling the feature change any default behavior? + + + +###### Can the feature be disabled once it has been enabled (i.e. can we roll back the enablement)? + + + +###### What happens if we reenable the feature if it was previously rolled back? + +###### Are there any tests for feature enablement/disablement? + + + +### Rollout, Upgrade and Rollback Planning + + + +###### How can a rollout or rollback fail? Can it impact already running workloads? + + + +###### What specific metrics should inform a rollback? + + + +###### Were upgrade and rollback tested? Was the upgrade->downgrade->upgrade path tested? + + + +###### Is the rollout accompanied by any deprecations and/or removals of features, APIs, fields of API types, flags, etc.? + + + +### Monitoring Requirements + + + +###### How can an operator determine if the feature is in use by workloads? + + + +###### How can someone using this feature know that it is working for their instance? + + + +- [ ] Events + - Event Reason: +- [ ] API .status + - Condition name: + - Other field: +- [ ] Other (treat as last resort) + - Details: + +###### What are the reasonable SLOs (Service Level Objectives) for the enhancement? + + + +###### What are the SLIs (Service Level Indicators) an operator can use to determine the health of the service? + + + +- [ ] Metrics + - Metric name: + - [Optional] Aggregation method: + - Components exposing the metric: +- [ ] Other (treat as last resort) + - Details: + +###### Are there any missing metrics that would be useful to have to improve observability of this feature? + + + +### Dependencies + + + +###### Does this feature depend on any specific services running in the cluster? + + + +### Scalability + + + +###### Will enabling / using this feature result in any new API calls? + + + +###### Will enabling / using this feature result in introducing new API types? + + + +###### Will enabling / using this feature result in any new calls to the cloud provider? + + + +###### Will enabling / using this feature result in increasing size or count of the existing API objects? + + + +###### Will enabling / using this feature result in increasing time taken by any operations covered by existing SLIs/SLOs? + + + +###### Will enabling / using this feature result in non-negligible increase of resource usage (CPU, RAM, disk, IO, ...) in any components? + + + +###### Can enabling / using this feature result in resource exhaustion of some node resources (PIDs, sockets, inodes, etc.)? + + + +### Troubleshooting + + + +###### How does this feature react if the API server and/or etcd is unavailable? + +###### What are other known failure modes? + + + +###### What steps should be taken if SLOs are not being met to determine the problem? + +## Implementation History + + + +## Drawbacks + + + +## Alternatives + + + +## Infrastructure Needed (Optional) + + diff --git a/keps/sig-node/4939-tls-in-grpc-probe/kep.yaml b/keps/sig-node/4939-tls-in-grpc-probe/kep.yaml new file mode 100644 index 00000000000..b23a9139351 --- /dev/null +++ b/keps/sig-node/4939-tls-in-grpc-probe/kep.yaml @@ -0,0 +1,43 @@ +title: TLS in gRPC Probe +kep-number: 4939 +authors: + - "@kkoch986" +owning-sig: sig-node +participating-sigs: + - sig-node + - sig-network +status: provisional +creation-date: 2025-01-08 +reviewers: + - aojea +approvers: + - TBD + +see-also: + - "/keps/sig-node/2727-grpc-probe" +replaces: + +# The target maturity stage in the current dev cycle for this KEP. +stage: alpha + +# The most recent milestone for which work toward delivery of this KEP has been +# done. This can be the current (upcoming) milestone, if it is being actively +# worked on. +latest-milestone: "v1.33" + +# The milestone at which this feature was, or is targeted to be, at each stage. +milestone: + alpha: "v1.33" + +# The following PRR answers are required at alpha release +# List the feature gate name and the components for which it must be enabled +# feature-gates: +# - name: MyFeature +# components: +# - kube-apiserver +# - kube-controller-manager +# disable-supported: true + +# The following PRR answers are required at beta release +# metrics: +# - my_feature_metric