Skip to content

fix(gateway-api): use server-side apply to avoid annotation size limit#13326

Open
Lanyujiex wants to merge 1 commit into
kubernetes-sigs:masterfrom
Lanyujiex:fix_experimental_crds
Open

fix(gateway-api): use server-side apply to avoid annotation size limit#13326
Lanyujiex wants to merge 1 commit into
kubernetes-sigs:masterfrom
Lanyujiex:fix_experimental_crds

Conversation

@Lanyujiex

Copy link
Copy Markdown

What type of PR is this?

/kind bug

What this PR does / why we need it:

The Gateway API HTTPRoute CRD in experimental channel (v1.5.x+) exceeds Kubernetes' 262144-byte annotation limit when using client-side apply, causing installation failures.

This PR switches the Gateway API installation task from using the kube module (client-side apply) to the command module with kubectl apply --server-side to bypass the annotation size limitation.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

  • Tested with Gateway API v1.5.1 experimental channel
  • The --server-side=true flag is the recommended approach for large CRDs
  • --force-conflicts handles ownership conflicts during upgrades
  • Backward compatible with existing installations

Does this PR introduce a user-facing change?:

Gateway API CRDs installation now uses server-side apply to support experimental channel v1.5.x+

@kubernetes-prow

Copy link
Copy Markdown
Contributor

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Details

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.

@kubernetes-prow kubernetes-prow Bot added kind/bug Categorizes issue or PR as related to a bug. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Jun 24, 2026
@linux-foundation-easycla

linux-foundation-easycla Bot commented Jun 24, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: Lanyujiex / name: yujiel (32fb67a)

@kubernetes-prow kubernetes-prow Bot requested review from VannTen and mzaian June 24, 2026 08:22
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

The full list of commands accepted by this bot can be found here.

Details 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

@kubernetes-prow kubernetes-prow Bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 24, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

Hi @Lanyujiex. Thanks for your PR.

I'm waiting for a kubernetes-sigs 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.

Details

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.

@kubernetes-prow kubernetes-prow Bot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Jun 24, 2026
@Lanyujiex Lanyujiex force-pushed the fix_experimental_crds branch from 85bb384 to 32fb67a Compare June 24, 2026 08:25
@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jun 24, 2026
@yankay

yankay commented Jun 24, 2026

Copy link
Copy Markdown
Member

/ok-to-test

@yankay yankay requested a review from Copilot June 24, 2026 11:27
@kubernetes-prow kubernetes-prow Bot 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 Jun 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Switches Gateway API CRD installation to server-side apply to avoid Kubernetes’ 262144-byte annotation size limit encountered with client-side apply for experimental Gateway API v1.5.x+.

Changes:

  • Replaces kube module usage with kubectl apply --server-side for Gateway API install manifests.
  • Adds task result registration and a custom changed_when to preserve idempotent reporting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread roles/kubernetes-apps/common_crds/gateway_api/tasks/main.yml
Comment on lines +29 to +31
--server-side=true
--force-conflicts
-f {{ kube_config_dir }}/addons/gateway_api/{{ gateway_api_channel }}-install.yaml
@Lanyujiex Lanyujiex force-pushed the fix_experimental_crds branch from 32fb67a to 254e8c6 Compare June 25, 2026 01:32
The Gateway API HTTPRoute CRD in experimental channel (v1.5.x+) exceeds
Kubernetes' 262144-byte annotation limit when using client-side apply.

Switch to server-side apply to bypass this limitation.
@Lanyujiex Lanyujiex force-pushed the fix_experimental_crds branch from 254e8c6 to 267d642 Compare June 25, 2026 01:37
@VannTen

VannTen commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Please see https://github.com/kubernetes-sigs/kubespray/pull/12299/changes#diff-e23023123c95db61f2b109ee7206b5c2b3430e2e24523b7dfa18eb909d8b8b14

This is handled in #12299 . I'd rather avoid introducing change which will need to be rebased against.
(This PR mainly needs testing and review, the CI failures are unrelated).
(It touch gateway API because the download role is very tightly coupled in all kubespray).
Holding for now because of that.
/hold

@kubernetes-prow kubernetes-prow Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 25, 2026
@VannTen

VannTen commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

(not that besides that, this should use the kubectl_apply_stdin variable which is defined for this precisely.

@Lanyujiex

Copy link
Copy Markdown
Author

Understood, I'll wait for #12299 to be merged and then rebase accordingly.

@VannTen

VannTen commented Jun 25, 2026 via email

Copy link
Copy Markdown
Contributor

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. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. kind/bug Categorizes issue or PR as related to a bug. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants