Comments (9)
Ok turns out this is a bug upstream in Helm and never fixed helm/helm#8508
from helm-controller.
@MBrouns if your main chart contains no CRDs, you could skip all CRDs with:
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
spec:
install:
crds: Skip
upgrade:
crds: Skip
Besides this there is no way we can fix this issue in Flux. In Flux we use the Helm SDK to get the CRDs and the SDK returns all CRDs from all sub-charts before values are compiled.
from helm-controller.
Thanks for that lightning-quick response! Unfortunately we do enable other subcharts in the mainchart that have CRDs, so I don't think that'll fix it for us.
The weird thing is that if I do a helm install directly of the same manifests, the CRD is not installed. Only when I install the chart through flux it is. Are you suggesting there are differences between the helm cli and helm sdk?
from helm-controller.
What version of the Helm CLI are you using?
from helm-controller.
version.BuildInfo{Version:"v3.13.3", GitCommit:"c8b948945e52abba22ff885446a1486cb5fd3474", GitTreeState:"clean", GoVersion:"go1.20.11"}
from helm-controller.
I don't see how the Helm CLI can do anything different, both the controller and the CLI call this code where all CRDs are merged from all sub-charts and applied:
from helm-controller.
I agree that it's weird, but it does seem to be what's happening. Running helm install test . --set 'subchart.enabled=false'
results in the CRD not being installed for the chart defined in https://github.com/MBrouns/fluxcd-subchart-crd-test/tree/main/mainchart
Let me preface this by saying I'm not very familiar with helm's codebase, but I've done some digging to understand the issue better. I can confirm that when I put a breakpoint here https://github.com/helm/helm/blob/14d0c13e9eefff5b4a1b511cf50643529692ec94/pkg/action/install.go#L256 the length of chrt.CRDObjects()
is zero if the subchart is disabled and one if it is enabled.
The crd is initially in the chrt.CRDObjects()
at the start of the RunWithContext
but gets removed in the call to
if err := chartutil.ProcessDependenciesWithMerge(chrt, vals); err != nil {
return nil, err
}
As far as I can tell though, Flux calls the same RunWithContext
here:
helm-controller/internal/action/install.go
Lines 58 to 60 in 9059e7f
from helm-controller.
I looked into it a bit further and took the very blunt approach of calling helmchartutil.ProcessDependenciesWithMerge
before applyCRDs
is called and that does result in the crd of the subchart not being installed.
Can you confirm whether this makes sense? If so, I'll make the linked PR proper and add stuff like test cases
from helm-controller.
Got bitten by this as well with splunk-otel-collector chart.
@stefanprodan Helm cli does not reproduce this problem (can be tested with helm template --include-crds
command), so this is purely a flux helm-controller issue.
A workaround with spec.install.crds=Skip
helped at least.
from helm-controller.
Related Issues (20)
- Drift Detection is not logging JSON patch when --log-level=debug
- HelmRelease verify provider gpg HOT 1
- Drift mode should detect extra properties HOT 2
- Chart version only includes git SHA at root chart HOT 2
- Only deploy prerelease versions HOT 1
- Feature Request: Replace reconciliation interval with cron schedule in HelmRelease CRD HOT 1
- [BUG] Drift Detection can not be disabled for specific resources using annotations or labels
- [BUG] memory usage grows exponentially when there are lots of CRDs HOT 2
- [BUG] Helm drift detection on configmap patching '*** (after)' instead of the actual template from the helm chart HOT 13
- Backward compatibility of helm-controller HOT 6
- FEATURE: First-class support for secret decryption HOT 2
- Unable to detect server capabilities HOT 16
- Failed to reconcile HelmRelease field immutable HOT 1
- DependsOn readiness check should only rely on Ready condition HOT 10
- (site) DependsOn does not document cross-namespace dependencies HOT 2
- Changes in postRenderers are ingored HOT 6
- v0.37.4 has CVE-2024-26147 high vulnerability HOT 1
- Flux Helm Not Removing HPA objects on upgrade HOT 1
- Can't seem to install pre-release helmrelease (A.B.C-alpha.N)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from helm-controller.