Live data from Hacker News

Yoke: Infrastructure as code, but actually

xeiaso.net

21–30 of 169 posts

Re: Yoke: Infrastructure as code, but actually

#21

>> Wait, there's something here that I'm not getting. Why are you compiling the code to WebAssembly instead of just running it directly on the server? > Well, everything's a tradeoff. Let's imagine a world where you run the code on the server directly. > If you're using a language like Python, you need to have the Python runtime and any dependencies installed. This means you have to incur the famous wrath of pip (pip…

> At this point, why not use a proper runtime like JVM or .Net?

Because then you are forced to only use managed languages?

Re: Yoke: Infrastructure as code, but actually

#22
I'm quite happy with CDK[0].

My experience is only with the main AWS cloudformation based version of CDK, although there is also CDK for terraform, which supports any resource that terraform supports, although some of what I'm about to say is not applicable to that version.

What I like about CDK, is that you can write real code, and it supports a wide range of languages, although typescript is the best experience.

Provided that you don't use any of the `fromLookup` type functions, you can run and test the code without needing any actual credentials to your cloud provider.

CDK essentially complies your code into a cloudformation template, you can run the build without credentials, then deploy the built cloudformation template separately.

You don't need to worry about your terraform server crashing half way though a deployment, because cloudformation runs the actual deployment.

[0]: https://github.com/aws/aws-cdk

Re: Yoke: Infrastructure as code, but actually

#23

>> Wait, there's something here that I'm not getting. Why are you compiling the code to WebAssembly instead of just running it directly on the server? > Well, everything's a tradeoff. Let's imagine a world where you run the code on the server directly. > If you're using a language like Python, you need to have the Python runtime and any dependencies installed. This means you have to incur the famous wrath of pip (pip…

> At this point, why not use a proper runtime like JVM or .Net? Because then you are forced to only use managed languages?

Ahh, good point.

I guess Rust (and maybe other unmanaged languages) can be compiled to WebAssembly?

Re: Yoke: Infrastructure as code, but actually

#24

Earlier quoted context omitted.

> At this point, why not use a proper runtime like JVM or .Net? Because then you are forced to only use managed languages?

Ahh, good point. I guess Rust (and maybe other unmanaged languages) can be compiled to WebAssembly?

Yes:

Go: https://go.dev/blog/wasi

Rust: https://github.com/bytecodealliance/wasmtime/blob/main/docs/...

Re: Yoke: Infrastructure as code, but actually

#25
> If you really do think that Terraform is code, then go try and make multiple DNS records for each random instance ID based on a dynamic number of instances. Correct me if I'm wrong, but I don't think you can do that in Terraform.

You’re wrong. You can do that with Terraform.

You can also provision stuff that isn’t just k8s.

Re: Yoke: Infrastructure as code, but actually

#26
> If you're using a language like Go, you need to have either the Go compiler toolchain installed or prebuild binaries for every permutation of CPU architecture and OS that you want to run your infrastructure on. This doesn't scale well.

This is exactly the approach that Terraform takes. Both Terraform and its providers are written in Go, which is a great language for this purpose because of GoReleaser and the ease of compiling to different architectures and OSes. It scales just fine.

Did the author talk to any senior Terraform practicioners before building this?

Re: Yoke: Infrastructure as code, but actually

#27
Speaking of IAC- I have an existing GCP project with some basic infra (service accounts, cloud run jobs, cloud build scripts, and databases) what is the best tool to _import_ all of this into IAC. The only real tool I’ve found is terraformer. I have no dog in the race regarding tooling e.g if my output is Pulumi, terraform, or just straight YAML. I’m just looking to “codify” it.

Any suggestions from experience?

Re: Yoke: Infrastructure as code, but actually

#28
post #7

Looks promising but it starts with a (justified) rant about terraform and then goes into how to replace Helm. I am confused. Can yoke be used to create and manage infrastructure or just k8s resources?

It’s just a dunk on terraform to promote yet another K8s provisioning thing.

Re: Yoke: Infrastructure as code, but actually

#29
post #7

Looks promising but it starts with a (justified) rant about terraform and then goes into how to replace Helm. I am confused. Can yoke be used to create and manage infrastructure or just k8s resources?

Indeed. This isn't really a replacement for terraform, unless you are only using terraform to manage k8s resources. Which probably isn't most people who are currently using Terraform.

Re: Yoke: Infrastructure as code, but actually

#30

Earlier quoted context omitted.

> At this point, why not use a proper runtime like JVM or .Net? Because then you are forced to only use managed languages?

Ahh, good point. I guess Rust (and maybe other unmanaged languages) can be compiled to WebAssembly?

https://logandark.net/calc is C++ compiled to WebAssembly using Emscripten. Back from I think 2018.

These days Rust is practically the poster child of compiling to WebAssembly because it's so easy. Most WASM content I see is actually about Rust.

Post reply on HN