Hacker News new | ask | show | jobs
by tmager 1306 days ago
Not a large org, but I dabbled with managing k8s with Terraform for a while and... did not have a great time. There were a few minor issues with state management and consistency between Terraform and k8s, but my main complaint was just that the k8s provider is very awkward to use. It for the most part works, but:

- It isn't an autogenerated wrapper around the k8s API, so not 100% of features are supported. E.g. there has been an open issue to implement setting runtimeClass on workload resources for three years.

- All of the options on the Terraform resources have been converted from camel-case to snake-case, which is fine except that I always forget to do that conversion when working off of the k8s API reference or an example. Some of them have also been converted from plural to singular.

- Because of the heavy use of Terraform blocks for configuring resources, it's often annoying to reuse chunks of configuration across resources or use non-trivial variables in the configuration -- and that's the big reason I wanted to use something like Terraform (versus flux or similar) in the first place.

- The k8s provider does actually have a way to manage custom resources now, the kubernetes_manifest resource type, but it requires writing the whole resource manifest out in HCL.

In short, there are better approaches and I would recommend against it. But hey, I'm just some guy on the internet.