benfiola / minio-operator-ext

A Kubernetes operator that allows for declarative management of MinIO resources
10 stars 0 forks source link

Refactor operator #16

Open benfiola opened 3 days ago

benfiola commented 3 days ago

Currently, there are a few things about the operator I don't like - even though it works (at least for my personal use case and the features my development environment test for).

Python to Golang

minio-operator-ext is written in python because I've been a python developer for about a decade and find the language comfortable. However, lately, I've been writing a lot of golang and I'm finding that I like it a whole lot more than python. I enjoy its pragmatism, its simplicity and its ability to compile (and cross-compile!) executables with ease. Plus, compiling my code into executables produces tiny docker images - and that's been great, shaving down image sizes by two orders of magnitude.

Finally, I read this comment on reddit. minio-operator-ext does not have this problem because I use an embedded spec stored in the status field as a source of truth. However, I do accept that this is a flaw in kopf and a refactor to golang would fundamentally move me off of the framework.

The goal here is to refactor the operator to golang. While I'd love to avoid boilerplate, there's a bit of momentum around using kubebuilder to generate project scaffolds (with added scaffold upgrade support as of 9/2023) - so I'll probably utilize kubebuilder so that this code-base will likely be familiar to anyone who has worked with golang controllers before.

Process optimizations

I personally think the operator can be improved as it pertains to resource discovery. I think that:

benfiola commented 3 days ago

For now, this effort will be contained in the go branch.