<p>I've seen some examples of <code>helm</code> charts and it looks like some values are encoded to base64 (<code>{{ .Values.name | b64enc }}</code>).<br>
<strong>Why and when</strong> should it be used?   </p>

SagiLow
<p>In most cases, you will see them used when creating <code>Secret</code> objects. This is because <a href="https://kubernetes.io/docs/concepts/configuration/secret/#creating-a-secret-manually" rel="nofollow noreferrer">secrets use base64 encoding by default</a>.</p>

<p>You can have a look at <a href="https://github.com/helm/charts/blob/0238e09deae814ea128e2ff75729d6f6704a8fb3/stable/chartmuseum/templates/secret.yaml#L15" rel="nofollow noreferrer">a secret in ChartMuseum's stable helm chart</a> to verify.</p>

<p>Another usage is on <a href="https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#webhook-configuration" rel="nofollow noreferrer">webhook configurations</a>. Webhook definitions have a <code>caBundle</code> field, which requires a PEM certificate. Since PEM certificates are base64 encoded DER certificates, it is also common to see b64enc there as well. <a href="https://github.com/helm/charts/blob/cbd5e811a44c7bac6226b019f1d1810ef5ee45fa/stable/stash/templates/mutating-webhook-configuration.yaml#L18" rel="nofollow noreferrer">An example from the stable Helm chart of Stash</a>.</p>

<p>You can discover more use cases on the Helm charts repository, by <a href="https://github.com/helm/charts/search?p=1&amp;q=b64enc&amp;unscoped_q=b64enc" rel="nofollow noreferrer">searching for b64enc</a> usages.</p>
