Our great sponsors
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
kyaml2go generated Go code for equivalent kubectl operations on k8s resource. It can generate code with the typed client and dynamic client. We don't have to figure out which k8s packages to import and waste time in populating the resource objects. You can give it a try at: https://kyaml2go.prasadg.dev. Whereas, https://github.com/mholt/json-to-go is totally different tool for different use case. It generated Go type definitions (structs) from JSON. But for K8s resources, we don't have to generate Go type as they are already defined in the `k8s.io/api` packages. kyaml2go helps you finding correct packages and populate the struct as per the yaml specs and call correct methods to manage the resource.
kyaml2go generated Go code for equivalent kubectl operations on k8s resource. It can generate code with the typed client and dynamic client. We don't have to figure out which k8s packages to import and waste time in populating the resource objects. You can give it a try at: https://kyaml2go.prasadg.dev. Whereas, https://github.com/mholt/json-to-go is totally different tool for different use case. It generated Go type definitions (structs) from JSON. But for K8s resources, we don't have to generate Go type as they are already defined in the `k8s.io/api` packages. kyaml2go helps you finding correct packages and populate the struct as per the yaml specs and call correct methods to manage the resource.
For a working example, you can take a look at https://github.com/coderanger/controller-utils/blob/main/components/template.go and the code pulled in from there (ignore that it uses vfsgen instead of go:embed, this code predates go:embed being available, same idea though).
Related posts
- Network Mapper – low privileges, no-eBPF network observability tool for K8s
- Otterize launches open-source, declarative IAM permissions for workloads on AWS EKS clusters
- Auto-Completion and Cocktail mixing with Golang’s Cobra CLI
- Gotestdox: A tool for formatting Go test results as readable documentation
- JSON to Go Struct Converter