Skip to content
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

kubeval of "helm create test-helm" fails #340

Open
gmacario opened this issue May 1, 2022 · 1 comment
Open

kubeval of "helm create test-helm" fails #340

gmacario opened this issue May 1, 2022 · 1 comment

Comments

@gmacario
Copy link

gmacario commented May 1, 2022

Hello and apologies in advance if this is a newbie question.

I have been experiencing troubles in having kubeval validate even simple Helm charts - see aquariophilie/node-koa-boilerplate#9 as an example.

I managed to reproduce the problem with one of the easiest test I could think about

helm version
helm create test-helm

docker run -it \
    -v `pwd`/test-helm:/test-helm \
    garethr/kubeval test-helm/*

Here is the result:

gmacario@gmpowerhorse:~ $ helm version
version.BuildInfo{Version:"v3.7.0", GitCommit:"eeac83883cb4014fe60267ec6373570374ce770b", GitTreeState:"clean", GoVersion:"go1.16.8"}
gmacario@gmpowerhorse:~ $ helm create test-helm
Creating test-helm
gmacario@gmpowerhorse:~ $ docker run -it \
>     -v `pwd`/test-helm:/test-helm \
>     garethr/kubeval test-helm/*
ERR  - Could not open file test-helm/charts
ERR  - test-helm/Chart.yaml: Missing 'metadata' key
ERR  - Could not open file test-helm/templates
ERR  - test-helm/values.yaml: Missing 'metadata' key
gmacario@gmpowerhorse:~ $

You can find more details at aquariophilie/node-koa-boilerplate#7 and aquariophilie/node-koa-boilerplate#10

Thanks for your attention -- Gianpaolo

@jakuboskera
Copy link

According docs https://www.kubeval.com/#helm.

If you do helm template for generating RAW YAML manifests, then this output contains comments with path for these templates e.g. # Source: my-chart/templates/frontend.yaml. This output can be sent to kubeval which will validate every YAML manifest according the path in the comment.

Something like this could work

$ helm template my-chart ./my-chart | kubeval

PASS - my-chart/templates/frontend.yaml contains a valid Deployment (default.frontend)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants