-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #157 from flanksource/resource-selector
chore: update resource selector documentation
- Loading branch information
Showing
5 changed files
with
51 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# ResourceSelector | ||
|
||
We use resource selectors to link components with each other | ||
|
||
| Field | Description | Scheme | Required | | ||
|---------------|----------------------------------------------------------------------------------------------------------------------------------------|----------|----------| | ||
| id | ID of the component | string | | | ||
| name | Name of the component | string | | | ||
| namespace | Namespace of the component | string | | | ||
| types | List of types of the component | []string | | | ||
| statuses | List of statuses of the component | []string | | | ||
| labelSelector | Labels to select the component in kubernetes format | string | | | ||
| fieldSelector | Property fields of the component in kubernetes format (or database columns: owner, topology_id, parent_id) | string | | | ||
| agent | ID or name of the agent (Default: local agent). Use 'all' to select all the agents | string | | | ||
| cache | One of 'no-cache' (should not fetch from cache but can be cached), 'no-store' (should not cache) or 'max-age=X' (cache for X duration) | string | | | ||
|
||
|
||
A resource selector fetches components that satisfy all the parameters, you can use multiple selectors to aggregate | ||
|
||
## Example | ||
```yaml | ||
kind: Topology | ||
metadata: | ||
name: Example | ||
spec: | ||
components: | ||
- name: Components with healthy status in kube-system namespace of all agents | ||
selectors: | ||
- statuses: ['healthy'] | ||
namespace: kube-system | ||
agent: all | ||
|
||
- name: Components with Node type with spot instance property labelled with gpu tag | ||
selectors: | ||
- types: ['Kubernetes::Node'] | ||
fieldSelector: 'instance-type=spot' | ||
labelSelector: 'sku-type=gpu' | ||
|
||
- name: Components with labels of team payments and team orders | ||
# Using multiple selectors to aggregate | ||
selectors: | ||
- labelSelector: 'team=payments' | ||
- labelSelector: 'team=orders' | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters