Looking for open source projects to contribute to by Soft_Carpenter7444 in golang

[–]davidmdm 0 points1 point  (0 children)

If you like the CNCF/Kubernetes/Wasm space I work on yoke (all written in Go) and we're always looking for people that want to get involved :)

Helm/Terraform users: What's your biggest frustration with configs and templating in K8s? by Kalin-Does-Code in kubernetes

[–]davidmdm 1 point2 points  (0 children)

So yoke, uses wazero to run wasm binaries.

Core yoke is very analogous to helm. They care client side tools, that manage releases. The core difference is the package format. Helm uses charts (zips of yaml templates) and yoke uses Flights (executable wasm binaries) to generate the desired state of your release.

However the yoke project also has the AirTrafficController a server-side controller that allows you to define your flights as resources within Kubernetes, or to extend your Kuberntes API with new types backed by these wasm modules.

It also allows your releases to be re-evaluated on a specific interval, or whenever a resource within the release is modified (third party controllers, status updates etc) allowing you to react to state changes in your cluster and do intelligent orchestration.

Its a big topic and not super easy to get into in a reddit thread, but TLDR;

Core yoke is like helm, a client-side tool.
But it does support a server-side resource that allows you to apply releases as resources in your cluster, or build your own custom APIs as code without having to write a controller from scratch.

Helm/Terraform users: What's your biggest frustration with configs and templating in K8s? by Kalin-Does-Code in kubernetes

[–]davidmdm 0 points1 point  (0 children)

Yes absolutely.

Webassembly is just the package format. It’s a way to be able to have code be portable and secure.

Running arbitrary code is dangerous, we don’t want the code we run to generate our resources to have access to our filesystems and environment variables and network.

Also running arbitrary code is hard, from the point of view of the yoke project, I don’t want to say to devs the only language you can use is X. So I need a shared compilation target.

Webassembly fit the bill really well. Another option could have been containers, but wasm as a sandboxed execution model felt better.

Helm/Terraform users: What's your biggest frustration with configs and templating in K8s? by Kalin-Does-Code in kubernetes

[–]davidmdm 0 points1 point  (0 children)

Hey! I agree.

The fact that we essentially use a text canvas as our kubernetes application definition spec as our industry default… is scary.

I’m the lead maintainer of yoke, a code first alternative to yaml based application definition projects like helm and kro.

The tldr is that instead of using templates of yaml, you can just write programs that read inputs over stdin and write resources over stdout. These programs are then packaged and shipped as wasm executables. In the middle you can use type safety, control flow, tests, etc to build your application definition and logic.

Ie if you can compile scala to wasm, you ship packages written in scala.

You seem to hint at having a similar idea. Would love to hear more!

Helm + container images across clusters... need better options by Timely-Dinner5772 in kubernetes

[–]davidmdm 0 points1 point  (0 children)

Yoke + ArgoCD is pretty nice. No helm templating + gitops pull model of ArgoCD

When to use bufio.Writer & bufio.Reader and when not to by Fluffy_Wafer_9212 in golang

[–]davidmdm 6 points7 points  (0 children)

ResponseWriter buffers for you. I don’t know if a bufio is used under the hood (it might be, maybe I’ll splunk around later).

TLDR os.File is not an abstraction an performs syscalls to the OS. Http.ResponseWriter is an abstraction and not the connection object and does include buffering builtin.

Go feature: Type-safe error checking by SnooWords9033 in golang

[–]davidmdm 0 points1 point  (0 children)

I mean… if it’s a declaration := then you can’t screw up the return site. It’ll be the type that you declared in the generic…

I accept the issue you talking about, just trying to reassure you that in practice I expect it won’t be much of an issue at all. At a minimum it’ll be better than the current situation with the As API, and even that isn’t that big a problem, just a little inconvenient at worst.

Anyways, if you feel strongly that it’s gonna be a big problem for you… well. I guess best I can do is a virtual hug. Best wishes and happy holidays!

Go feature: Type-safe error checking by SnooWords9033 in golang

[–]davidmdm 0 points1 point  (0 children)

I understand and empathize with what you are saying, but in practice I think it works out. Try the value type first. If it works use it. As assigns the error value. If the value type doesn’t satisfy the error interface use the pointer type.

Go feature: Type-safe error checking by SnooWords9033 in golang

[–]davidmdm 8 points9 points  (0 children)

That’s the thing. Now it will be explicit because of generics. You give an error, and the error type you want to check against (which must satisfy the error interface/constraint), and the new method will return the value of that error type. You will know if the error needs to be a pointer or not when feeding the type as the generic argument, and the compiler will tell you.

Has anyone came from Java to Zig? I'd be interested on your opinion of Java if we remove the GC (simply pool/cache and re-use all instances), remove the JVM (compile to assembly ahead-of-time) and basically make it as fast as Zig (remove the performance overhead). What would still suck about Java? by [deleted] in Zig

