HN user

pst

111 karma

I maintain a Terraform framework (cli, modules and provider) for Kubernetes platform engineering teams.

www.kubestack.com

Posts20
Comments42
View on HN
news.ycombinator.com 3y ago

Ask HN: How to ensure correct access across all SaaS services

pst
1pts0
www.kubestack.com 3y ago

Terraform Platform Engineering Framework

pst
3pts0
thenewstack.io 4y ago

A Better Way to Provision Kubernetes Resources Using Terraform

pst
2pts1
twitter.com 4y ago

GitHub: Stolen OAuth User Tokens (Heroku, Travis-CI)

pst
14pts0
www.kubestack.com 4y ago

Show HN: Low-code UI to design a K8s platform and export Terraform code

pst
6pts3
blog.cctechwiz.com 4y ago

8 Reasons Smart Engineers Use Frameworks – Even for Infrastructure

pst
3pts0
registry.terraform.io 5y ago

Show HN: Dynamic Kustomize overlays with values from Terraform

pst
2pts0
www.youtube.com 5y ago

Localhost EKS development environments with EKS-D and Kubestack

pst
2pts0
twitter.com 6y ago

DevOps vs. SRE vs. GitOps in 140 characters

pst
1pts0
www.kubestack.com 6y ago

Terraform GitOps Framework

pst
2pts0
dev.to 6y ago

Why now is the time for the Spring Boot of infrastructure automation

pst
2pts0
www.kubestack.com 6y ago

Show HN: A GitOps development environment in the comfort of your own localhost

pst
63pts6
dev.to 6y ago

Not another tool to build Kubernetes clusters

pst
2pts0
youtu.be 6y ago

Time-Lapse: From Zero to GitOps

pst
1pts0
www.kubestack.com 6y ago

Show HN: Open-Source GitOps Framework for K8s Based on Terraform and Kustomize

pst
10pts0
www.exoscale.ch 9y ago

Multi master Kubernetes on Exoscale

pst
5pts0
www.exoscale.ch 10y ago

CloudControl joins Exoscale

pst
2pts0
cloudcontrol.com 14y ago

CloudControl PaaS is hiring in Berlin/Germany

pst
1pts0
cloudcontrol.de 15y ago

PHP PaaS: How to make cronjobs and workers work

pst
1pts0
cloudcontrol.com 15y ago

Heroku for PHP

pst
4pts1

I've been building a frontend with Go, Templ and Datastar for a few months now. I really like the @actions and how the page is updated with the response.

I'm on the fence about signals though. They are fine for simple things like individual text form fields or opening closing a drop-down. But my backend is a Kubernetes style API server. And storing a JSON Kubernetes style resource in a signal does not work because of how Datastar implements parsing the structure into child signals. For me it would be better to just be able to turn this off.

One example where it breaks are K8s labels. They are map[string]string and the key is often hostname prefixed. E.g. example.com/label-key. Datastar can't handle these keys at all and the resulting signals are a mess.

I'm aware that I may be using signals not as intended. But something as simple as data-signals-resource="k8sJson" and then data-bind="resource.metatdata.name" is a great way to work. And it works for metadata name. But it doesn't work if any part of the path needs to be an index in a list or a label key in hostname style.

The other thing I find painful about Datastar signals are the magic about how attributes written something-something in HTML become somethingSomething in JS and all all the snake, camel etc. __modifiers. It's just error prone to work with. Not a great experience.

But overall I still stuck with it so far and am happy with the general idea of HTMX and Alpine functionalities implemented as one and using hypermedia as a general approach. Anything so I can avoid the NodeJS ecosystem really.

When a few RCs back the wire format changed, it was quite a laborious update for me, because using Fiber I can't use the Go SDK and implemented my own. But the wire format clearly changed for the better so it was worth it.

I think the developers are on to something and should keep iterating.

This is awesome. Having a single state for all resources in an environment is critical for keeping all the moving pieces in check and a core design aspect of Kubestack. But the growing state files quickly become a bottleneck. I'm definitely giving this a good test drive. Very excited.

I'm working on an application and use Fiber, Templ and Datastar to keep my frontend in Go, like my backend. I'm overall quite happy with this approach.

But Datastar tries to do both, AlpineJS stuff like show/hide dropdow options, as well as HTMX stuff like talk to backend and merge/replace parts of the DOM.

I came across TemplUI a few times while working on this app so far. But always felt the Vanilla JS plus HTMX approach of TemplUI conflicts with Datastar. Too much overlap in different components doing the same stuff for my taste. While at the same time, I spent way too much time converting Tailwind UI components into Tempo. Time I could spend better.

Datastar is quite on the experimental/unstable side of things. And its concept of signals doesn't quite work for my Kubernetes style API resources. So maybe I need to revisit this decision at some point.

What I really like about Datastar and what made me choose it in the first place is how easy it makes using server sent events.

So yeah, exciting times. Still some rough edges I would say. But for me personally I already prefer hypermedia over the predominant React frontends approach.

Yes, conditionals and loops in TF are limited and have various annoying and surprising edge cases. But if something is hard to do with the Terraform DSL it's usually a good idea to reconsider if it is really something that one should be doing.

We want infrastructure automation to be boring and just work.

