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

Alternative to Go templates #54

Open
ilya-lesikov opened this issue Jul 24, 2024 · 1 comment
Open

Alternative to Go templates #54

ilya-lesikov opened this issue Jul 24, 2024 · 1 comment

Comments

@ilya-lesikov
Copy link
Member

Problem

Go templates which are used to generate Kubernetes manifests in Helm are difficult to write, read, debug and maintain. They have issues with performance, values mutability, template name collisions and others.

Solution (if you have one)

From what we know, Go templates cannot be improved much. We could add a few template functions to the library, the tooling can be improved, but not much else.

We should consider an alternative to Go templating in Nelm. This can be one of:

  • General-purpose language (TypeScript, Python, ...)
  • Specialized language (Cue, KCL, ...)
  • Templating language

Another templating language won't solve much, so we left with general-purpose languages and specialized languages like Cue.

Additional information

Helm 3 has --post-renderer flag which allows usage of any other language to generate manifests, but it is rarely used due to:

  1. Chart developers can't enforce usage of specific post-renderer with a specific configuration for their chart. They must provide instructions to the chart consumers on how to manually set up the post-renderer and how to run it. Go templating works out-of-the box and requires no configuration.
  2. Ability to use any language results in chart consumers potentially required to learn many different languages just for Kubernetes manifest generation.
@shurup
Copy link
Member

shurup commented Jul 25, 2024

Specialized language

KCL is gaining momentum in the cloud native community right now. It joined CNCF last September only. According to the latest CNCF projects' velocity reports, it had:

  • 40 authors and 2632 commits during Jan'2023 — Jan'2024 (106th CNCF project by velocity);
  • 72 authors and 2876 commits during Jul'2023 — Jul'2024 (68th).

Can't find an up-to-date list of new projects adopting it, though.

CUE is used by Timoni, so we can get some feedback from its users to see whether it's a good fit.

@shurup shurup mentioned this issue Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants