Spike: investigate `cli-utils` as a gitops backend
Goal
Learn if using cli-utils
instead of gitops-engine
is better for us in the long/mid term.
Questions to answer
-
Q: what work would be needed to get the current functionality ready using
cli-utils
?A: Code refactoring, minor documentation cleanups e.g. to remove
resource_inclusions
andresource_exclusions
options as they will no longer be needed. -
Q: what extra features would we get out of the box?
A: server-side apply API (used by
cli-utils
), works better than client-side diffing and conditional update (gitops-engine). Feature-wise - resource pruning. -
Q: what extra opportunities would it allow for the Agent?
A: Drop
k8s.io/kubernetes
dependency to dramatically reduce the number of dependencies and hence speed up the builds (both local and CI). -
Q: what functionality/opportunities would we loose by dropping
gitops-engine
?A: Sync waves? I'm not sure if we need them. We can implement that on top of
cli-utils
by simply grouping and sorting the resources and then applying them in those groups (that's whatgitops-engine
does). -
Q: does the change have a performance impact?
- in terms of speed of applying small changes?
- in terms of speed of applying large changes?
- in terms of the memory/CPU requirements of
agentk
? - in terms of the memory/CPU requirements of
kas
?
A: This is hard to answer. I suspect memory requirements may increase because
cli-utils
uses usual informers which cache the whole object vsgitops-engine
caches only metadata of the objects. However,cli-utils
only starts informers for the actually needed resource kinds vsgitops-engine
caches metadata for all object kinds except for the few excluded ones. If it becomes and issue, we can try to do something about it as this mechanism is plugable incli-utils
. CPU-wise - also hard to say. Shouldn't be a problem.