r/kubernetes • k8s operator • Jul 23 '24 • Heart of Silver 1

Finally, a viable Helm Replacement

I have a love-hate relationship with Helm. It’s straightforward for simple use cases, but creating Helm charts can be quite complex. Despite its utility, Helm has limitations and well-known issues.

Nelm, a part of the Werf project, is emerging as a promising alternative to Helm. It is a fully backwards compatible reimplementation of Helm, with improvements aimed at making it more robust and feature-rich.

This doesn't address the main issue of helm charts and go templating syntax, but I think it's a move in the right direction.

https://medium.com/@piotrzan/finally-a-viable-helm-replacement-388d538f9e1f

5 Upvotes

55 comments sorted by

80

u/RepulsiveRaisin7 Jul 23 '24

24

u/[deleted] Jul 23 '24

lol

6

u/ilya-lesikov Jul 24 '24

This is still work-in-progress. The "uninstall" action mostly uses the old Helm 3 logic, but we are going to reimplement it, just like we did with the "deploy" action (which is much more complex btw). Some parts of Helm, like template rendering logic, we do not intend to rewrite, no point.

Our main focus at the moment is on the deployment and release management, not the chart management or rendering subsystems.

3

u/RepulsiveRaisin7 Jul 24 '24

No worries, it's fine. It's just that the article uses terms like "rewrite" and "reimplementation", which I don't think is entirely accurate. But as I acknowledged in another comment, your project is much more clear that it's partially based on Helm.

1

u/piotr1215 k8s operator Jul 23 '24

I think partial reimplementation is what they called it with deployment subsystem made from scratch and other parts of the code improved. I would be surprised if they were no references to helm library at all.

4

u/distorhead Jul 24 '24

Furthermore, apart from reworking deployment process (making use of server-side-apply – which is by itself great), it introduces such features as deployment order, per resource - just for example. You can define order in which resources should be deployed and checked-for-readiness. This way an arbitrary deploy-pipeline could be specified just within resources in the helm-chart (using simple annotations), and chart still remains to be helm-compatible. Think about it and the impact it could have.

And this is just an example feature, there are more related to the control of deployment, making it transparent to the user and bringing better errors handling.

5

u/aigrychev Jul 23 '24 edited Jul 23 '24

Nelm has reworked the most critical part related to the deployment process. Nelm uses Server-Side Apply for resource updates, improves the mechanism of tracking resource status, makes the deployment process transparent for users, and adds deployment capabilities that Helm lacks.

5

u/yebyen Jul 23 '24

Do you want compatible or not?

You're not going to get backwards compatibility without reusing some of the code, at least not without an enormous expense. I actually was skeptical of this project, still am, but when I saw backwards compatibility I let my guard down and got optimistic.

Now that you're telling me it uses Helm itself under the hood, I'm even more interested.

A lot of Helm-related tools (eg. ArgoCD) just do not even attempt to be fully compatible, and it's a bit of a blight on the ecosystem. Helm users (chart authors) may avoid certain features because they do not enjoy broad support in every popular tool that people might use to consume the Helm chart.

Or worse, they don't avoid the feature, it blows up on someone who does not know why, and it results in an issue report that really belongs somewhere else. But that somewhere else has already said "wontfix" so it's every Helm chart author who suffers, or the end-users.

14

u/Recol Jul 23 '24

ArgoCD literally runs Helm template to install manifests from a chart, what do you mean not even attempt to be fully compatible?

8

u/yebyen Jul 23 '24

Take a look at the way they support post-install hooks. The post-sync hook is used instead, which is subtly different. It matters if you're using post-install or post-upgrade hooks to perform database migrations.

And Argo doesn't maintain the helm secret (because it's templating, not using helm SDK) so if you want to switch from ArgoCD helm templates to Helm itself, good luck doing that without wiping out the resources or spending hours to figure out what labels need to be applied to what resources in order to make it work.

(Why would anyone want to switch from ArgoCD to Helm? IDK, but that's not the question asked, it's either safely interchangeable or it's not.)

1

u/Recol Jul 26 '24

Thanks for replying back, that clarified what you meant. I knew the support for Helm hooks wasn't there for ArgoCD but didnt actually knew Flux supported them. We rarely have to use hooks as we use various operators instead for more advanced capabilities so guess I've never ran in to these issues.

1

u/yebyen Jul 26 '24

Yeah it's a niche feature that most people will probably never notice, and I talk about too often, which is why I didn't really feel the need to go into detail about it, but in this case (nelm) it highlights one of the useful parts of using Helm upstream SDK in your project, because there are a lot of weird niche behaviors in Helm, and most of them are pretty well thought-out. (Until they get munged into some completely different behavior!)

People focus on the templating when they are in development because diffs are super useful, when you are debugging Helm charts, and because the templates are literally strings, this happens often. People should focus on the stringlyness of Helm's templates, which is one of its worst misfeatures, (and we often wish it didn't work like this, but it does.)

Unfortunately we can't undo that, because of Helm's terrific popularity, it will take many years to replace it (if we even can! How do you replace a network effect? New network... that will be "after Kubernetes")

In production, the most useful and unique features of Helm (in the context of Kubernetes) are rollback / history, lifecycle hooks, and perhaps also tests. All of these are things you will compromise by templating and applying rather than using the Helm install/upgrade APIs. Try implement database migrations into your app without Helm and you'll see what I mean.

1

u/yebyen Jul 23 '24 edited Jul 23 '24

I can provide a reference later from the ArgoCD issues repo showing these are known issues and they recommend Flux+Helm Controller if you need perfect compatibility. (We even wrote Flamingo so you can get both at once, no compromises! Well, maybe some compromises.)

Edit: follow-up is in the replies

3

u/yebyen Jul 23 '24

Here's my blog about it (from a few days before I started at Weaveworks, to work on Flux):

https://blog.teamhephy.info/blog/posts/tutorials/argocd-sentry-apps.html

(Totally unbiased reporting™️) - sorry about the certificate error, I'll fix it.

Here's the reference I was promising:

Unfortunately this is unlikely to be fixed in ArgoCD, and maintainers recommend Helm Operator when perfect helm installations are needed.

6

u/RepulsiveRaisin7 Jul 23 '24

Building on Helm is fine, but it should be disclosed (which it is on the project's GitHub, it's just the article that is misleading). A wrapper is never a true replacement.

Personally I don't even want compatible because that leaves you unable to fix Helm's core flaws, namely Yaml templating and being imperative rather than declarative.

1

u/yebyen Jul 23 '24

Then you'll love timoni.sh (plug)

4

u/RepulsiveRaisin7 Jul 23 '24

Yea I've seen this, looks fantastic. CUE is the way to go.

2

u/Bnjoroge Jul 24 '24

eh don't think it'll ever become mainstream. dagger.io dropped their cue approach for more mainstream languages.

2

u/RepulsiveRaisin7 Jul 24 '24

Honestly yeah, I think CUE needs to be easier to learn, perhaps improve some of its syntax. I've written thousands of lines of CUE for an operator, but I've definitely struggled with it at times. But it's a small project with limited resources, no corporate sponsor behind it unfortunately.

But Kubernetes is special in that it requires a lot of templating, much more than your average CI pipeline. YAML templating is quite painful, I think we'd see a lot of people switching if Helm were to adopt CUE. Languages people already know are an easier sell, but I'd like to believe that the better technology does win eventually.

5

u/dshurupov k8s contributor Jul 24 '24

KCL (https://github.com/kcl-lang/kcl) seems to gain momentum now. A huge spark of interest from the cloud native community, according to the latest CNCF projects' velocity report.

1

u/Bnjoroge Jul 24 '24

good point! curious why you think highlevel languages never caught on for kubernetes provisioning?

2

u/RepulsiveRaisin7 Jul 24 '24

I tried templating in pure Go and it's pretty bad. More elegant languages like Python might be ok, but they let you do nearly anything, like fetching random things from the internet to mining bitcoin. I like a lightweight language like CUE that won't need a linter to prevent this kind of stuff.

7

u/miran248 k8s operator Jul 23 '24

So.. what exactly are you solving here?
I don't like the templating part of helm, helm itself is ok.
Charts are usually extremely verbose, hard to reason about and maintain.
They also have their own apis, meaning you need to understand not only the underlying apis but also the charts themselves, before you can actually use them!
What i'd like to see is smaller, simpler crds for deployments (and everything else, really), two levels of nesting max!
Affinities, taints, containers, pods, resources, probes, .. every domain should have its own crd - as a result charts (and other solutions) would be much more focused, each doing only one thing instead of everything imaginable..

3

u/piotr1215 k8s operator Jul 23 '24

In the blog, I mention several specific improvements that nelm brings to the table.

Templating part of helm is an interesting problem. On one hand it's tightly coupled to Go templating and on the other is widely adopted by the community. Changes to the helm charts structure, if not backwards compatible, will be unlikely. Your wishlist of simpler CRDs, limited nesting etc, is great and I would like it too, but this will not happen. One possible improvement is to add more abstraction layers over helm charts or automate their creation, and both approaches have their tools.

For better or worse we are stuck with helm charts as a packaging mechanism.

3

u/aigrychev Jul 23 '24

Developing and maintaining Helm charts is indeed a headache, and an alternative approach is needed (which is already in the plans of Nelm). However, this is manageable, unlike many issues and limitations with the Helm deployment process.

Helm’s deployment process has significant problems. It doesn’t always achieve the expected state (3WM in Helm 3 is far from perfect, and changes in this area might be only expected in the next major release) and lacks any feedback (logs, resource conditions, events, and so on).

In Nelm, we strive to solve the fundamental problems of Helm and provide users with additional capabilities.

4

u/miran248 k8s operator Jul 23 '24

Oh, so you're focusing on a totally different area, cool!
Personally i always use argocd which then handles 3rd party charts and kustomizations (which sometimes include helm template outputs).
I treat helm as necessary evil and try to get away from it the moment it's possible. Personal manifests are all kustomizations. Never deployed anything with helm directly.

4

u/aigrychev Jul 23 '24

Yes, that’s correct. Our focus is currently on creating a solid and feature-rich deployment process. We want users to have the flexibility to use both Pull and Push models for deployment, all while using a single configuration. In our view, the Push model is more convenient for application development and the setup of various review/dev environments.

11

u/maiznieks Jul 23 '24 edited Jul 24 '24

Hmm, nope. Go templating is still there.

5

u/aigrychev Jul 23 '24 edited Jul 23 '24

Indeed, Go templating is still there. Our main focus is currently on improving the deployment process, but we have plans to add alternatives in the nearest future.

2

u/davidmdm Jul 24 '24 edited Jul 24 '24

Shamelessly plugging my own sales-pitch here, since you are not a fan of Go Templating, what would you think about using straight Go? Or any other general purpose language to define your chart/package?

That's what yoke tries to do. It's also supports existing helm charts.

7

u/thockin k8s maintainer Jul 24 '24

And here I thought the problem with helm was that it forces you to define a bespoke API (the values file) which eventually has exactly as many fields as (or more than) the thing it is "abstracting", only with less structure, documentation, or tooling.

5

u/ilya-lesikov Jul 24 '24

That's one of the problems. I don't see many issues with values.yaml file as a module/chart configuration format, but it is true that with the more generic charts it all becomes complex and ugly.

Enforcing particular structure of values.yaml files to do some magic on our part does not seem feasible. I think the only solution here could be a more dynamic approach to manifest generation, which can be achieved with general-purpose languages or maybe some specialized languages instead of Go templating.

2

u/thockin k8s maintainer Jul 24 '24

Kustomize has its flaws, but (IMO) it's better in that it doesn't try to be a generic template.

3

u/Long-Ad226 Jul 24 '24

IMO the only viable helm replacement is kustomize

3

u/aigrychev Jul 24 '24

Helm is not just about Charts with Go templates; it’s also about release management. The current development phase of Nelm focuses more on the deployment process itself. However, adding kustomize-like capabilities (patching step) and also an alternative mechanism for organizing Charts are in our plans.

2

u/Long-Ad226 Jul 24 '24

How can Helm Help with releases based on conventional commits and semver like example releaseplease does? I never heard of that

1

u/aigrychev Jul 24 '24

Helm does not offer any versioning strategies or automate this process. However, Helm allows users to manage application releases by providing the ability to deploy, upgrade, and rollback versions of their applications. 

1

u/Long-Ad226 Jul 24 '24

Thats the Job of argocd and one of the reasons why it only uses Helm as template mechnism. Helm releases with those Release Secrets are awful.

1

u/aigrychev Jul 24 '24

I agree, the 1MB limit on Secrets can indeed be painful at times. Regarding ArgoCD, the Pull model is excellent for infrastructure components, but during active application development, we still prefer the Push model (especially for temporary review/dev environments).

Our focus is currently on creating a solid and feature-rich deployment process. We want users to have the flexibility to use both Pull and Push models for deployment, all while using a single configuration.

1

u/Long-Ad226 Jul 24 '24

I dont get what you mean with pull and push model in reference to that, but creating temporary environments with argocd is usually just creating a new branch in the correct repo via cicd and delete this branch with its argocd application when its not needed anymore.
Argocd applies Manifests to the cluster and keeps them in sync, Tekton or Argo Workflows updates, creates and deleteds Manifests in repo (which argocd then applies or deletes) its simple as that, there is no place for helm imo.

The 1 MB Limit is nothing compard to the situation that your actual helm release is broken and you can't update the helm release because someone forgot:

"The Helm documentation describes the problem when Helm releases that are already deployed with APIs that are no longer supported. If the Kubernetes cluster (containing such releases) is updated to a version where the APIs are removed, then Helm becomes unable to manage such releases anymore. It does not matter if the chart being passed in the upgrade contains the supported API versions or not."

luckily der is a tool for that situation: https://github.com/helm/helm-mapkubeapis#background-to-the-issue

2

u/aigrychev Jul 24 '24 edited Jul 24 '24

Yes, and this is far from the only problem related to how Helm handles releases and the 3-Way Merge (3WM) mechanism. In Nelm, we have changed this mechanic and moved to Server-Side Apply (SSA). This transition provides a more reliable and robust way to manage updates and ensures better compatibility and control over resource changes.

We find the Push model more convenient for application development because it offers more immediate feedback and control during the active development phase and users do not need anything in the cluster.

UPD:

To clarify what I mean by deployment models:

  • Pull Model: Any operator (such as ArgoCD or Flux) continuously syncs the desired state from the source (git repository or container registry) to the cluster.

  • Push Model: This is where the user or the CI/CD pipeline directly applies changes to the cluster.

1

u/Long-Ad226 Jul 24 '24

"This is where the user or the CI/CD pipeline directly applies changes to the cluster."

Sorry but noone should do that, thats just wrong in 2024, this is completly out of gitops and nothing what cicd does should be out of gitops as today

Also refering to push vs pull model in this case is wrong imo, because you push too with cicd with argocd, you just dont 'push' directly to the cluster, you push into git repos

2

u/aigrychev Jul 24 '24

GitOps is not a silver bullet. The choice between Pull, Push, or hybrid models depends on specific needs and requirements.

→ More replies (0)

2

u/phobicbounce Jul 23 '24

Is anyone using cdk8’s?

1

u/[deleted] Jul 23 '24

[removed] — view removed comment

2

u/e_safak Aug 11 '24

It looks dead. I only see bot commits in the past few months: https://github.com/cdk8s-team/cdk8s/commits/master/

0

u/dashingThroughSnow12 Jul 23 '24

Sure it is fully backwards compatible……

5

u/ilya-lesikov Jul 24 '24

With the amount of changes we introduce (e. g. the deployment subsystem made from scratch with a lot of new features) it's not easy to provide 100% backwards compatibility, but we strive for it. The goal is to deploy 99 out of 100 Helm charts with Nelm with 0 changes to the charts, and I'd say we are pretty close to that.

1

u/dashingThroughSnow12 Jul 24 '24

So you are close to almost compatible? Why not put that claim instead?

I’m saying, I’m not picking on you. I just dislike this industry’s lax definition of compatible, superset, etcetera.

2

u/dshurupov k8s contributor Jul 25 '24

I don't think that the Nelm project itself claimed being fully backwards compatible anywhere.