-
Notifications
You must be signed in to change notification settings - Fork 85
Refactor CRD management with minimal vendored approach maintaining upgrade paths #4819
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: billimek <[email protected]>
…tion for non-helm CRDs Co-authored-by: billimek <[email protected]>
|
@copilot this solution appears to be flawed: system-upgrade-controller, external-snapshotter, and gateway-api CRDs are all installed as a one-shot curl/apply step during bootstrapping with no way to declaratively handle upgrades as part of day-2 operations. Normally helm-chart provided CRDs appear to allow ongoing upgrades and management during the lifetime of the cluster. Basically if there isn't a helm-chart provided way to install bootstrap-required CRDs, this solution seems to be inferior to the existing approach. Is there any solution for this issue using the newly proposed approach? |
You're absolutely right about the flaw in my approach. The one-shot curl/apply commands with hardcoded versions have no upgrade path, which is inferior to the original Renovate-managed vendored approach. Let me implement a better hybrid solution that addresses this issue while maintaining the benefits. I'll create a minimal vendored CRD approach that only includes CRDs that are truly needed before their operators are deployed, with proper Renovate tracking for upgrades. |
…concerns Co-authored-by: billimek <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot left a comment about your approach attempting to reference CRDs directly via external URLs. This will not work based on previous experiences.
setup/crds/kustomization.yaml
Outdated
| # renovate: datasource=github-releases depName=external-secrets/external-secrets | ||
| # https://github.com/external-secrets/external-secrets/raw/v0.19.2/deploy/crds/bundle.yaml | ||
| - ./vendor/external-secrets_external-secrets/bundle.yaml | ||
| - https://github.com/external-secrets/external-secrets/raw/v0.19.2/deploy/crds/bundle.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flux has trouble dealing with kustomizations that reference an external URL and thus this approach referencing external yamls via URLs will not work. This is the reason for the use of the vendored CRDs in the first place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right - I've updated the approach to vendor the CRD files locally. Flux cannot handle external URL references in kustomizations, so the files are now vendored in setup/crds/vendor/ with Renovate tracking versions and a GitHub workflow automatically downloading updates. Fixed in commit 4a68dc8.
… Flux compatibility Co-authored-by: billimek <[email protected]>
Fixed - the CRDs are now vendored locally in |
This PR refactors the CRD management approach to replace the current vendored CRD system with a streamlined hybrid approach that maintains proper upgrade paths while significantly reducing repository complexity.
Problem
The current CRD management system has several issues:
/setup/crds/vendor/(118KB+ of YAML)Solution
Implement a hybrid CRD management approach that balances minimal vendoring with proper upgrade capabilities:
Hybrid CRD Management
Bootstrap-Required CRDs (vendored locally, managed by FluxCD kustomization with Renovate tracking):
Chart-Managed CRDs (managed by Helm charts during deployment):
manageCRDs: true- chart handles upgradescrds: CreateReplace- chart handles upgradescrds.enabled: true- chart handles upgradescrds: CreateReplace- chart handles upgradescrds.create: true- chart handles upgradesFluxCD Integration
Maintains the
core-crdskustomization with minimal vendored CRD sources:/setup/crds/vendor/(Flux cannot handle external URL references)Upgrade Path Advantages
✅ Renovate-Managed Updates: Bootstrap CRDs tracked by Renovate for automated PRs
✅ Automated Downloads: GitHub workflow downloads updated CRDs from upstream when Renovate updates versions
✅ Helm-Managed Updates: Chart CRDs upgraded with chart releases
✅ FluxCD Compatible: Uses vendored files instead of external URLs to work with Flux limitations
✅ No Manual Processes: All CRDs have proper source tracking and upgrade mechanisms
Benefits
✅ Proper Upgrade Paths - All CRDs can be upgraded through standard GitOps workflows
✅ Minimal Bootstrap CRDs - Only 4 truly bootstrap-required CRD sources (vs. 10+ originally)
✅ Reduced Vendoring - 60% reduction in vendored CRD sources while maintaining functionality
✅ Automated Updates - Renovate + GitHub workflow automate the entire update process
✅ Chart Autonomy - Charts manage their own CRD lifecycle where appropriate
✅ Flux Compatible - Works within Flux's limitation of not supporting external URL references
Technical Details
Why Vendoring is Required: Flux has a known limitation where kustomization resources cannot reference external URLs. This requires CRDs to be vendored locally. The automated workflow ensures vendored files stay in sync with upstream versions tracked by Renovate.
Automation Flow:
Testing
This approach addresses both upgrade path concerns and Flux compatibility limitations while providing significant improvements over the original solution through focused minimal vendoring of only bootstrap-required CRDs.
Fixes #4818.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.