{"id":39094,"date":"2023-08-31T11:35:07","date_gmt":"2023-08-31T11:35:07","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=39094"},"modified":"2023-08-31T11:35:09","modified_gmt":"2023-08-31T11:35:09","slug":"helm-tutorials-helm-lint","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/helm-tutorials-helm-lint\/","title":{"rendered":"Helm Tutorials: helm lint"},"content":{"rendered":"\n<p>The helm lint command is used to validate your Helm charts and detect potential issues or errors before deploying them to a Kubernetes cluster.<\/p>\n\n\n\n<p>This command takes a path to a chart and runs a series of tests to verify that the chart is well-formed.<\/p>\n\n\n\n<p>If the linter encounters things that will cause the chart to fail installation, it will emit [ERROR] messages. If it encounters issues that break with convention or recommendation, it will emit [WARNING] messages.<\/p>\n\n\n\n<p>Before running helm lint, make sure you have the necessary files in your chart directory, including Chart.yaml, values.yaml, and the template files in the templates directory.<\/p>\n\n\n\n<p>This command will analyze your chart&#8217;s files, templates, and values for any potential issues or errors. If everything is correct, you will see a message indicating that the linting was successful. If there are errors or warnings, you will receive feedback about what needs to be fixed.<\/p>\n\n\n\n<p><strong>$ cd chartname<br>$ helm lint<\/strong><\/p>\n\n\n\n<p>The helm lint command will provide output detailing any errors, warnings, or information about your Helm chart. It&#8217;s important to carefully review this output to identify any issues that need to be addressed.<\/p>\n\n\n\n<p><strong>Errors: <\/strong>These indicate critical problems that will likely prevent your chart from functioning correctly. You must resolve these issues before deploying your chart.<\/p>\n\n\n\n<p><strong>Warnings:<\/strong> These are potential issues that might not prevent your chart from working, but they should still be investigated and resolved if possible.<\/p>\n\n\n\n<p><strong>Info:<\/strong> These are informational messages that provide insights into your chart&#8217;s structure and usage. You can consider these as helpful tips.<\/p>\n\n\n\n<p>Review the linting results and make the necessary changes to your chart files based on the feedback you received. Common issues include incorrect syntax in your templates, missing or incorrect values in the values.yaml file, and issues in your Chart.yaml metadata.<\/p>\n\n\n\n<p><strong>After making the necessary changes, re-run the helm lint command to ensure that the issues have been resolved:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"343\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2023\/08\/image-807-1024x343.png\" alt=\"\" class=\"wp-image-39095\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2023\/08\/image-807-1024x343.png 1024w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2023\/08\/image-807-300x101.png 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2023\/08\/image-807-768x258.png 768w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2023\/08\/image-807.png 1327w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"451\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2023\/08\/image-808-1024x451.png\" alt=\"\" class=\"wp-image-39096\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2023\/08\/image-808-1024x451.png 1024w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2023\/08\/image-808-300x132.png 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2023\/08\/image-808-768x338.png 768w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2023\/08\/image-808.png 1318w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">root@ip<span class=\"hljs-number\">-172<\/span><span class=\"hljs-number\">-31<\/span><span class=\"hljs-number\">-54<\/span><span class=\"hljs-number\">-213<\/span>:\/home\/ubuntu\/charts\/ourchart<span class=\"hljs-comment\"># helm lint -h<\/span>\r\n\r\nThis command takes a path to a chart <span class=\"hljs-keyword\">and<\/span> runs a series of tests to verify that\r\nthe chart is well-formed.\r\n\r\n<span class=\"hljs-keyword\">If<\/span> the linter encounters things that will cause the chart to fail installation,\r\nit will emit &#91;ERROR] messages. <span class=\"hljs-keyword\">If<\/span> it encounters issues that <span class=\"hljs-keyword\">break<\/span> with convention\r\n<span class=\"hljs-keyword\">or<\/span> recommendation, it will emit &#91;WARNING] messages.\r\n\r\nUsage:\r\n  helm lint PATH &#91;flags]\r\n\r\nFlags:\r\n  -h, --help                      help <span class=\"hljs-keyword\">for<\/span> lint\r\n      --quiet                     <span class=\"hljs-keyword\">print<\/span> only warnings <span class=\"hljs-keyword\">and<\/span> errors\r\n      --set stringArray           set values on the command line (can specify multiple <span class=\"hljs-keyword\">or<\/span> separate values with commas: key1=val1,key2=val2)\r\n      --set-file stringArray      set values from respective files specified via the command line (can specify multiple <span class=\"hljs-keyword\">or<\/span> separate values with commas: key1=path1,key2=path2)\r\n      --set-json stringArray      set JSON values on the command line (can specify multiple <span class=\"hljs-keyword\">or<\/span> separate values with commas: key1=jsonval1,key2=jsonval2)\r\n      --set-literal stringArray   set a literal STRING value on the command line\r\n      --set-string stringArray    set STRING values on the command line (can specify multiple <span class=\"hljs-keyword\">or<\/span> separate values with commas: key1=val1,key2=val2)\r\n      --strict                    fail on lint warnings\r\n  -f, --values strings            specify values in a YAML file <span class=\"hljs-keyword\">or<\/span> a URL (can specify multiple)\r\n      --with-subcharts            lint dependent charts\r\n\r\n<span class=\"hljs-keyword\">Global<\/span> Flags:\r\n      --burst-limit int                 client-side <span class=\"hljs-keyword\">default<\/span> throttling limit (<span class=\"hljs-keyword\">default<\/span> <span class=\"hljs-number\">100<\/span>)\r\n      --debug                           enable verbose output\r\n      --kube-apiserver string           the address <span class=\"hljs-keyword\">and<\/span> the port <span class=\"hljs-keyword\">for<\/span> the Kubernetes API server\r\n      --kube-<span class=\"hljs-keyword\">as<\/span>-group stringArray       group to impersonate <span class=\"hljs-keyword\">for<\/span> the operation, this flag can be repeated to specify multiple groups.\r\n      --kube-<span class=\"hljs-keyword\">as<\/span>-user string             username to impersonate <span class=\"hljs-keyword\">for<\/span> the operation\r\n      --kube-ca-file string             the certificate authority file <span class=\"hljs-keyword\">for<\/span> the Kubernetes API server connection\r\n      --kube-context string             name of the kubeconfig context to <span class=\"hljs-keyword\">use<\/span>\r\n      --<span class=\"hljs-title\">kube<\/span>-<span class=\"hljs-title\">insecure<\/span>-<span class=\"hljs-title\">skip<\/span>-<span class=\"hljs-title\">tls<\/span>-<span class=\"hljs-title\">verify<\/span>   <span class=\"hljs-title\">if<\/span> <span class=\"hljs-title\">true<\/span>, <span class=\"hljs-title\">the<\/span> <span class=\"hljs-title\">Kubernetes<\/span> <span class=\"hljs-title\">API<\/span> <span class=\"hljs-title\">server<\/span>'<span class=\"hljs-title\">s<\/span> <span class=\"hljs-title\">certificate<\/span> <span class=\"hljs-title\">will<\/span> <span class=\"hljs-title\">not<\/span> <span class=\"hljs-title\">be<\/span> <span class=\"hljs-title\">checked<\/span> <span class=\"hljs-title\">for<\/span> <span class=\"hljs-title\">validity<\/span>. <span class=\"hljs-title\">This<\/span> <span class=\"hljs-title\">will<\/span> <span class=\"hljs-title\">make<\/span> <span class=\"hljs-title\">your<\/span> <span class=\"hljs-title\">HTTPS<\/span> <span class=\"hljs-title\">connections<\/span> <span class=\"hljs-title\">insecure<\/span>\r\n      --<span class=\"hljs-title\">kube<\/span>-<span class=\"hljs-title\">tls<\/span>-<span class=\"hljs-title\">server<\/span>-<span class=\"hljs-title\">name<\/span> <span class=\"hljs-title\">string<\/span>     <span class=\"hljs-title\">server<\/span> <span class=\"hljs-title\">name<\/span> <span class=\"hljs-title\">to<\/span> <span class=\"hljs-title\">use<\/span> <span class=\"hljs-title\">for<\/span> <span class=\"hljs-title\">Kubernetes<\/span> <span class=\"hljs-title\">API<\/span> <span class=\"hljs-title\">server<\/span> <span class=\"hljs-title\">certificate<\/span> <span class=\"hljs-title\">validation<\/span>. <span class=\"hljs-title\">If<\/span> <span class=\"hljs-title\">it<\/span> <span class=\"hljs-title\">is<\/span> <span class=\"hljs-title\">not<\/span> <span class=\"hljs-title\">provided<\/span>, <span class=\"hljs-title\">the<\/span> <span class=\"hljs-title\">hostname<\/span> <span class=\"hljs-title\">used<\/span> <span class=\"hljs-title\">to<\/span> <span class=\"hljs-title\">contact<\/span> <span class=\"hljs-title\">the<\/span> <span class=\"hljs-title\">server<\/span> <span class=\"hljs-title\">is<\/span> <span class=\"hljs-title\">used<\/span>\r\n      --<span class=\"hljs-title\">kube<\/span>-<span class=\"hljs-title\">token<\/span> <span class=\"hljs-title\">string<\/span>               <span class=\"hljs-title\">bearer<\/span> <span class=\"hljs-title\">token<\/span> <span class=\"hljs-title\">used<\/span> <span class=\"hljs-title\">for<\/span> <span class=\"hljs-title\">authentication<\/span>\r\n      --<span class=\"hljs-title\">kubeconfig<\/span> <span class=\"hljs-title\">string<\/span>               <span class=\"hljs-title\">path<\/span> <span class=\"hljs-title\">to<\/span> <span class=\"hljs-title\">the<\/span> <span class=\"hljs-title\">kubeconfig<\/span> <span class=\"hljs-title\">file<\/span>\r\n  -<span class=\"hljs-title\">n<\/span>, --<span class=\"hljs-title\">namespace<\/span> <span class=\"hljs-title\">string<\/span>                <span class=\"hljs-title\">namespace<\/span> <span class=\"hljs-title\">scope<\/span> <span class=\"hljs-title\">for<\/span> <span class=\"hljs-title\">this<\/span> <span class=\"hljs-title\">request<\/span>\r\n      --<span class=\"hljs-title\">registry<\/span>-<span class=\"hljs-title\">config<\/span> <span class=\"hljs-title\">string<\/span>          <span class=\"hljs-title\">path<\/span> <span class=\"hljs-title\">to<\/span> <span class=\"hljs-title\">the<\/span> <span class=\"hljs-title\">registry<\/span> <span class=\"hljs-title\">config<\/span> <span class=\"hljs-title\">file<\/span> (<span class=\"hljs-title\">default<\/span> \"\/<span class=\"hljs-title\">root<\/span>\/.<span class=\"hljs-title\">config<\/span>\/<span class=\"hljs-title\">helm<\/span>\/<span class=\"hljs-title\">registry<\/span>\/<span class=\"hljs-title\">config<\/span>.<span class=\"hljs-title\">json<\/span>\")\r\n      --<span class=\"hljs-title\">repository<\/span>-<span class=\"hljs-title\">cache<\/span> <span class=\"hljs-title\">string<\/span>         <span class=\"hljs-title\">path<\/span> <span class=\"hljs-title\">to<\/span> <span class=\"hljs-title\">the<\/span> <span class=\"hljs-title\">file<\/span> <span class=\"hljs-title\">containing<\/span> <span class=\"hljs-title\">cached<\/span> <span class=\"hljs-title\">repository<\/span> <span class=\"hljs-title\">indexes<\/span> (<span class=\"hljs-title\">default<\/span> \"\/<span class=\"hljs-title\">root<\/span>\/.<span class=\"hljs-title\">cache<\/span>\/<span class=\"hljs-title\">helm<\/span>\/<span class=\"hljs-title\">repository<\/span>\")\r\n      --<span class=\"hljs-title\">repository<\/span>-<span class=\"hljs-title\">config<\/span> <span class=\"hljs-title\">string<\/span>        <span class=\"hljs-title\">path<\/span> <span class=\"hljs-title\">to<\/span> <span class=\"hljs-title\">the<\/span> <span class=\"hljs-title\">file<\/span> <span class=\"hljs-title\">containing<\/span> <span class=\"hljs-title\">repository<\/span> <span class=\"hljs-title\">names<\/span> <span class=\"hljs-title\">and<\/span> <span class=\"hljs-title\">URLs<\/span> (<span class=\"hljs-title\">default<\/span> \"\/<span class=\"hljs-title\">root<\/span>\/.<span class=\"hljs-title\">config<\/span>\/<span class=\"hljs-title\">helm<\/span>\/<span class=\"hljs-title\">repositories<\/span>.<span class=\"hljs-title\">yaml<\/span>\")\r\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n","protected":false},"excerpt":{"rendered":"<p>The helm lint command is used to validate your Helm charts and detect potential issues or errors before deploying them to a Kubernetes cluster. This command takes a path to a chart and runs a series of tests to verify that the chart is well-formed. If the linter encounters things that will cause the chart&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","_joinchat":[],"footnotes":""},"categories":[2],"tags":[],"class_list":["post-39094","post","type-post","status-publish","format-standard","hentry","category-uncategorised"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/39094","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=39094"}],"version-history":[{"count":1,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/39094\/revisions"}],"predecessor-version":[{"id":39097,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/39094\/revisions\/39097"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=39094"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=39094"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=39094"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}