diff --git a/keps/sig-network/5311-relaxed-validation-for-service-names/README.md b/keps/sig-network/5311-relaxed-validation-for-service-names/README.md new file mode 100644 index 00000000000..c8db605762d --- /dev/null +++ b/keps/sig-network/5311-relaxed-validation-for-service-names/README.md @@ -0,0 +1,761 @@ + +# KEP-5311: Relaxed validation for Services names + + + + + + +- [Release Signoff Checklist](#release-signoff-checklist) +- [Summary](#summary) +- [Motivation](#motivation) + - [Goals](#goals) + - [Non-Goals](#non-goals) +- [Proposal](#proposal) + - [User Stories (Optional)](#user-stories-optional) + - [Story 1](#story-1) + - [Story 2](#story-2) + - [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 + +This KEP proposes a relaxation of the Service name in order bring it in line +with the validation requirements of other resources in Kubernetes. +It aims to change the validation from RFC-1035 to RFC-1123. + +## Motivation + +At time of writing, Service name validation is stricter than most of the other Kubernetes resources. +By losening the validation of Services, this allows users to name their Services with the same conventions +as other of their resources. +Additionally, it simplifies the Kubernetes code base slightly, by removing the `NameIsDNS1035Label` validation, +which is only used by Service names. + +### Goals + +- Allow Service names to be created using RFC-1123 validation + +### Non-Goals + +- Change validation for other Kubernetes resource types + +## Proposal + +At time of writing Service names are validated with `apimachineryvalidation.NameIsDNS1035Label`. +The proposal is to change this validation to `apimachineryvalidation.NameIsDNSSubdomain`. + +### User Stories (Optional) + + + +#### Story 1 + +As a user, I want to name my Deployment "12345", and I'd like a Service and Ingress object to match that name. + +### Notes/Constraints/Caveats (Optional) + + + +### Risks and Mitigations + + + +1. Services are responsible for creating DNS records (ie: `..svc.cluster.local>`). To confirm that downstream systems will support the new validation, we will conduct compatibility testing by: + - Verifying that DNS providers used in Kubernetes clusters can handle the new service name format. + - Running integration tests to ensure that dependent components such as Ingress controllers and service discovery mechanisms function correctly with the updated validation. +2. The Ingress resource references Service and will also need a relaxed validation on its reference to the Service +3. Downstream applications may perform validation on fields relating to Service names (ie: [ingress-ngnix](https://github.com/kubernetes/ingress-nginx/blob/d3ab5efd54f38f2b7c961024553b0ad060e2e916/internal/ingress/annotations/parser/validators.go#L190-L197) + +## Design Details + +Introduce a new feature gate named RelaxedServiceNameValidation is disabled by default. + +When enabled, the feature gate will use the [NameIsDNSSubdomain](https://github.com/kubernetes/kubernetes/blob/3196c9946355c1d20086f66c22e9e5364fb0a56f/staging/src/k8s.io/apimachinery/pkg/api/validation/generic.go#L37-L42) validation for new Services. + +Since the relaxed check allows previously invalid values, care must be taken to support cluster downgrades safely. To accomplish this, the validation will distinguish between new resources and updates to existing resources: + +When the feature gate is disabled: + +- Creation of Services will use the previous RFC-1035 validation for `.metadata.name` +- Creation of Ingress will use the previous RFC-1035 validation for `.spec.[]rules.http.[]paths.backend.service.name` +- Updates of Services will use the new RFC-1123 validation for `.metadata.name` +- Updates of Ingress will use the new RFC-1123 validation for `.spec.[]rules.http.[]paths.backend.service.name` + +When the feature gate is enabled: + +- Creation and update of Services will use new RFC-1123 relaxed validation for `.metadata.name` +- Creation and update of of Ingress will use the new RFC-1123 validation for `.spec.[]rules.http.[]paths.backend.service.name` + + + +### Test Plan + + + +[X] 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 + +Tests of validation will be updated. + + + + + +- ``: `` - `` + +##### Integration tests + + + + + +- [test name](https://github.com/kubernetes/kubernetes/blob/2334b8469e1983c525c0c6382125710093a25883/test/integration/...): [integration master](https://testgrid.k8s.io/sig-release-master-blocking#integration-master?include-filter-by-regex=MyCoolFeature), [triage search](https://storage.googleapis.com/k8s-triage/index.html?test=MyCoolFeature) + +##### e2e tests + + + +- [test name](https://github.com/kubernetes/kubernetes/blob/2334b8469e1983c525c0c6382125710093a25883/test/e2e/...): [SIG ...](https://testgrid.k8s.io/sig-...?include-filter-by-regex=MyCoolFeature), [triage search](https://storage.googleapis.com/k8s-triage/index.html?test=MyCoolFeature) + +### Graduation Criteria + +#### Alpha + +- Feature implemented behind a feature flag +- Initial e2e tests completed and enabled + +#### Beta + +- E2E and Integration tests completed and enabled. + +#### GA + +- Time passes, no major objections + +### 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? + + + +- [X] Feature gate (also fill in values in `kep.yaml`) + - Feature gate name: RelaxedServiceNameValidation + - Components depending on the feature gate: + - kube-apiserver + +###### 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-network/5311-relaxed-validation-for-service-names/kep.yaml b/keps/sig-network/5311-relaxed-validation-for-service-names/kep.yaml new file mode 100644 index 00000000000..71af7ad5002 --- /dev/null +++ b/keps/sig-network/5311-relaxed-validation-for-service-names/kep.yaml @@ -0,0 +1,42 @@ +title: Relaxed validation for Services names +kep-number: 5311 +authors: + - "@adrianmoisey" +owning-sig: sig-network +participating-sigs: [] +status: provisional #|implementable|implemented|deferred|rejected|withdrawn|replaced +creation-date: 2025-05-17 +reviewers: + - @thockin +approvers: + - @thockin + +see-also: [] +replaces: [] + +# The target maturity stage in the current dev cycle for this KEP. +# If the purpose of this KEP is to deprecate a user-visible feature +# and a Deprecated feature gates are added, they should be deprecated|disabled|removed. +stage: alpha #|beta|stable + +# 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.34" + +# The milestone at which this feature was, or is targeted to be, at each stage. +milestone: + alpha: "v1.34" + beta: "v1.35" + stable: "v1.36" + +# 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: RelaxedServiceNameValidation + components: + - kube-apiserver +disable-supported: true + +# The following PRR answers are required at beta release +metrics: []