{"id":15192063,"url":"https://github.com/projectsveltos/classifier","last_synced_at":"2026-04-11T15:03:48.925Z","repository":{"id":63260464,"uuid":"556836645","full_name":"projectsveltos/classifier","owner":"projectsveltos","description":"Sveltos Classifier dynamically classify a cluster based on run time information (Kubernetes version, deployed resources and more)","archived":false,"fork":false,"pushed_at":"2026-02-02T17:57:39.000Z","size":1547,"stargazers_count":4,"open_issues_count":4,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-03T07:31:05.549Z","etag":null,"topics":["add-ons","classification","clusterapi","gitops","helm","helm-charts","k8s","kubernetes","multi-tenancy"],"latest_commit_sha":null,"homepage":"https://projectsveltos.github.io/sveltos/","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/projectsveltos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2022-10-24T15:53:23.000Z","updated_at":"2026-02-02T17:57:44.000Z","dependencies_parsed_at":"2025-12-13T11:05:05.459Z","dependency_job_id":null,"html_url":"https://github.com/projectsveltos/classifier","commit_stats":{"total_commits":191,"total_committers":4,"mean_commits":47.75,"dds":"0.46073298429319376","last_synced_commit":"09e247f828d70069e1704f96f98d9eade272d4b3"},"previous_names":[],"tags_count":95,"template":false,"template_full_name":null,"purl":"pkg:github/projectsveltos/classifier","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectsveltos%2Fclassifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectsveltos%2Fclassifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectsveltos%2Fclassifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectsveltos%2Fclassifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/projectsveltos","download_url":"https://codeload.github.com/projectsveltos/classifier/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectsveltos%2Fclassifier/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29480920,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T11:35:25.641Z","status":"ssl_error","status_checked_at":"2026-02-15T11:34:57.128Z","response_time":118,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["add-ons","classification","clusterapi","gitops","helm","helm-charts","k8s","kubernetes","multi-tenancy"],"created_at":"2024-09-27T21:04:32.257Z","updated_at":"2026-04-11T15:03:48.919Z","avatar_url":"https://github.com/projectsveltos.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CI](https://github.com/projectsveltos/classifier/actions/workflows/main.yaml/badge.svg)](https://github.com/projectsveltos/classifier/actions)\n[![Go Report Card](https://goreportcard.com/badge/github.com/projectsveltos/classifier)](https://goreportcard.com/report/github.com/projectsveltos/classifier)\n[![Slack](https://img.shields.io/badge/join%20slack-%23projectsveltos-brighteen)](https://join.slack.com/t/projectsveltos/shared_invite/zt-1hraownbr-W8NTs6LTimxLPB8Erj8Q6Q)\n[![License](https://img.shields.io/badge/license-Apache-blue.svg)](LICENSE)\n[![Twitter Follow](https://img.shields.io/twitter/follow/projectsveltos?style=social)](https://twitter.com/projectsveltos)\n\n# classifier\n\n\u003cimg src=\"https://raw.githubusercontent.com/projectsveltos/sveltos/main/docs/assets/logo.png\" width=\"200\"\u003e\n\nPlease refere to sveltos [documentation](https://projectsveltos.github.io/sveltos/).\n\nSveltos Classifier is an componet of the Sveltos project and it is used to dynamically classify a cluster based on its runtime configuration (Kubernetes version, deployed resources and more).\n\nClassifier currently supports the following classification criteria:\n1. Kubernetes version\n2. Kubernetes resources\n\nFor instance, this Classifier instance will match any cluster whose Kubernetes version is greater than or equal to \"v1.24.0\" and strictly less than \"v1.26.1\"\n\n```\napiVersion: lib.projectsveltos.io/v1beta1\nkind: Classifier\nmetadata:\n  name: kubernetes-v1.24\nspec:\n  classifierLabels:\n  - key: k8s-version\n    value: v1.24\n  kubernetesVersionConstraints:\n  - comparison: GreaterThanOrEqualTo\n    version: 1.24.0\n  - comparison: LessThan\n    version: 1.26.1\n```\n\nWhen a cluster is a match for a Classifier instances, all classifierLabels will be automatically added to the Cluster instance.\n\nRefer to [examples](./examples/) for more complex examples.\n\n## Sveltos Classifier in action\n\n![Sveltos Classifier in action](https://github.com/projectsveltos/demos/blob/main/classifier/classifier.gif)\n\n## A simple use case: upgrade helm charts automatically when Kubernetes cluster is upgraded\nSuppose you are managing several Kubernetes clusters with different versions.\nAnd you want to deploy:\n1. OPA Gatekeeper version 3.10.0 in any Kubernetes cluster whose version is \u003e= v1.26.1\n2. OPA Gatekeeper version 3.9.0 in any Kubernetes cluster whose version is \u003e= v1.24.0 \u0026\u0026 \u003c v1.26.1\n\nYou can create following ClusterProfiles and Classifiers in the management cluster:\n```\napiVersion: config.projectsveltos.io/v1beta1\nkind: ClusterProfile\nmetadata:\n  name: deploy-gatekeeper-3-10\nspec:\n  clusterSelector:\n    matchLabels:\n      gatekeeper: v3-10\n  syncMode: Continuous\n  helmCharts:\n  - repositoryURL: https://open-policy-agent.github.io/gatekeeper/charts\n    repositoryName: gatekeeper\n    chartName: gatekeeper/gatekeeper\n    chartVersion:  3.10.0\n    releaseName: gatekeeper\n    releaseNamespace: gatekeeper\n    helmChartAction: Install\n```\n\n```\napiVersion: config.projectsveltos.io/v1beta1\nkind: ClusterProfile\nmetadata:\n  name: deploy-gatekeeper-3-9\nspec:\n  clusterSelector:\n    matchLabels:\n      gatekeeper: v3-9\n  syncMode: Continuous\n  helmCharts:\n  - repositoryURL: https://open-policy-agent.github.io/gatekeeper/charts\n    repositoryName: gatekeeper\n    chartName: gatekeeper/gatekeeper\n    chartVersion:  3.9.0\n    releaseName: gatekeeper\n    releaseNamespace: gatekeeper\n    helmChartAction: Install\n```\n\nThen create following Classifiers\n\n```\napiVersion: lib.projectsveltos.io/v1beta1\nkind: Classifier\nmetadata:\n  name: deploy-gatekeeper-3-10\nspec:\n  classifierLabels:\n  - key: gatekeeper\n    value: v3-10\n  kubernetesVersionConstraints:\n  - comparison: GreaterThanOrEqualTo\n    version: 1.26.1\n```\n\n```\napiVersion: lib.projectsveltos.io/v1beta1\nkind: Classifier\nmetadata:\n  name: deploy-gatekeeper-3-9\nspec:\n  classifierLabels:\n  - key: gatekeeper\n    value: v3-9\n  kubernetesVersionConstraints:\n  - comparison: GreaterThanOrEqualTo\n    version: 1.24.0\n  - comparison: LessThan\n    version: 1.26.1\n```\n\nWith the above configuration:\n1. Any cluster with a Kubernetes version v1.24.x will get label _gatekeeper:v3.9_ added and because of that Gatekeeper 3.9.0 helm chart will be deployed;\n2. Any cluster with a Kubernetes version v1.25.x will get label _gatekeeper:v3.10_ added and because of that Gatekeeper 3.10.0 helm chart will be deployed;\n3. As soon a cluster is upgraded from Kubernetes version v1.24.x to v1.25.x, Gatekeeper helm chart will be automatically upgraded from 3.9.0 to 3.10.0\n\n## Contributing\n\n❤️ Your contributions are always welcome! If you want to contribute, have questions, noticed any bug or want to get the latest project news, you can connect with us in the following ways:\n\n1. Open a bug/feature enhancement on github [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/projectsveltos/sveltos-manager/issues)\n2. Chat with us on the Slack in the #projectsveltos channel [![Slack](https://img.shields.io/badge/join%20slack-%23projectsveltos-brighteen)](https://join.slack.com/t/projectsveltos/shared_invite/zt-1hraownbr-W8NTs6LTimxLPB8Erj8Q6Q)\n3. [Contact Us](mailto:support@projectsveltos.io)\n\n\n## License\n\nCopyright 2022.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprojectsveltos%2Fclassifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprojectsveltos%2Fclassifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprojectsveltos%2Fclassifier/lists"}