{"id":22747092,"url":"https://github.com/managedcode/Keda","last_synced_at":"2025-08-08T18:30:59.937Z","repository":{"id":60727015,"uuid":"534140911","full_name":"managedcode/Keda","owner":"managedcode","description":"Use KEDA autoscaling to automatically scale applications based on metrics such as the number of active Grains in Orleans, the number of API requests, and the number of SignalR connections. This allows your .NET applications to handle increased workloads without manual intervention.","archived":false,"fork":false,"pushed_at":"2023-03-21T15:00:11.000Z","size":138,"stargazers_count":14,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-10T00:37:44.712Z","etag":null,"topics":["k8s","keda","orleans"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/managedcode.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}},"created_at":"2022-09-08T09:29:01.000Z","updated_at":"2024-10-13T17:49:26.000Z","dependencies_parsed_at":"2024-11-18T02:44:02.091Z","dependency_job_id":"b90f628e-1aa7-4781-ad4d-5c635b752efc","html_url":"https://github.com/managedcode/Keda","commit_stats":null,"previous_names":["managed-code-hub/keda"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/managedcode%2FKeda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/managedcode%2FKeda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/managedcode%2FKeda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/managedcode%2FKeda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/managedcode","download_url":"https://codeload.github.com/managedcode/Keda/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228987004,"owners_count":18002227,"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":["k8s","keda","orleans"],"created_at":"2024-12-11T03:12:53.082Z","updated_at":"2024-12-11T03:12:54.219Z","avatar_url":"https://github.com/managedcode.png","language":"C#","readme":"![img|300x200](https://raw.githubusercontent.com/managedcode/Keda/main/logo.png)\n\n\n# Keda\n\n[![.NET](https://github.com/managedcode/Keda/actions/workflows/dotnet.yml/badge.svg)](https://github.com/managedcode/Keda/actions/workflows/dotnet.yml)\n[![Coverage Status](https://coveralls.io/repos/github/managedcode/Keda/badge.svg?branch=main)](https://coveralls.io/github/managedcode/Keda?branch=main)\n[![nuget](https://github.com/managedcode/Keda/actions/workflows/nuget.yml/badge.svg?branch=main)](https://github.com/managedcode/Keda/actions/workflows/nuget.yml)\n[![CodeQL](https://github.com/managedcode/Keda/actions/workflows/codeql-analysis.yml/badge.svg?branch=main)](https://github.com/managedcodeb/Keda/actions/workflows/codeql-analysis.yml)\n\nKeda is a Kubernetes autoscaler that uses the KEDA autoscaling system to automatically \nscale applications based on metrics such as the number of active Grains in Orleans, the number of API requests, \nand the number of SignalR connections. This allows your .NET applications to handle increased workloads without manual intervention.\n\n## Motivation\nKubernetes makes it easy to deploy and manage containerized applications at scale, \nbut it can be challenging to ensure that your applications have the resources they need to handle sudden spikes in traffic. \nKeda solves this problem by using KEDA to automatically adjust the number of active Grains, \nas well as the number of API requests and SignalR connections, based on real-time metrics. \nThis ensures that your applications have the resources they need to handle increased workloads without manual intervention.\n\n## Getting Started\nTo use Keda, you will need to have a Kubernetes cluster with KEDA installed. \nOnce you have that set up, you can deploy Keda using the provided YAML files.\n\n- Install ``` ManagedCode.Keda.Orleans.Scaler``` package into your Silo project.\n- Install ``` ManagedCode.Keda.Orleans.Scaler.Client``` package into your SingalR or WebAPI projects.\n- Install ``` ManagedCode.Keda.Orleans.Scaler.Client``` package into your Scaler projects (let's call it orleans-scale).\n\n## Usage\nKeda is used by specifying the target metric and the desired range for that metric.\nKeda will then automatically adjust the number of active Grains, as well as the number of API requests and SignalR connections, \nto keep the metric within the specified range.\n\n\nYou have to create one more service, and add this logic, let's call it \"orleans-scale\" :\n``` cs\nawait Host.CreateDefaultBuilder(args)\n    .ConfigureServices((context, services) =\u003e\n    {\n        services.AddApiOrleansScaling();\n        services.AddHealthChecks();\n    })\n    .ConfigureWebHostDefaults(webBuilder =\u003e\n    {\n        webBuilder.Configure((_, app) =\u003e\n        {\n            app.UseRouting();\n            app.UseEndpoints(endpoints =\u003e\n            {\n                endpoints.MapOrleansScaler();\n                endpoints.MapApiRequestsScaler();\n                endpoints.MapSignalRScaler();\n                endpoints.MapHealthChecks(\"/health\");\n            });\n        });\n    })\n    .UseConsoleLifetime()\n    .RunConsoleAsync();\n```\n\nFor add scaler for SignalR:\n``` cs\nservices.AddSignalR()\n    .AddHubOptions\u003cSomeHub\u003e(options =\u003e\n    {\n        options.AddScalerForSignalR();\n    });\n```\n\nFor add scaler for WebAPI:\n``` cs\napp.UseScalerForRequest();\n```\n\nYAML configuration for Scaler project:\n\n``` yaml\n# Orleans Silo\napiVersion: keda.sh/v1alpha1\nkind: ScaledObject\nmetadata:\n    name: orleans-silo\nspec:\n  scaleTargetRef:\n    name: orleans-silo\n  minReplicaCount: 2\n  maxReplicaCount: 6\n  triggers:\n    - type: metrics-api\n      metadata:\n        targetValue: \"1500\" # active grains per silo\n        url: \"http://orleans-scaler.#{namespace}#/api/scaling/orleans\"\n        valueLocation: 'grainCount'\n\n---\n# SignalR\napiVersion: keda.sh/v1alpha1\nkind: ScaledObject\nmetadata:\n  name: signalr-scaler-object\nspec:\n  scaleTargetRef:\n    name: api-service\n  minReplicaCount: 2\n  maxReplicaCount: 10\n  triggers:\n    - type: metrics-api\n      metadata:\n        targetValue: \"1000\" # active connectinos per node\n        url: \"http://orleans-scaler.#{namespace}#/api/scaling/signalr\"\n        valueLocation: 'count'\n\n---\n# Web API\napiVersion: keda.sh/v1alpha1\nkind: ScaledObject\nmetadata:\n  name: http-scaler-object\nspec:\n  scaleTargetRef:\n    name: api-service\n  minReplicaCount: 2\n  maxReplicaCount: 10\n  triggers:\n    - type: metrics-api\n      metadata:\n        targetValue: \"500\" # requests per second per node\n        url: \"http://orleans-scaler.#{namespace}#/api/scaling/requests\"\n        valueLocation: 'count'\n        \n```\nThis will cause Keda to automatically scale pods depend on load.\n\n## Contributing\nWe welcome contributions to Keda! If you have an idea for a new feature or have found a bug, please open an issue on GitHub.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanagedcode%2FKeda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanagedcode%2FKeda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanagedcode%2FKeda/lists"}