mirror of
https://github.com/gravitational/teleport.git
synced 2026-09-19 11:00:37 +08:00
Adds Kubernetes operator support for the RetrievalModel singleton. The controller implements Get/Create/Update/Delete backed by the summarizer gRPC service. Because RetrievalModel is a singleton, Get and Delete ignore the name parameter and always operate on the fixed Teleport resource. Introduces withSingletonName(name string) as a typed CRD schema option that emits a CEL x-kubernetes-validations rule enforcing metadata.name == name at admission time. This is wired up for TeleportRetrievalModelV1, which must be a cluster singleton named "retrieval-model". On Kubernetes < 1.25, x-kubernetes-validations is not a recognized field in JSONSchemaProps and causes helm to fail with a validation error. The Helm CRD template now checks .Capabilities.KubeVersion against >= 1.25.0 and strips the field from every CRD version's openAPIV3Schema before rendering when the cluster does not support it. A Mutate hook enforces that the Kubernetes CR must be named "retrieval-model" before any Teleport call is made, surfacing a clear status condition on wrongly-named CRs.