{"id":25777294,"url":"https://github.com/kruize/autotune","last_synced_at":"2026-01-20T10:03:44.135Z","repository":{"id":37098200,"uuid":"299880639","full_name":"kruize/autotune","owner":"kruize","description":"Autonomous Performance Tuning for Kubernetes!","archived":false,"fork":false,"pushed_at":"2025-02-18T08:58:28.000Z","size":8631,"stargazers_count":179,"open_issues_count":245,"forks_count":57,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-02-18T09:38:01.646Z","etag":null,"topics":["autotune","hyperparameter-optimization","kubernetes","performance","performance-tuning","sla","tunables"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kruize.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-30T10:11:23.000Z","updated_at":"2025-02-09T11:43:09.000Z","dependencies_parsed_at":"2023-09-29T07:37:12.822Z","dependency_job_id":"ecffac8b-78ea-442f-bd7b-94ed7533b9eb","html_url":"https://github.com/kruize/autotune","commit_stats":null,"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kruize%2Fautotune","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kruize%2Fautotune/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kruize%2Fautotune/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kruize%2Fautotune/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kruize","download_url":"https://codeload.github.com/kruize/autotune/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240987436,"owners_count":19889335,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autotune","hyperparameter-optimization","kubernetes","performance","performance-tuning","sla","tunables"],"created_at":"2025-02-27T06:01:40.263Z","updated_at":"2026-01-20T10:03:44.129Z","avatar_url":"https://github.com/kruize.png","language":"Java","funding_links":[],"categories":["云原生"],"sub_categories":[],"readme":"[![Test on Push](https://github.com/kruize/autotune/actions/workflows/test-on-push.yaml/badge.svg?branch=master)](https://github.com/kruize/autotune/actions/workflows/test-on-push.yaml)\n\n# Kruize 🚀 – Intelligent Kubernetes Resource Optimization\n\nTL;DR: Kruize analyzes your Kubernetes workload metrics and automatically generates right-sizing recommendations for CPU, memory, and GPU resources — reducing costs and improving performance without manual tuning.\n\nKruize is an open-source optimization tool for Kubernetes that helps you achieve significant cost savings and optimal performance with minimal effort. It continuously monitors your applications and provides right-sizing recommendations for container and namespace resources like CPU and memory, as well as NVIDIA GPU MIG slices.\nKruize serves as the powerful backend engine for the Resource Optimization Service within Red Hat Insights, a service now available to all OpenShift Container Platform (OCP) users.\n\n## How Kruize Works\n\nKruize connects to your monitoring stack (such as Prometheus or Thanos) and analyzes historical workload resource usage to generate actionable right-sizing recommendations. By continuously observing real usage patterns, it identifies over- and under-provisioned resources and provides right-sizing recommendations — improving performance for under-provisioned workloads and reducing costs for over-provisioned ones.\n\nRecommendations are generated for:\n\n- Containers – CPU and Memory requests and limits\n\n- Namespaces – Resource quota limits for CPU and Memory\n\n- NVIDIA GPUs – Optimal MIG slice configurations for supported accelerators (e.g., A100, H100)\n\nKruize supports both predefined terms (short, medium, long) and custom terms, allowing recommendations to align with your desired observation window. You can also choose between performance-optimized or cost-optimized profiles based on your workload priorities.\n\n## Quick Start\n### Operator-Based Deployment\nKruize can be installed via the Kruize operator which simplifies deployment and management of Kruize on Kubernetes and OpenShift clusters. It provides a declarative way to configure and deploy Kruize components including the core Kruize service and UI through Custom Resource Definitions (CRDs).\n\nHere is the documentation for installing Kruize via Operator [OCP_installation.md](/docs/OCP_installation.md).\n\n### Standalone Demo\nKruize has a demos repo that enables users to get a quick start without worrying about the setup, and it's a great first-step for first time users.\nYou can start by running the [Local Monitoring demo](https://github.com/kruize/kruize-demos/tree/main/monitoring/local_monitoring).\n\nWe recommend you check out the [kruize-demos](https://github.com/kruize/kruize-demos) repo in case you want to know more about VPA demo, GPU demo, HPO demo and a lot more!\n\n## Generating Recommendations with Kruize\nThis guide provides step-by-step instructions for manual setup. For automated setup, skip to the section below.\n\n### Prerequisites\nYou need access to any Kubernetes environment like Kind, Minikube, or OpenShift with Prometheus running in the cluster.\n\nTo install Prometheus, use the following scripts for [Kind](/scripts/prometheus_on_kind.sh) or [Minikube](/scripts/prometheus_on_minikube.sh). OpenShift installs Prometheus by default.\n\nFollow [benchmarks installation](https://github.com/kruize/benchmarks/tree/master/sysbench) instructions to install sysbench benchmark.\n\nThe following instructions assume that a Kubernetes cluster and Prometheus are installed on your machine, and the application for which you want to generate recommendations has been running for at least 30 minutes.\n\n### Clone Repositories\nClone the Kruize \u0026 Benchmarks repositories using the following commands:\n\n```bash\ngit clone git@github.com:kruize/autotune.git\ngit clone git@github.com:kruize/benchmarks.git\ncd autotune\n```\n\nKruize can be installed on kind, minikube, or OpenShift. In this guide, we use kind to show the installation process.\n\n### Install Kruize\n\n```bash\n./deploy.sh -c kind -m crc\n# For other cluster types, use: ./deploy.sh -c minikube or ./deploy.sh -c openshift\n```\n\n### Expose Kruize Services\n\nBefore proceeding :\n- **For OpenShift**: Expose Kruize \u0026 UI service via routes\n- **For Kind/Minikube**: Port-forward Kruize \u0026 UI services\n\n**Port-forward commands for Kind/Minikube:**\n```bash\nkubectl port-forward svc/kruize -n monitoring 8080:8080 \u0026\nkubectl port-forward svc/kruize-ui-nginx-service -n monitoring 8081:80 \u0026\nexport KRUIZE_URL=\"http://localhost:8080\"\n```\n\n### Install Metadata and Metric Profiles\n**Metadata Profile**: Contains queries to collect namespace, workload and container data from your monitoring system. It tells Kruize how to fetch metrics from your specific environment (Prometheus/Thanos endpoints, query formats, cluster-specific labels). Without it, Kruize cannot retrieve data even if the metrics exist.\n\nInstall metadata profile:\n```bash\ncurl -X POST http://${KRUIZE_URL}/createMetadataProfile \\\n  -H \"Content-Type: application/json\" \\\n  -d @manifests/autotune/metadata-profiles/bulk_cluster_metadata_local_monitoring.json\n```\n\n**Metric Profile**: Defines what metrics to monitor (CPU, memory, response time) and optimization goals (minimize cost, maintain performance SLOs). It tells Kruize what \"good performance\" means for your application. Without it, Kruize cannot determine the right trade-offs between cost and performance.\n\nInstall metric profile:\n\n```bash\ncurl -X POST http://${KRUIZE_URL}/createMetricProfile \\\n  -H \"Content-Type: application/json\" \\\n  -d @manifests/autotune/performance-profiles/resource_optimization_local_monitoring.json\n```\nImport metadata: Imports metadata from your datasource to discover workloads running in your cluster.\n\n```bash\ncurl -X POST http://${KRUIZE_URL}/dsmetadata \\\n  -H 'Accept: application/json' \\\n  --data 'copy paste below JSON' \n```\n```json \n{\n\"version\": \"v1.0\",\n\"datasource_name\": \"prometheus-1\",\n\"metadata_profile\": \"cluster-metadata-local-monitoring\",\n\"measurement_duration\": \"15min\"\n}\n```\n\n### Create Experiment\n\n- For container-level experiment\n\nThis is the Create Experiment JSON that has container-related details. \n```json\n[{\n  \"version\": \"v2.0\",\n  \"experiment_name\": \"monitor_sysbench\",\n  \"cluster_name\": \"default\",\n  \"performance_profile\": \"resource-optimization-local-monitoring\",\n  \"metadata_profile\": \"cluster-metadata-local-monitoring\",\n  \"mode\": \"monitor\",\n  \"target_cluster\": \"local\",\n  \"datasource\": \"prometheus-1\",\n  \"kubernetes_objects\": [\n    {\n      \"type\": \"deployment\",\n      \"name\": \"sysbench\",\n      \"namespace\": \"default\",\n      \"containers\": [\n        {\n          \"container_image_name\": \"quay.io/kruizehub/sysbench\",\n          \"container_name\": \"sysbench\"\n        }\n      ]\n    }\n  ],\n  \"trial_settings\": {\n    \"measurement_duration\": \"2min\"\n  },\n  \"recommendation_settings\": {\n    \"threshold\": \"0.1\"\n  }\n}]\n```\nCommand to create experiment:\n```bash\ncurl -X POST http://${KRUIZE_URL}/createExperiment -d @container_experiment_sysbench.json\n```\n- For namespace-level experiment\n\nIn the above JSON, change the experiment name \u0026 modify the Kubernetes object to :\n```json\n\"kubernetes_objects\": [\n      {\n        \"namespaces\": {\n          \"namespace\": \"default\"\n        }\n      }\n    ]\n```\nCommand to create namespace experiment:\n```bash\ncurl -X POST http://${KRUIZE_URL}/createExperiment -d @namespace_experiment_sysbench.json\n```\n\n### Generate Recommendations\nWait for at least 2 data points to be collected (approx. 30 minutes with default settings), then:\n\n```bash\n# Generate recommendations for container experiment\ncurl -X POST \"http://${KRUIZE_URL}/generateRecommendations?experiment_name=\u003cexperiment-name\u003e\"\n\n# List recommendations\ncurl -X GET \"http://${KRUIZE_URL}/listRecommendations?experiment_name=\u003cexperiment-name\u003e\"\n```\n\nYou can also take a look at the UI to better understand recommendations.\n\n## Kruize Architecture\n\nSee the [Kruize Architecture](/design/README.md) for more details on the architecture.\n\n## API Documentation\nFor complete API specifications and examples, see the [Kruize API Documentation](design/KruizeLocalAPI.md).\n\n## See Also\nIf you're exploring more around Kruize, here are related repositories you may find useful:\n\n- [kruize-demos](https://github.com/kruize/kruize-demos) - Demo scripts to showcase Kruize functionality\n- [benchmarks](https://github.com/kruize/benchmarks) - Performance benchmarking workloads\n- [kruize-operator](https://github.com/kruize/kruize-operator) - Operator for deploying Kruize in your OpenShift or Kubernetes cluster.\n- [kruize-website](https://github.com/kruize/kruize-website) - Source code for the official Kruize website\n- [kruize-ui](https://github.com/kruize/kruize-ui) - User Interface to interact with Kruize backend\n- [hpo](https://github.com/kruize/hpo) - Hyperparameter Optimization framework\n- [kruize-vpa](https://github.com/kruize/kruize-vpa) - Vertical Pod Autoscaler integration for Kruize\n\n## Contributing\n\nWe welcome your contributions! See [CONTRIBUTING.md](/CONTRIBUTING.md) for more details. \n\nJoin the [Kruize Slack](http://kruizeworkspace.slack.com/) to connect with the community, ask questions, and collaborate!\n\nor Scan the QR Code \n![Slack QR code](docs/images/kruize_slack_QR.jpeg)\n\n## License\n\nApache License 2.0, see [LICENSE](/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkruize%2Fautotune","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkruize%2Fautotune","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkruize%2Fautotune/lists"}