The risk with general purpose programming languages is that people will always find a way to outsmart themselves. Yes, sure, you can use the testing tool chain of the language of your choosing. But it's not like we have figured out to write software without bugs, despite all the awesomeness of modern languages.

Flux, IIRC, uses labels or annotations to do purging. Helm I'd argue falls into the state category with the secrets if uses to track releases.

I do everything with Terraform so I'm not super familiar with either of them. But teams are free to choose their poison.

It's not trivial to get the labels correct to avoid collateral deletions. Also, while it makes sense, I and many teams I consulted with found it rather unintuitive that apply --purge with a label selector will also only update resources with the label. Not all resources that are in the list of resources. Last time I checked it was also still marked experimental and has been for years.

Keeping the tombstones around in the configuration I have to maintain instead of the state the tool maintains for me also increases the effort for me though. So either I have the effort of setting up the remote state and handling some edge cases. Or handling the shortcomings of stateless in my own code base.

This doesn't work unless your infrastructure is entirely static. As soon as you have active control loops like e.g. an autoscaler it will create resources that you don't know about and would then delete.

The delete this approach is imperative though. If you aim to be declarative you need a way for the tool to be able to determine actions necessary to go from current to new desired configuration. You need to store previous applied config somewhere, to be able to determine if something needs purging in a declarative way.

I maintain a Terraform provider for Kubernetes. And one of the main reasons for that is because the Terraform state ensures purging of deleted resources.

Something that kubectl is not capable of. The lastAppliedConfig annotation does not help for purging, because once the manifest has been deleted on disk, there is no way of knowing what to delete from the server. The unusable apply --purge flag is the best example of this issue

I think the state mainly exist to know what has been created in the past but since been deleted from manifests and therefore needs to be purged. The caching/performance argument is rather weak, because Terraform refreshes by default anyway before any operation.

Thanks for the kind words. I'm building Kubestack because I believe strongly that frameworks make sense for IaC too and that platform teams need a better DX if they are supposed to deliver a better DX to app teams.

I'm currently helping companies build their Kubernetes platforms using Kubestack. So that's the "business model" for now.

The modules in the catalog, like e.g. ArgoCD, differ from other modules in so far as that they are built automatically from upstream releases. I maintain the Kustomization Terraform provider, which allows integrating native K8s manifests into Terraform and have Kustomize patches, generators etc. available to customize the upstream manifests. The Kustomize overlays can be defined in Terraform through the provider/modules and as a result you can use values from Terraform to configure the K8s manifests without maintaining K8s YAMl in HCL.

More details here: https://www.kubestack.com/framework/documentation/cluster-se...

Regarding Terragrunt I'm not 100% sure. Last time I checked they maintained different environments in different directories and then the CLI copies/symlinks/whatever that into a configuration before it runs Terraform. Kubestack however does use Terraform workspaces (in the TF CLI, not TF Cloud sense) for that purpose. There is just one code base. And modules have inheritance based configuration per environment. I'm not sure how well Terragrunt works with Terraform workspaces. If it does, then it should with Kubestack too.

Edit: added the Terragrunt answer.

I'm following a similar approach with Kubestack. Although for a much smaller use-case, being exclusively focused on building Kubernetes platforms using Terraform.

Your scope sounds more like Gruntwork. How would you say you differentiate?

For me the focus is important because the wider the use-case, the broader the customizations different orgs will require. Focus on a narrow use-case means one can provide more value.

Frameworks on the software development side also are better with a narrower use-case. There's no one size fits all.

Kubestack also has a UI to design your Kubernetes platform and export that to Terraform code. Making it super easy to get started.

https://www.kubestack.com/cloud

Kubestack Cloud is a low-code UI to define Kubernetes platforms and export them to production grade Terraform. Architecting a K8s platform is time-consuming and difficult. It gets easier if you've done it before, of course, but then it's little more than just another repetitive task.

A UI can provide a lower entry barrier and allows for quicker iterations. But from a long term maintenance perspective, a UI managed platform is not sustainable. I'm trying to combine the best of both worlds, by having all the benefits of a UI in the beginning, but the power and control of infrastructure as code long-term.

With the Kubestack framework I've been maintaining an open-source Terraform framework, and Kubernetes Terraform provider for ~3 years now. But while the framework provides proven, reusable modules, it still requires writing 100s of lines of Terraform code to call the modules from your root module with the correct configuration.

Kubestack Cloud allows users to define the root module in the UI. It provides guidance on a number of high level architecture decisions, like how many environments and how changes are validated and promoted between these environments. It then lets users drill down to configure cloud providers (AKS, EKS or GKE), node pools and cluster services. Once done, everything can be exported to production grade Terraform code for free.

The generated Terraform code is human-readable and easy to maintain long term, because, again, Kubestack Cloud "just" generates the root module that calls the existing open-source framework modules.

Kubestack Cloud is still in the MVP stage. But give it a try and let me know what you think.

As someone who also learns best by getting my hands dirty, I always liked the ability to pick up an application development framework and get started building a real app while I'm still learning. By accepting the frameworks opinions, I can keep going and decide where I need to diverge once I learned more about the technology and what I really need.

With my Terraform framework for AKS, EKS and GKE I'm trying to bring the same framework benefits to the DevOps world, more specifically to Terraform and Kubernetes.

Check it out: https://www.kubestack.com/