Skip to main content

Topology

This page defines the specification for Topology. There are few samples in the examples section.

FieldDescriptionSchemeRequired
idSpecify unique ID for topologyIDSelector
componentsSpecify the topology fields for your service, application, check, etc.[]Component
configsSpecify selectors for config items that should be related with this topology.[]ConfigSelector
groupBySpecify the catalog tag (& optionally the tag selector) to group the topology.[]GroupBy
iconSet an icon class for topology.Icon
ownerSpecify owner for the topology.string
propertiesCustomize topology properties as to be visualized on Mission control UI.[]Property
scheduleSet schedule to update topology at the set interval.string
textSet description or text of choice pertaining to topology.string
tooltipSet tooltip outlining information pertaining to the topology.string
typeSet type of topology e.g. service, API, website, library, database, etc.string

ID Selector

FieldDescriptionScheme
expr

CEL

javascript

Javascript

template

Go Template

You must specify one of expr, javascript or template

Group By

A single topology definition can generate multiple distinct topologies by grouping the resources based on a config tag. Grouping by tags provides a convenient way to manage and organize your topologies based on logical boundaries or dimensions, such as environment, region, or cluster. For example, if you have configs scraped from three different clusters (aws, azure, gcp), grouping the topology by the cluster tag will generate three separate topologies, one for each cluster tag value (aws, azure, gcp).

This allows you to define a single topology that can automatically generate multiple topologies & stay up-to-date and aligned as your infrastructure grows and new clusters or environments are added without having to ever update the topology.

info

It is important to understand that group by tag works only when a toplogy is built from catalog & config lookups/selectors.
Config tags are crucial to the functioning of grouping.

FieldDescriptionScheme
tag*

The tag to group by.

string

selector

Narrow down the tags.

ResourceSelector

---
apiVersion: canaries.flanksource.com/v1
kind: Topology
metadata:
name: kubernetes-clusters
spec:
icon: flux
type: Topology
schedule: "@every 5m"
groupBy:
tag: cluster
components:
- icon: nodes
name: Nodes
components:
- name: Nodes Component
type: lookup
lookup:
catalog:
- name: ""
test: {}
display:
expr: >
dyn(results).map(r, {
'name': r.name,
'icon': 'node',
'status': r.status,
'status_reason': r.description,
'selectors': [{'labelSelector': 'app.kubernetes.io/instance='+r.name}],
}).toJSON()
selector:
- types:
- Kubernetes::Node