Skip to content

feat(api): restore CRD field descriptions for operator-owned types#5023

Open
Sanil2108 wants to merge 1 commit into
open-telemetry:mainfrom
Sanil2108:feat/restore-crd-field-descriptions
Open

feat(api): restore CRD field descriptions for operator-owned types#5023
Sanil2108 wants to merge 1 commit into
open-telemetry:mainfrom
Sanil2108:feat/restore-crd-field-descriptions

Conversation

@Sanil2108
Copy link
Copy Markdown
Contributor

Summary

Restores CRD field descriptions that were removed in #2703 to keep CRD sizes manageable.

  • Sets maxDescLen=128 (previously maxDescLen=0) in the controller-gen CRD generation options, restoring truncated but meaningful descriptions for all operator-defined fields
  • Updates the make install target to use kubectl apply --server-side to support the larger CRD payloads

Background

PR #2703 set maxDescLen=0 because kubectl apply -f crd-file.yaml was failing due to CRD size. This removed all field descriptions from the generated CRDs, making kubectl explain and API documentation less useful.

With maxDescLen=128, the largest CRD (OpenTelemetryCollectors) grows from ~400KB to ~900KB, which is within etcd's object size limits. Using --server-side apply avoids the last-applied-configuration annotation that doubles the payload for client-side apply.

CRD sizes with this change

CRD Before (maxDescLen=0) After (maxDescLen=128)
opentelemetrycollectors 405KB 900KB
targetallocators 153KB 346KB
instrumentations 92KB 185KB
opampbridges 73KB 166KB
clusterobservabilities 5KB 11KB

Example

Before:

configVersions:
  default: 3
  minimum: 1
  type: integer

After:

configVersions:
  default: 3
  description: ConfigVersions defines the number versions to keep for
    the collector config. Each config version is stored in a separate ConfigMap.
  minimum: 1
  type: integer

Resolves: #2737

Test plan

  • make manifests regenerates CRDs with descriptions present
  • Verified kubectl explain shows field descriptions for operator-owned types
  • CRD sizes verified to be within etcd object size limits

Set maxDescLen=128 in CRD generation options to restore field
descriptions that were removed in open-telemetry#2703 to keep CRD sizes manageable.

Descriptions are now present for all operator-defined types
(OpenTelemetryCollector, Instrumentation, TargetAllocator, etc.),
making kubectl explain and API documentation more useful.

The install Makefile target now uses kubectl apply --server-side to
support the larger CRD payloads (~900KB for the collector CRD vs
~400KB without descriptions), which is within etcd object size limits.

Fixes: open-telemetry#2737
@Sanil2108 Sanil2108 requested a review from a team as a code owner May 1, 2026 12:54
Copy link
Copy Markdown
Contributor

@iblancasa iblancasa left a comment

Choose a reason for hiding this comment

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

I'm not against enabling this again but only if we have some kind of test that probes the operator is not broken because of this.

@swiatekm
Copy link
Copy Markdown
Contributor

swiatekm commented May 4, 2026

I'm not sure we want to do this. Or at least not until we drop support for v1alpha1 Collectors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add CRD descriptions

3 participants