Helm Accessing Arbitrary Files inside Templates: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(9 intermediate revisions by the same user not shown)
Line 4: Line 4:
=Internal=
=Internal=
* [[Helm_Templates#Files|Helm Templates]]
* [[Helm_Templates#Files|Helm Templates]]
* [[Helm_ConfigMap_and_Secrets#Overview|Helm ConfigMap and Secrets]]


=Overview=
=Overview=


The <code>Files</code> object provide access to all non-special files in the chart. It cannot be used to access templates. The access is provided via several [[#Functions|functions]].
It is OK to add extra files to the Helm chart. These files will be bundled. However, charts must be smaller than 1M because of storage limitation of Kubernetes objects. The <code>Files</code> object provide access to all non-special files in the chart. It cannot be used to access templates. Also, files excluded in <code>[[Helm Chart .helmignore|.helmignore]]</code> cannot be accessed. Charts do not preserve UNIX mode information, so file-level permissions will have no impact on the availability of a file when it comes to the <code>.Files</code> object.
 
Sometimes it is desirable to import a file '''that is not in a template''' and inject its contents without sending the contents through the template renderer.
 
The access is provided via several [[#Functions|functions]].


=Functions=
=Functions=
Line 14: Line 19:
  &#123;{ .Files.Get <''file-name''> }}
  &#123;{ .Files.Get <''file-name''> }}
</font>
</font>
<font color=darkkhaki>TODO</font>
==<tt>Files.GetBytes</tt>==
==<tt>Files.GetBytes</tt>==
<font color=darkkhaki>TODO</font>
==Path Helpers==
{{External|https://helm.sh/docs/chart_template_guide/accessing_files/#path-helpers}}
<font color=darkkhaki>TODO</font>

Latest revision as of 19:16, 2 March 2022

External

Internal

Overview

It is OK to add extra files to the Helm chart. These files will be bundled. However, charts must be smaller than 1M because of storage limitation of Kubernetes objects. The Files object provide access to all non-special files in the chart. It cannot be used to access templates. Also, files excluded in .helmignore cannot be accessed. Charts do not preserve UNIX mode information, so file-level permissions will have no impact on the availability of a file when it comes to the .Files object.

Sometimes it is desirable to import a file that is not in a template and inject its contents without sending the contents through the template renderer.

The access is provided via several functions.

Functions

Files.Get

{{ .Files.Get <file-name> }}

TODO

Files.GetBytes

TODO

Path Helpers

https://helm.sh/docs/chart_template_guide/accessing_files/#path-helpers

TODO