Skip to main content

CRD

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, /guide/canary-checker/reference/database, etc.string
pushSet type of topology e.g. service, API, website, library, /guide/canary-checker/reference/database, etc.HTTPConnection

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

Components are the building blocks of a Topology. The component specification provides a way for you to define the properties and characteristics of each Component in the Topology.

Component

FieldDescriptionSchemeRequired
checksSpecify checks based on inline and selector[]Check
componentsRawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or pre-compute a JSON encoding.[]Component
configsSpecify selectors for config items that should be associated with this component.[]Config
forEachOnly applies when using lookup. When specified, the components and properties specified under ForEach will be templated using the components returned by the lookup.ForEach
iconSpecify icon for componentstring
idSpecify unique ID for componentID
labelsLabels for the componentmap[string]string
lifecycleThe lifecycle state of the component e.g. production, staging, dev, etc.string
lookupLookup component definitions from an external source, use the forEach property to iterate over the results to further enrich each component.Lookup
nameSet name for componentstring
namespaceSet namespace for componentstring
orderSet integer order value for componentint
ownerSpecify owner of componentstring
propertiesCustomize component properties as to be visualized on Mission control UI[]Property
relationshipsSpecify relationship of component[]RelationshipSpec
selectorsSpecify component for topology based on fieldSelector and labelSelector[]ResourceSelector
tooltipSet tooltip outlining information pertaining to the componentstring
typeSet type of component e.g. service, API, website, library, /guide/canary-checker/reference/database, etc.string

RelationshipSpec

FieldDescriptionSchemeRequired
refSet reference for components relationshipstring
typeSet the type of relationship, e.g. dependsOn, subcomponentOf, providesApis, consumesApisstring

ForEach

FieldDescriptionSchemeRequired
componentsSet name for component[]Component
propertiesSet name for property[]Property
configsSet name for config[]Config
relationshipSet name for relationship[]RelationshipSpec
checksSet name for check[]Check

Config Selector

FieldDescriptionSchemeRequired
idSpecify the name of the config item.[]string
nameSpecify the name of the config item.string
namespaceSpecify the namespace of the config item.string
typeSpecify type of config item.string
classSpecify type of config item.string
external_idSpecify type of config item.string
tagsSpecify tags of config item.map[string]string

Check

FieldDescriptionSchemeRequired
inlineDefine a new health check inlineCanarySpec
selectorSelect an existing health check[]ResourceSelector

Lookup

FieldDescriptionTypeRequired
catalogLookup catalogs in configDB.[]Catalog
execLookup by running (bash/powershell) scripts.[]Exec
kubernetesLookup kubernetes resources[]Kubernetes
httpLookup an HTTP endpoint.[]HTTP
mongodbQuery records from a MongoDB /guide/canary-checker/reference/database.[]MongoDB
sqlQuery records from a MSSQL /guide/canary-checker/reference/database.[]SQL
redisQuery records from a Redis server.[]Redis
prometheusQuery metrics from Prometheus.[]Prometheus