# README
search-aggregator
Works with search-collector to synchronize kubernetes resources into RedisGraph, for use by the search UI. Runs on the hub cluster and receives from the collectors running on each remote cluster.
Development
- Start RedisGraph
docker run -p 6379:6379 -it --rm redislabs/redisgraph
- Install dependencies
make deps
- Build and run
make build && ./output/search-aggregator
API Usage
-
(currently unused) GET https://localhost:3010/aggregator/status
Response:
- Total number of clusters.
-
(currently unused) GET https://localhost:3010/aggregator/clusters/[clustername]/status
Response:
- Timestamp of last update.
- Total number of resources in the cluster.
- Total number of intra edges in the cluster
- MaxQueueTime - used to tell collectors how often to send updates.
-
POST https://localhost:3010/aggregator/clusters/[clustername]/sync
clearAll
- delete all resources for the cluster before adding new resources.addResources
- List of resources to be added.updateResources
- List of resources to be updated.deleteResources
- List of resources to be deleted.
Sample body:
{ "clearAll": false, "addResources": [ { "kind": "kind1", "uid": "uid-of-new-resource", "properties": { "name": "name1" } } ], "updateResources": [ { "kind": "kind2", "uid": "uid-of-existing-resource", "properties": { "name": "name2" } } ], "deleteResources": [ { "uid": "uid-of-resource-to-delete" } ] }
Sample Response:
{ "TotalAdded": 1, "TotalUpdated": 2, "TotalDeleted": 3, "TotalResources": 4, "UpdatedTimestamp": 12345678, "AddErrors": [ { "ResourceUID": "111aaa", "Message": "Failed to insert because ..." } ], "UpdateErrors": [ { "ResourceUID": "222bbb", "Message": "Failed to update because ..." } ], "DeleteErrors": [ { "ResourceUID": "333ccc", "Message": "Failed to delete because ..." } ], }
# Packages
No description provided by the author