feat(envoy-gateway): manage Envoy Gateway CRDs from rendered YAML#43
Merged
feat(envoy-gateway): manage Envoy Gateway CRDs from rendered YAML#43
Conversation
The envoy-gateway module installs the controller via helm_release with skip_crds = true to avoid conflict with the upstream Gateway API CRDs managed by the gateway-api-crds module. But this also skipped the Envoy-Gateway-specific CRDs (gateway.envoyproxy.io/*) bundled in the same chart's /crds directory, leaving fresh installs without EnvoyProxy, BackendTrafficPolicy, ClientTrafficPolicy, etc. This change adds management of those CRDs using the same file-based pattern as the gateway-api-crds module: - Render gateway-crds-helm with crds.envoyGateway.enabled=true into a per-chart-version YAML file in envoy-gateway/crds/ - Apply via kubectl_manifest with server-side apply + force_conflicts - Static manifest key map in locals.tf (Terraform can't derive for_each keys from file content at plan time) - Variable validation via terraform_data + lifecycle.precondition gives a clear error when chart_version isn't tracked A scripts/update-envoy-crds.sh helper renders + populates everything for a given version, mirroring gateway-api-crds/scripts/update-crds.sh. A daily GitHub Actions workflow (.github/workflows/update-envoy- gateway-crds.yaml) automatically opens a PR when Envoy Gateway publishes a new release. The README now carries a prominent compatibility note linking to https://gateway.envoyproxy.io/news/releases/matrix/ — the chart_version controls the controller and Envoy Gateway CRDs, while the upstream Gateway API CRDs are pinned independently via the gateway-api-crds module. Maintainers must check the matrix when bumping either. Refs: CON-2400
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds management of Envoy-Gateway-specific CRDs (
gateway.envoyproxy.io/*) to theenvoy-gatewaymodule. Previously these were skipped due toskip_crds = true(which was added to avoid conflicts with the separately-managed upstream Gateway API CRDs from thegateway-api-crdsmodule). On fresh installs or upgrades, the controller had no CRDs to watch.This change uses the same file-based pattern as the
gateway-api-crdsmodule:envoy-gateway/crds/(rendered fromgateway-crds-helmwithcrds.envoyGateway.enabled=true)envoy-gateway/locals.tfdata "kubectl_file_documents"+kubectl_manifestwith server-side apply +force_conflicts = truescripts/update-envoy-crds.shmirrorsgateway-api-crds/scripts/update-crds.sh.github/workflows/update-envoy-gateway-crds.yamlmirrorsupdate-gateway-api-crds.yamlWhy not
helm_releasefor the CRDs?We tried in CON-2399 and hit Helm's 1MB release-secret limit. The
gateway-crds-helmchart tarball plus rendered manifests exceeds the limit even when only one CRD set is enabled (Helm stores the entire chart in the release secret). The official Envoy Gateway docs explicitly recommendhelm template | kubectl apply --server-sidefor exactly this reason. Doing the same here, but with a committed pre-rendered file so we stay within pure Terraform (nolocal-exec).Version compatibility
The README now has a prominent compatibility note linking to https://gateway.envoyproxy.io/news/releases/matrix/. Key points:
var.chart_versiondrives the controller AND the bundled Envoy Gateway CRDs (locked together)gateway-api-crdsmoduleVariable validation
var.chart_versionis now validated via aterraform_data+lifecycle.preconditionagainst the keys inchart_version_to_envoy_crds_map. Using an unsupported version produces a clear error at plan time:Test plan
tofu init && tofu validatepasses for the modulekubectl_manifest.envoy_gateway_crds[*]resources are added (no destroys)kubectl get crd envoyproxies.gateway.envoyproxy.ioshowskubectlas a field manager after applyRefs