Open danielefranceschi opened 3 years ago
This is related to https://github.com/helm/helm/issues/8776, so it does not occur with helm v3.4.1
For me using helm producing the same error even on v3.4.1.
I am using helm within a docker container to use as a dev container for VS-Code.
$helm version
WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /workspaces/infra-dev-cluster/.devcontainer/kubeconfig.conf
WARNING: Kubernetes configuration file is world-readable. This is insecure. Location: /workspaces/infra-dev-cluster/.devcontainer/kubeconfig.conf
version.BuildInfo{Version:"v3.4.1", GitCommit:"c4e74854886b2efe3321e185578e6db9be0a6e29", GitTreeState:"clean", GoVersion:"go1.14.11"}
$helmfile version
helmfile version v0.135.0
not sure how to resolve this issue.
@Sleeplessprodigy: For me using helm producing the same error even on v3.4.1.
I don't see the crash: do helmfile apply
or helmfile sync
crash?
not sure how to resolve this issue.
Since v3.4.0
helm sends the WARNING:
lines to stderr. while in v3.3.x
on stdout: that's the reason helmfile breaks, because it does not expect those lines in helm output.
Issue can be solved with some filtering in the helmfile go code, or upgrading helm to v3.4.x
. The devcontainer you're using should be ok.
You can also fix the root cause by changing the file's read permissions to user-only via chmod go-r ~/.kube/config
.
Your kubeconfig should not be group/world-readable, hence the error.
@bacongobbler of course that's the way, this issue is about helmfile that crashes on attempting to parse helm 3.3.x output (because that warning goes to stdout in helm 3.3.x and interferes with version parsing)
I'm not sure what's the recourse for helmfile here. It was a bug in upstream that was fixed in a patch release. Your recourse is to either fix the root cause (which is the recommended path forward, because it raises a security concern), or upgrade to a newer version of Helm with the applied hotfix (3.3.4 and later).
To suggest that helmfile should address this for a very specific version of Helm due to an unintentional bug which was fixed in a patch release seems silly. Just upgrade to the latest patch release and the issue will go away.
The changelog between Helm 3.3.3 and 3.3.4 is incredibly minimal. It includes the fix mentioned here and a fix for a small bug with helm repo add
, so the risk factor involved with an update is minimal to the user.
For reference, https://github.com/helm/helm/pull/8779 was the fix.
Yep, I've seen them and I agree in general. I'm of course not here to suggest what should be done, I just reported a crash and found the root cause (eventually because I hate panics), so feel free to close the issue.
Mounting a kubeconfig file on a docker container still results in the warnings. Can we have a flag to turn off such warnings? Filtering output is ugly and not the way imo...
Context: helmfile v0.135.0, helm v3.3.3, WSL2 (debian sid), docker desktop on Windows 10.
As in WSL2 my
~/.kube
is a symbolic link towards/mnt/c/Users/xxxx/.kube
on a windows partition, it has0777
access mode (default,chmod 0700
helps but not solves).Infact, helm on WSL warns me each time:
Then, running
helmfile apply
gives me this stacktrace:In my own helm-based tooling, I had to parse helm output removing the
WARNING:
lines as I did not find a switch to avoid them.