Skip to main content

ResourceSelector

We use resource selectors to link components with each other

FieldDescriptionSchemeRequired
idID of the componentstring
nameName of the componentstring
namespaceNamespace of the componentstring
typesList of types of the component[]string
statusesList of statuses of the component[]string
labelSelectorLabels to select the component in kubernetes formatstring
fieldSelectorProperty fields of the component in kubernetes format (or database columns: owner, topology_id, parent_id)string
agentID or name of the agent (Default: local agent). Use 'all' to select all the agentsstring
cacheOne 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

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'