4 ms·
As many people predicted years ago (I can't claim to know k8s that well, in fact I suck at it), eventually we'll go full circle and k8s config will just become
by pdimitar 4y ago
As many people predicted years ago (I can't claim to know k8s that well, in fact I suck at it), eventually we'll go full circle and k8s config will just become its own specialized programming language.
Maybe we should stop moving these things so agonizingly slow and through the path of natural (and did I mention slow as molasses) evolution and just skip to the endgame that most of us know will inevitably come?
Apparently not.
I'd like to see Google being more brave here. They are on the forefront of k8s in many ways (or so it seems, maybe I am wrong?). Just make a specialized programming language with a good compiler / linter and let's all collectively be better for it.
- cyberpunk 4y agoWhy do you need a 'specialized programming language' when kube for most people, is just waiting for various objects via api? I mean, sure, ATM it can be a bit painful to generate your 'Deployment' object in json or yaml or whatever, but then it's just a post to the kubeapi and it's done.. You can do that in any language you want.. What am I missing?
- pdimitar 4y agoYou're missing the part where people do this periodically and can never truly remember all the gotchas so they make small mistakes with time that at one point make your cluster fall over with cryptic error messages. I've seen it (but as I said above I am by no means a k8s pro). That's why there are these linters. Having a small super-specialized language that catches errors before "compiling" your configuration to an YAML will help hugely.
- adamgordonbell 4y agoDhall for kubernetes might be what you are looking for. https://github.com/dhall-lang/dhall-kubernetes https://github.com/dhall-lang/dhall-kubernetes
- pdimitar 4y agoHa, nice, I'll take a look -- thanks.
- phailhaus 4y agoThere's no reason to create an entirely new language. Since k8s manifests can be represented in JSON, you can use existing templating languages like Jsonnet [1] in order to generate it for you. All we need is an official library. [1] https://jsonnet.org/ https://jsonnet.org/
- vbezhenar 4y agoJSON is terrible to write by hand. YAML is terrible too. There should be an official and sane language which will map to YAML 1:1. We don't write Java code in YAML for a reason.
- jrockway 4y agoJsonnet is the language that maps to YAML 1:1. The output happens to look like JSON, but JSON is a subset of YAML. I've used Jsonnet for non-k8s stuff (envoy bootstrap configs), and it is really great. For example, this: https://github.com/pachyderm/pachyderm/blob/master/etc/generate-envoy-config/envoy.jsonnet https://github.com/pachyderm/pachyderm/blob/master/etc/gener... generates this: https://github.com/pachyderm/pachyderm/blob/master/etc/helm/pachyderm/envoy.json https://github.com/pachyderm/pachyderm/blob/master/etc/helm/...
- ninkendo 4y agoThere was a tool called ksonnet for this (jsonnet + a default library for k8s configs), but the company behind it got bought and it's no longer maintained: https://github.com/ksonnet/ksonnet https://github.com/ksonnet/ksonnet
- bboreham 4y agoA spiritual / practical successor is Tanka http://tanka.dev http://tanka.dev (Note I work for Grafana Labs who fund Tanka and use it for all production config)