{"id":40359365,"url":"https://github.com/kruize/kruize-operator","last_synced_at":"2026-05-11T15:05:34.107Z","repository":{"id":296846453,"uuid":"917143415","full_name":"kruize/kruize-operator","owner":"kruize","description":"Kubernetes Operator for Kruize","archived":false,"fork":false,"pushed_at":"2026-05-11T02:57:11.000Z","size":27766,"stargazers_count":5,"open_issues_count":16,"forks_count":9,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-05-11T04:42:55.961Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-15T12:45:11.000Z","updated_at":"2026-04-22T13:24:47.000Z","dependencies_parsed_at":"2025-08-21T16:43:52.895Z","dependency_job_id":null,"html_url":"https://github.com/kruize/kruize-operator","commit_stats":null,"previous_names":["kruize/kruize-operator"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/kruize/kruize-operator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kruize%2Fkruize-operator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kruize%2Fkruize-operator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kruize%2Fkruize-operator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kruize%2Fkruize-operator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kruize","download_url":"https://codeload.github.com/kruize/kruize-operator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kruize%2Fkruize-operator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32900102,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-10T13:40:02.631Z","status":"online","status_checked_at":"2026-05-11T02:00:05.975Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2026-01-20T10:06:18.320Z","updated_at":"2026-05-11T15:05:34.102Z","avatar_url":"https://github.com/kruize.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kruize-operator\n\nA Kubernetes Operator to automate deployment of [Kruize Autotune](https://github.com/kruize/autotune), a resource optimization tool for Kubernetes workloads.\n\n## Description\n\nThe Kruize operator 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\nFor examples of running Kruize and the operator, see [kruize-demos](https://github.com/kruize/kruize-demos/tree/main/monitoring/local_monitoring). You can customize the YAML file (found in config/samples) to deploy with your preferred options.\n\n## SEE ALSO\n\n* [Kruize Autotune](https://github.com/kruize/autotune) - Main Kruize service providing resource optimization recommendations\n* [kruize-ui](https://github.com/kruize/kruize-ui) - Web interface for Kruize\n* [kruize-demos](https://github.com/kruize/kruize-demos) - Example deployments and demonstrations\n\n## Getting Started\n\n### Prerequisites\n\n**For Deployment:**\n- kubectl version v1.23.0+\n- Access to a Kubernetes v1.23.0+ or OpenShift v4.12+ cluster\n- [Prometheus](https://github.com/prometheus/prometheus) (for Minikube, Kind clusters)\n\n**For Building/Development:**\n- Go version v1.25.0+ (updated for security patches)\n- [operator-sdk](https://github.com/operator-framework/operator-sdk) v1.37.0+ (as specified in Makefile)\n- Docker version 17.03+\n\n### Configuration\n\n**Environment Variables:**\n\nThe operator supports the following environment variables for customizing default container images:\n\n| Variable | Description |\n|----------|-------------|\n| `DEFAULT_AUTOTUNE_IMAGE` | Override the default Kruize Autotune container image |\n| `DEFAULT_AUTOTUNE_UI_IMAGE` | Override the default Kruize UI container image |\n\n\n**Example Usage:**\n```sh\n# Use custom registry/versions\nexport DEFAULT_AUTOTUNE_IMAGE=\"my-registry.io/kruize/autotune_operator:custom-tag\"\nexport DEFAULT_AUTOTUNE_UI_IMAGE=\"my-registry.io/kruize/kruize-ui:custom-tag\"\n```\n\nThese environment variables are checked once at operator startup. When the operator creates Kruize resources with empty `autotune_image` or `autotune_ui_image` fields in the CR spec, it uses these environment variable values (if set) or the built-in defaults. If the CR explicitly specifies image values, those take precedence over environment variables.\n\n### Deployment\n\nThe operator uses Kustomize overlays to manage platform-specific configurations:\n- **OpenShift** (default): Deploys to `openshift-tuning` namespace\n- **Local (Minikube/KIND)**: Deploys to `monitoring` namespace\n\n**Quick Start:**\n\n1. Build and push your image:\n   ```sh\n   make docker-build docker-push IMG=\u003csome-registry\u003e/kruize-operator:tag\n   ```\n**NOTE:** Ensure the image is published to a registry accessible from your cluster.\n\n2. Install the CRDs:\n   ```sh\n   make install\n   ```\n\n3. Deploy the operator:\n\n   | Platform | Command | Namespace |\n   |----------|---------|-----------|\n   | OpenShift | `make deploy-openshift IMG=\u003cregistry\u003e/kruize-operator:tag` | `openshift-tuning` |\n   | Minikube | `make deploy-minikube IMG=\u003cregistry\u003e/kruize-operator:tag` | `monitoring` |\n   | KIND | `make deploy-kind IMG=\u003cregistry\u003e/kruize-operator:tag` | `monitoring` |\n\n   \u003e **Note**: `IMG` parameter is optional. If not specified, the default image from the Makefile will be used.\n   \n   \u003e **Alternative**: Use `make deploy OVERLAY=\u003copenshift\\|local\u003e IMG=\u003cregistry\u003e/kruize-operator:tag`\n\n4. Create a Kruize instance:\n   ```sh\n   # For OpenShift\n   kubectl apply -f config/samples/v1alpha1_kruize.yaml -n openshift-tuning\n   \n   # For Minikube/KIND\n   kubectl apply -f config/samples/v1alpha1_kruize.yaml -n monitoring\n   ```\n   \u003e**NOTE**: Before applying for Minikube/KIND, update [`config/samples/v1alpha1_kruize.yaml`](config/samples/v1alpha1_kruize.yaml):\n   \u003e- Set `cluster_type: \"minikube\"` or `cluster_type: \"kind\"`\n   \u003e- Set `namespace: \"monitoring\"` (instead of `\"openshift-tuning\"`)\n\n**For detailed deployment options, overlay configurations, and advanced usage**, see [config/overlays/README.md](config/overlays/README.md).\n\n**NOTE**: If you encounter RBAC errors, you may need to grant yourself cluster-admin privileges or be logged in as admin.\n\n### To Uninstall\n\n1. Delete the Kruize instance(CR):\n   ```sh\n   # For OpenShift\n   kubectl delete -f config/samples/v1alpha1_kruize.yaml -n openshift-tuning\n   \n   # For Minikube/KIND\n   kubectl delete -f config/samples/v1alpha1_kruize.yaml -n monitoring\n   ```\n\n2. Undeploy the controller:\n   ```sh\n   make undeploy-openshift  # For OpenShift\n   make undeploy-minikube   # For Minikube\n   make undeploy-kind       # For KIND\n   ```\n\n3. Delete the CRDs:\n   ```sh\n   make uninstall\n   ```\n\nFor more undeployment options, see [config/overlays/README.md](config/overlays/README.md).\n\n## BUILDING\n\nSee [Prerequisites](#prerequisites) section above for required tools and versions.\n\n**Instructions**\n\n`make generate manifests` will trigger code/YAML generation and compile the operator controller manager.\n\n`make docker-build IMG=\u003cregistry\u003e/kruize-operator:tag` will build an OCI image. If `IMG` is not specified, the default image from the Makefile will be used.\n\n`make bundle` will create an OLM bundle in the `bundle/` directory. `make bundle-build` will create an OCI image of this bundle.\n\n`make catalog-build` will build an OCI image of the operator catalog.\n\n**Automated Build and Push Script:**\n\nFor a streamlined build and push workflow with prerequisite checks and version management, use the provided script:\n\n```sh\n./scripts/operator_build_and_push.sh -o \u003coperator_image\u003e -b \u003cbundle_image\u003e\n```\n\nExample:\n```sh\n./scripts/operator_build_and_push.sh -o quay.io/kruize/kruize-operator:0.0.5 -b quay.io/kruize/kruize-operator-bundle:0.0.5\n```\n\nThis script will:\n- Check prerequisites (including downloading operator-sdk if not available)\n- Update version files automatically\n- Build and push both operator and bundle images\n- Verify the images after pushing\n\nFor more details, see [`scripts/operator_build_and_push.sh`](scripts/operator_build_and_push.sh).\n\n## DEVELOPMENT\n\nRun the operator locally:\n```sh\nmake run\n```\nThis runs the controller manager as a process on your local machine. Note that it will not have access to certain in-cluster resources.\n\n## TESTING\n\n**Run unit tests:**\n```sh\nmake test\n```\n\n**Run end-to-end tests:**\n\nThe `test-e2e` target supports optional flags for customizing the test environment:\n\n```sh\n# Default (OpenShift cluster)\nmake test-e2e\n```\nThis requires a Kubernetes or OpenShift cluster. Recommended: Minikube, KIND, or OpenShift.\n\n**For detailed testing documentation**, see:\n- [Operator Tests Documentation](test/Operator_tests.md)\n\n## License\n\nApache License 2.0, see [LICENSE](/LICENSE).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkruize%2Fkruize-operator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkruize%2Fkruize-operator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkruize%2Fkruize-operator/lists"}