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

Super-Linter (kubeval) complains on Helm chart templates #7

Closed
gmacario opened this issue Apr 20, 2022 · 9 comments · Fixed by #11
Closed

Super-Linter (kubeval) complains on Helm chart templates #7

gmacario opened this issue Apr 20, 2022 · 9 comments · Fixed by #11
Assignees
Labels
bug Something isn't working

Comments

@gmacario
Copy link
Contributor

Example: see https://github.com/aquariophilie/node-koa-boilerplate/actions/runs/2195960529

@gmacario gmacario added the bug Something isn't working label Apr 20, 2022
@gmacario gmacario self-assigned this Apr 20, 2022
@gmacario
Copy link
Contributor Author

gmacario commented Apr 20, 2022

FTR: The kubeval plugin of Super-Linter is the one at https://github.com/instrumenta/kubeval

Source: https://github.com/github/super-linter/blob/main/README.md?plain=1#L83

Kubeval documentation is available at https://www.kubeval.com/

Helm-specific documentation of kubeval is at https://www.kubeval.com/#helm

@gmacario
Copy link
Contributor Author

Maybe some of those kubeval issues are related?

For instance: instrumenta/kubeval#234

@gmacario
Copy link
Contributor Author

FYI @Raffone17:

Kubeval documentation is available at https://www.kubeval.com/

Helm-specific documentation of kubeval is at https://www.kubeval.com/#helm

@gmacario
Copy link
Contributor Author

@Raffone17 could you please comment with some helm commands which help me reproduce the issue from the main branch?

@Raffone17
Copy link
Collaborator

@gmacario the command for create a new chart with helm is helm create chart-name, docs.

@gmacario
Copy link
Contributor Author

gmacario commented Apr 30, 2022

Trying to reproduce issue on gmpowerhorse (Ubuntu 20.04.4 LTS)

Logged in as gmacario@gmpowerhorse:

sudo snap install helm --classic

mkdir -p ~/github/aquariophilie
cd ~/github/aquariophilie
git clone https://github.com/aquariophilie/node-koa-boilerplate
cd node-koa-boilerplate
git checkout -b fix/7-kubeval-errors

helm version
helm create test-helm
git status
git add -A
git commit -sm "Add test-helm"
git push -u origin fix/7-kubeval-errors

Result:

...
gmacario@gmpowerhorse:~/github/aquariophilie/node-koa-boilerplate (fix/7-kubeval-errors)$ helm version
version.BuildInfo{Version:"v3.7.0", GitCommit:"eeac83883cb4014fe60267ec6373570374ce770b", GitTreeState:"clean", GoVersion:"go1.16.8"}
gmacario@gmpowerhorse:~/github/aquariophilie/node-koa-boilerplate (fix/7-kubeval-errors)$ helm create test-helm
Creating test-helm
gmacario@gmpowerhorse:~/github/aquariophilie/node-koa-boilerplate (fix/7-kubeval-errors)*$ git status
On branch fix/7-kubeval-errors
Untracked files:
  (use "git add <file>..." to include in what will be committed)
        test-helm/

nothing added to commit but untracked files present (use "git add" to track)
gmacario@gmpowerhorse:~/github/aquariophilie/node-koa-boilerplate (fix/7-kubeval-errors)*$ git add -A
gmacario@gmpowerhorse:~/github/aquariophilie/node-koa-boilerplate (fix/7-kubeval-errors)*$ git commit -sm "Add test-helm"
[fix/7-kubeval-errors 543cdc2] Add test-helm
 11 files changed, 405 insertions(+)
 create mode 100644 test-helm/.helmignore
 create mode 100644 test-helm/Chart.yaml
 create mode 100644 test-helm/templates/NOTES.txt
 create mode 100644 test-helm/templates/_helpers.tpl
 create mode 100644 test-helm/templates/deployment.yaml
 create mode 100644 test-helm/templates/hpa.yaml
 create mode 100644 test-helm/templates/ingress.yaml
 create mode 100644 test-helm/templates/service.yaml
 create mode 100644 test-helm/templates/serviceaccount.yaml
 create mode 100644 test-helm/templates/tests/test-connection.yaml
 create mode 100644 test-helm/values.yaml
gmacario@gmpowerhorse:~/github/aquariophilie/node-koa-boilerplate (fix/7-kubeval-errors)$ git push -u origin fix/7-kubeval-errors
Enumerating objects: 17, done.
Counting objects: 100% (17/17), done.
Delta compression using up to 8 threads
Compressing objects: 100% (15/15), done.
Writing objects: 100% (16/16), 5.58 KiB | 5.58 MiB/s, done.
Total 16 (delta 1), reused 1 (delta 0)
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
remote:
remote: Create a pull request for 'fix/7-kubeval-errors' on GitHub by visiting:
remote:      https://github.com/aquariophilie/node-koa-boilerplate/pull/new/fix/7-kubeval-errors
remote:
To https://github.com/aquariophilie/node-koa-boilerplate
 * [new branch]      fix/7-kubeval-errors -> fix/7-kubeval-errors
Branch 'fix/7-kubeval-errors' set up to track remote branch 'fix/7-kubeval-errors' from 'origin'.
gmacario@gmpowerhorse:~/github/aquariophilie/node-koa-boilerplate (fix/7-kubeval-errors)$

@gmacario
Copy link
Contributor Author

Confirmed that Super-Linter complains on test-helm

image

@gmacario
Copy link
Contributor Author

gmacario commented Apr 30, 2022

Locally running kubeval in a Docker container as explained in https://kubeval.instrumenta.dev/installation/

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

Result:

gmacario@gmpowerhorse:~/github/aquariophilie/node-koa-boilerplate (fix/7-kubeval-errors)$ 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:~/github/aquariophilie/node-koa-boilerplate (fix/7-kubeval-errors)$

@gmacario
Copy link
Contributor Author

gmacario commented May 1, 2022

According to instrumenta/kubeval#312 (Docker image out of date)

You can use cytopia/kubeval:0.16

gmacario@gmpowerhorse:~ $ docker run -it -v `pwd`/test-helm:/test-helm cytopia/kubeval:0.16 test-helm/*
Unable to find image 'cytopia/kubeval:0.16' locally
0.16: Pulling from cytopia/kubeval
4e9f2cdf4387: Pull complete
2d7f70b13eea: Pull complete
132afe246d33: Pull complete
Digest: sha256:51176f75b5af0deaaf6f6ae05c6a83144ea33dd8e11f098ca8ad191c6030a027
Status: Downloaded newer image for cytopia/kubeval:0.16
ERR  - Could not open file test-helm/charts
ERR  - Could not open file test-helm/Chart.yaml
ERR  - Could not open file test-helm/templates
ERR  - Could not open file test-helm/values.yaml
gmacario@gmpowerhorse:~ $

The same errors are also reported using Docker image cytopia/kubeval:latest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants