7 ms·
Helm charts are declarative way of deploying app(s) and their accompanying resources.
by ognyankulev 6y ago
Helm charts are declarative way of deploying app(s) and their accompanying resources.
- q3k 6y agoHelm, however, is objectively terrible with its yaml-based templating language and zero practical modularity.
- speedgoose 6y agoIndeed. Helm offers great features but it suffers from the kubernetes unnecessary complexity and by using golang templates in YAML. When I started with kubernetes I converted my small Docker compose files to kubernetes files. Later I rewrote everything in helm charts. Now it's almost more YAML and golang templates lines than business logic lines in my applications. I'm considering to go back to Docker compose files. It's simple, readable, and easy to maintain.
- q3k 6y agoHighly recommend trying Jsonnet (via https://github.com/bitnami/kubecfg https://github.com/bitnami/kubecfg and https://github.com/bitnami-labs/kube-libsonnet https://github.com/bitnami-labs/kube-libsonnet) as an alternative. It makes writing Kubernetes manifests much more expressive and integrates better with Git/VCS based workflows. Another language like Dhall or CUE might also work, but I'm not aware of a kubecfg equivalent for them. Jsonnet in general is a pretty damn good configuration language, not only for Kubernetes. And much more powerful than HCL.
- kraig 6y agoFunny, I thought jsonnet was an even worse experience than templating yaml
- q3k 6y agoMy experience with jsonnet varied: there's good jsonnet code, and there's bad one, too. Just like with any programming language, you have to apply good software engineering practices. Text templated YAML, however, is terrible by design.
- p_l 6y agoThe problem with templating YAML is that you're templating text, in a very sensitive to whitespace syntax. By definition, Jsonnet avoids that because it operates on the data structure, not on their stringified representation.
- threentaway 6y agoIf you like those, I'd take a look at Grafana's Tanka [0]. It also uses jsonnet but has some additional features such as showing a diff of your changes before you apply, easy vendored libraries using jsonnet-bundler, and the concept of "environments" which prevents you from accidentally applying changes to the wrong namespace/cluster. [0] https://github.com/grafana/tanka https://github.com/grafana/tanka
- q3k 6y agoI looked at it, I don't like it for the same reason as I dislike many other tools in this space: it imposes its own directory structure, abstraction (environments) and workflow. I'm a fan of the kubecfg-style approach, where it lets you use whatever sort of structure makes sense for you and your project. It's a 'framework' vs 'library' thing, but in the devops context.
- dilyevsky 6y agoI worked on this at previous gig - https://github.com/cruise-automation/isopod https://github.com/cruise-automation/isopod Same use-case but uses Starlark dsl instead of jsonnet
- AlphaSite 6y agoIve found the whole k14s eco system is pretty great to (ytt + kbld + kapp).
- q3k 6y agoytt is even more templating-yaml-with-yaml, so it all ends up being a bargain bin Helm. There's no reason to do this over just serializing plain structures into YAML/JSON/...
- AlphaSite 6y agoIt avoids the whole set of issues you get with templating yaml with helm since its structure aware. Also you can actually write pure code libraries in starlark (basically a subset of Python)
- q3k 6y agoI'm aware, but I just don't understand the point of it. How is it in any way better than a purpose-specific configuration language like Dhall/CUE/Jsonnet? What's the point of having it look like YAML at all?
- sandGorgon 6y agoWe just moved to the kubernetes ecosystem - specifically for integration with spot instances of AWS (and cut our costs by 60%). But I hate the UX of kubernetes. Compose was beautiful. I have hope - since compose files have become an independent specification. https://www.docker.com/blog/announcing-the-compose-specification/ https://www.docker.com/blog/announcing-the-compose-specifica... Kubernetes distro built around the compose file specification would be a unicorn.
- namelosw 6y agoSometimes I even wish they could embed a JavaScript interpreter... After all, YAML is almost equivalent to JSON, which the perfect templating language for JSON is -- JavaScript tbh. Or people have to keep inventing half baked things.
- q3k 6y agoThe problem isn't JSON or YAML: it's text templating serialization formats, instead of just marshalling/serializing them.
- AaronFriel 6y agoThere is a tool called Pulumi that does exactly that, and it's excellent.
- justinsaccount 6y agojson is already valid yaml
- ramaro 6y agohttps://kapitan.dev/ https://kapitan.dev/ is the one-stop shop that covers for true declarative configuration with either jsonnet, python (kadet) and jinja, amazing secret management with support of gkms, awskms, gpg, vault. It can also render helm charts! It is simpler than other tools, because you can get started without even touching jsonnet or python or anything else, when using our generators. It does more than all the other tools combined, as it replaces helm+helmfile+gitcrypt or kustomize. It’s universal, so you can use it on non-kubernetes situations where other tools leave you high and dry. With the new generator library, you can have 1 template and use it to configure many services. Check our examples at https://github.com/kapicorp/kapitan-reference https://github.com/kapicorp/kapitan-reference We have just released: * https://github.com/kapicorp/kapitan-reference https://github.com/kapicorp/kapitan-reference a repo with examples for quick-start. It includes our generator as explained in https://medium.com/kapitan-blog/keep-your-ship-together-with-kapitan-d82d441cc3e7 https://medium.com/kapitan-blog/keep-your-ship-together-with... * https://github.com/kapicorp/tesoro https://github.com/kapicorp/tesoro a secret “webhook controller” to seamlessly handle Kapitan secrets in your cluster. Better than sealed-secrets because there is no need to convert secrets and it supports KMS like google and aws together. Get started with our blog: https://medium.com/kapitan-blog https://medium.com/kapitan-blog or join our kubernetes slack on #kapitan
- orthoxerox 6y agoIt is. But k8s has no convenient way of parameterizing releases that can beat Helm. A simple stateless application needs: - a deployment - a service - an ingress - a config map (or several) - a secret (or several) It's even worse for stateful applications. And each of the resource definitions is 60% boilerplate, 35% application-specific and 5% release- or environment-specific. Helm would probably be a nice and neat tool if it had stopped at maintaining a simple map of variable names to values. But since applications need things like "if the user said SQLite, add a pvc, a configmap and a secret and refer to them in the ss, if she said Postgres, go pull another chart, deploy it with these parameters, then add this configmap and this secret and refer to them in the ss", Helm is an overcomplicated mess.
- f355 6y agok8s has a very convenient built-in way of parametrizing releases called kustomize, it is supported by kubectl since quite a few versions ago.
- ianlevesque 6y agoMaybe I was doing it wrong but every guide was verb based - “helm install X”. My declarative ideal ended up being a text file full of helm install commands and that wasn’t what I wanted.
- rochacon 6y agoQuick-start guides takes the easiest path to get something running, which is `helm install` in the Helm world. If you want to have complete control of what you're pushing to the API, use Helm as an starting point instead, run `helm template` and save the YAML output to some file, publish it using `kubectl` or some other rollout tool. I recommend using `kapp` [1] for rollouts. [1] https://get-kapp.io/ https://get-kapp.io/
- halbritt 6y agoThis is precisely how Spinnaker behaves with Helm. It renders the template into manifests and then deploys them. Kinda loses the benefit of Helm hooks, but if one is using Spinnaker, there are other ways to do the same thing hooks can do.
- phlakaton 6y agoHelm charts, round these parts, are a glorified yet byzantine templating system to spit out K8s manifests.
- rayanimesh 6y ago> Helm charts are declarative way of deploying app(s) and their accompanying resources. How do you make helm chart deployment declarative? `helm install` is not declarative (in my understanding `kubectl apply` is declarative and `kubectl create` is not. Let me know if my understanding of declarative is wrong). Thanks.
- deleted 6y ago[deleted]
- sciurus 6y ago`helm template | kubectl apply` ?
- rayanimesh 6y agoThis is one way of doing declarative using helm, but this doesn't guarntee resource creation order. `helm install` creates resources in order while `kubectl apply` creates in order of alphabetically filename. This may lead to some unexpected issues.
- meitham 6y agoI think you’re confusing “declarative” with “idempotent”! The helm equivalent to “kubectl apply” is “helm upgrade —-install”.
- rayanimesh 6y agoYes. Thank you.