How would you implement an "apply recommendation" workflow for Kubernetes optimization?
retained text
Hi everyone, I'm working on an open source K8s optimization tool that analyzes Prometheus+OpenCost data and generates recommendations such as CPU/memory rightsizing, idle workload detection, and other resource-efficiency improvements. I'm now thinking about how these recommendations should become actionable. The first approach I considered was applying changes directly to the cluster. For example, updating a deployment's requests/limits through the Kubernetes API. The problem is that this requires powerful permissions on the cluster and I'm not very comfortable with an optimization tool having write access to production workloads. The alternative I'm considering is a GitOps-based workflow: Recommendation -> Git commit -> Pull Request -> review/CI -> ArgoCD -> cluster This has some nice properties: \- no write access to the production cluster \- changes are auditable \- easy rollback \- fits naturally with GitOps workflows The downside is obviously that not every k8s environment is GitOps-based, and implementing this properly means dealing with GitHub/GitLab, private repositories, self-hosted Git instances, different repo structures, Helm/Kustomize, etc. For those of you running Kubernetes in production, would you prefer an optimization tool to apply changes directly through the Kubernetes API, create a Git PR, or something else? I'm building this as part of GreenKube, an open-source Kubernetes FinGreenOps project, but the question is really about the workflow itself. I'd be very interested in hearing how others approach this.
document fetched 2026-09-03 00:38 · canonical https://reddit.com/r/kubernetes/comments/1w5ce1e/how_would_you_implement_an_apply_recommendation