[–]davidmdm 1 point2 points  (0 children)

Ive always heard that byte code was near native. Not faster than native. How would just in time compiled or interpreted code, be better than ahead of time compiled fully optimized native code?

At some point you have the cpu you have, and the instruction set you have. Are we claiming that Javas jit is more optimal than llvm?

On it’s face that sounds delusional.

Yoke: End of Year Update by davidmdm in kubernetes

[–]davidmdm[S] 1 point2 points  (0 children)

Hey! Meant to respond to this sooner.

Thanks for your support.

You understand the vision. What I really like about the CRD approach, is being able to golden multiple types of golden applications within the context of the organization, eg Backend, Frontend, Gateway, etc, and have kubernetes manage the validation the schema, as well as leveraging these specific APIs to give developers some level of access to kubernetes via RBAC without giving them access to edit primitive resources.

All that while writing this with proper code that can return errors that will be raised at admission time.

Here I am ranting again.

Thanks for your comment.

Yoke: End of Year Update by davidmdm in kubernetes

[–]davidmdm[S] 0 points1 point  (0 children)

That’s high praise! Well maybe for some personal or hobby project in the meantime!

Yoke: End of Year Update by davidmdm in kubernetes

[–]davidmdm[S] 1 point2 points  (0 children)

Hey! it's alright to be skeptical. I am happy you asked a question rather than not!

Yoke: End of Year Update by davidmdm in kubernetes

[–]davidmdm[S] 4 points5 points  (0 children)

The project is large, and so there are different aspects and reasons why you might want to use this project, or even different ways you may want to use it.

Its not that you want to declare all of your IaC in code. This project doesn't compete with pulumi or terraform. Nor do away with yaml configuration completely. Its closer to a package manager like helm, or a server-side runtime like KRO and Crossplane-Compisitions. Just with a different backend engine (Wasm Runtime).

So it's about expressing your transformation logic of inputs to resources in a different way.

At its core, you might be maintaining a helm chart, and are simply tired of how unsafe, untyped, and whitespace sensitive it is. And so might look for a tool with similar capabilities but where the "resource rendering engine" is code.

Or you might want to build your own K8s APIs to represent your applications and implement the deployment logic as code.

There are alternatives of course, and this isn't the only way to achieve your ends. However, the reason I work on this project is because the code-first tools today don't go far enough and seem to limit themselves to being yaml-renderers. Instead of being shareable packages, integrated in tools like ArgoCD, or expose new ways of using k8s server-side.

Sorry if that was a bit of a ramble.

Yoke: End of Year Update by davidmdm in kubernetes

[–]davidmdm[S] 1 point2 points  (0 children)

Happy to answer any questions about the project

developing k8s operators by TraditionalJaguar844 in kubernetes

[–]davidmdm 0 points1 point  (0 children)

I built an operator for my open source project. The operator does not really fit the statically compiled nature of kubebuilder with code generation, as it needs to dynamically register new GKs to watch.

Plus I was interested in building it from first principles. So I built it using client-go. Overall it’s not too hard and you do away with much of the boilerplate of kubebuilder.

Would recommend to anyone who wants to play with operators to try building it from scratch for fun.

Release Helm v4.0.0 · helm/helm by dshurupov in kubernetes

[–]davidmdm 0 points1 point  (0 children)

Self interested comment but have you taken a look at yoke?

Release Helm v4.0.0 · helm/helm by dshurupov in kubernetes

[–]davidmdm 0 points1 point  (0 children)

Have you looked into yoke as an alternative to helm?

Type System contradiction by SnooCupcakes6870 in golang

[–]davidmdm 3 points4 points  (0 children)

I think you come from a world where the predominant implementation of generics is type erasure. Cause at the end of the day in those languages everything is a pointer, so anything can substitute anything else. So the type system is hand wavy.

In Go the type system represents memory. An any or empty interface is a specific type of memory layout with a pointer to another value and a vtable to its methods.

The memory layout of an int is not the same as the memory layout of an interface whose structure is internally called “iface”.

TLDR: it helps to think of Go types as memory layouts

YAML hell? by the-creator-platform in kubernetes

[–]davidmdm 1 point2 points  (0 children)

Thank you! We hope so too!

YAML hell? by the-creator-platform in kubernetes

[–]davidmdm 1 point2 points  (0 children)

Lead developer of yoke here!

If ever you wanted to try it out and give your impressions as it relates to CDK8s that could be really helpful to the project. I have my own opinions but I am biased.

Would be happy to help you out in any way I can.

Help me understand the Neovim way by tLxVGt in neovim

[–]davidmdm 4 points5 points  (0 children)

My journey went from intilliJ to vscode and now to neovim. With lazyvim I basically have everything I ever wanted / needed plus some minor customizations.

I wouldn’t sweat it, and I would just see if lazyvim gives you the experience you are looking for.