helmfile: .Capabilities.APIVersions returns wrong results
The helm built-in object Capabilities.APIVersions returns incorrect results when running with helmfile in my cluster.
For demonstration purposes, I have the following test.yaml file, which prints the results from APIVersions using incubator/raw:
templates:
- |
apiVersion: apps/v1
kind: Deployment
metadata:
name: test
labels:
test: |
{{ .Capabilities.APIVersions }}
Here is a helmfile.yaml using this template:
repositories:
- name: incubator
url: https://kubernetes-charts-incubator.storage.googleapis.com
releases:
- name: test
namespace: monitoring
chart: incubator/raw
version: 0.2.3
values:
- test.yaml
When I run helm install test incubator/raw -f test.yaml --dry-run I get the correct list of API Versions available in my cluster. helmfile template outputs a different set of Versions with many entries missing.
helmfile version v0.94.1
# kubectl version (AWS EKS)
Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.3", GitCommit:"b3cbbae08ec52a7fc73d334838e18d17e8512749", GitTreeState:"clean", BuildDate:"2019-11-13T11:23:11Z", GoVersion:"go1.12.12", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"14+", GitVersion:"v1.14.8-eks-b8860f", GitCommit:"b8860f6c40640897e52c143f1b9f011a503d6e46", GitTreeState:"clean", BuildDate:"2019-11-25T00:55:38Z", GoVersion:"go1.12.10", Compiler:"gc", Platform:"linux/amd64"}
# helm version
version.BuildInfo{Version:"v3.0.0", GitCommit:"e29ce2a54e96cd02ccfce88bee4f58bb6e2a28b6", GitTreeState:"clean", GoVersion:"go1.13.4"}
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 22 (7 by maintainers)
Commits related to this issue
- app option to pass apiVersions to helm diff and helm template resolves #1014 — committed to a-hat/helmfile by a-hat 5 years ago
- feat: Option to pass apiVersions to `helm diff` and `helm template` (#1046) This makes it possible to pass the API Capabilities to helmfile when executing a task that does not render against an actua... — committed to roboll/helmfile by a-hat 5 years ago
Upon further investigation,
helm templateseems to be the culprit.The documentation of this command says:
In my case, I was running
helmfile apply, which (if I understand correctly) first executeshelm diffto detect if there are any changes, which probably is based onhelm template. In the chart I was installing, there is a check on the API Versions, and this check did not return the expected results, so no changes were detected by helmfile. If I runhelmfile sync, the chart gets installed with the correctly rendered templates.Any ideas how the user experience could be improved for this use case?
It turned out that the issue was actually our fault; another team member had set
disableValidation: truein some releases in our helmfiles, but I was unaware of that. After replacing that configuration with thedisableValidationOnInstall: trueparameter you introduced in https://github.com/roboll/helmfile/issues/1600#issuecomment-772904291, the incorrect rendering went away. Even with usingKubeVersionand without usingHELM_DIFF_USE_UPGRADE_DRY_RUN. Thank you!