News for hackers. Stuff that matters.
Re:Can We Just Cut to Infrastructure-as-Declarative-Code? by dpc_pw on Sunday November 17, 2019 @06:17PM (#21560713)
I really like k8s itself and I think these yaml files are a great API layer, but the way people produce these files nowadays (templating systems and a lot of glue like helm) is a joke and in a real, even mildy complex environment becomes a terrible mess really quickly. What I really want is a typed programming language, where using normal code we describe how to produce all these yaml-described k8s resources using whatever abstractions make sense in our business.

Twitter thread I had about it a while ago: https://twitter.com/dpc_pw/status/1182022825361625088

Re:Can We Just Cut to Infrastructure-as-Declarative-Code? by lukehoban on Sunday November 17, 2019 @06:40PM (#21560826)
> What I really want is a typed programming language, where using normal code we describe how to produce all these yaml-described k8s resources using whatever abstractions make sense in our business.

This is more or less exactly what we’re working on at Pulumi. Using a language like TypeScript to describe Kubernetes infrastructure provides a nice mix of simple JSON-like resource definition, strong typing, and the ability to use variables, loops, functions, classes, packages, test frameworks, and more from an expressive general purpose programming language. You still have access to the full fidelity of the raw Kubernetes API, but also all the tools you need to apply proper software engineering on top of it.

https://www.pulumi.com/kubernetes/

Re:Can We Just Cut to Infrastructure-as-Declarative-Code? by lidHanteyk on Monday November 18, 2019 @03:26AM (#21562732)
Huh, why build an entirely proprietary language for this? There are existing toolchains that bend existing rich configuration languages, like Nix [0] or Dhall [1], to produce Kubernetes object definitions. In this way, not only can existing libraries be leveraged, but no new semantics have to be learned, and no third party needs their palms crossed.

This had to be pointed out; Pulumi's docs repeat the adjective "real", as if its competitors aren't real. "real code", "real package management" [2], "real languages" [3], "real programming model" [4]... Nix and Dhall are quite real, though. So is this an incomplete survey, or are Pulumi's docs unrealistically self-aggrandizing? TBH even just this one paragraph of yours is pretty tough to stomach, as if loops and functions in a configuration language were a novel concept.

[0] https://github.com/xtruder/kubenix

[1] https://github.com/dhall-lang/dhall-kubernetes

[2] https://www.pulumi.com/docs/intro/vs/k8s_yaml_dsls/

[3] https://www.pulumi.com/docs/intro/vs/chef_puppet_etc/

[4] https://www.pulumi.com/docs/intro/vs/custom/

Re:Can We Just Cut to Infrastructure-as-Declarative-Code? by leonth on Monday November 18, 2019 @06:03AM (#21563342)
I would imagine that a "real programming language" here means not only any Turing-complete language but also a language that has been consistently at the top 10 most popular programming languages in the world for a while (which javascript is, and typescript is its superset).
Re:Can We Just Cut to Infrastructure-as-Declarative-Code? by lidHanteyk on Monday November 18, 2019 @08:46AM (#21564231)
I would hope that we can do better than that. Both Nix and Dhall are designed for readability in the limited niche of configuration management, and their authors considered that design choice to be important enough on its own to merit a new language. Dhall is explicitly not Turing-complete.
Re:Can We Just Cut to Infrastructure-as-Declarative-Code? by dpc_pw on Sunday November 17, 2019 @07:59PM (#21561145)
"We're"? Oh. So I have one question - what's the deal with Pricing then? What's the line exactly between "take it for free" and "pay us some well deserved money for our hard work"?

Anyway - from what you're saying, that's exactly what I'm looking for.

Re:Can We Just Cut to Infrastructure-as-Declarative-Code? by jmillikin on Sunday November 17, 2019 @07:37PM (#21561071)
If you're willing to relax the "Turing-complete" part, and do a bit of final assembly yourself, you might try https://github.com/stripe/skycfg which uses the Python-like Starlark language.

Cruise built a more complex DSL on top of it: https://github.com/cruise-automation/isopod

Re:Can We Just Cut to Infrastructure-as-Declarative-Code? by datashaman on Sunday November 17, 2019 @08:20PM (#21561215)
https://github.com/cuelang/cue seems to do some of what you need. Disclaimer: I've not used it, just seen it touted for this purpose.
Re:Can We Just Cut to Infrastructure-as-Declarative-Code? by mrorbitman on Sunday November 17, 2019 @08:18PM (#21561206)
> What I really want is a typed programming language, where using normal code we describe how to produce all these yaml-described k8s resources using whatever abstractions make sense in our business

For what it's worth, that's what AWS cdk is. Not for k8s but for AWS CloudFormation yaml templates. https://docs.aws.amazon.com/cdk/latest/guide/home.html

Re:Can We Just Cut to Infrastructure-as-Declarative-Code? by igetspam on Sunday November 17, 2019 @10:23PM (#21561662)
I had high hopes for CDK but after following the recommended path for a not very complex deployment and ending up with 3x more code than terraform, I had to declare it unfit for mass consumption. I spoken with my rep about it and he tried really hard to steer away from it because they know it's just not there yet. It's better than CFN but only because it's not plain yaml. As it matures, if they can get community buy in, I'm sure it'll be good enough but I'd leave it alone for now.
Re:Can We Just Cut to Infrastructure-as-Declarative-Code? by ones_and_zeros on Sunday November 17, 2019 @06:27PM (#21560762)
Any reason pulumi, per the twitter thread, doesn't meet your needs?
Re:Can We Just Cut to Infrastructure-as-Declarative-Code? by dpc_pw on Sunday November 17, 2019 @06:31PM (#21560780)
I still haven't got to trying it. I'm a bit suspicious, because it look like a SaaS kind of thing, while I was looking just for an open source tool to write some code that will spit out bunch of `yaml` files to feed to `kubectl`.
Re:Can We Just Cut to Infrastructure-as-Declarative-Code? by eropple on Sunday November 17, 2019 @08:12PM (#21561188)
The runner is free, as is the tool chain. One of my employers has paid money for the SaaS state management; two others have not. We’ve gotten by just fine.
Re:Can We Just Cut to Infrastructure-as-Declarative-Code? by dpc_pw on Sunday November 17, 2019 @08:54PM (#21561332)
Thanks for explaining!
Re:Can We Just Cut to Infrastructure-as-Declarative-Code? by ahnick on Sunday November 17, 2019 @11:56PM (#21561988)
I am also suspicious as well. The biggest turn off for me initially was the fact that you had to login to use even the free tool. Apparently though this has been addressed somewhat overtime. (https://www.reddit.com/r/devops/comments/bcdwsn/pulumi/)