CRD
This page defines the specification for Topology. There are few samples in the examples section.
Field | Description | Scheme | Required |
---|---|---|---|
id | Specify unique ID for topology | IDSelector | |
components | Specify the topology fields for your service, application, check, etc. | []Component | |
configs | Specify selectors for config items that should be related with this topology. | []ConfigSelector | |
groupBy | Specify the catalog tag (& optionally the tag selector) to group the topology. | []GroupBy | |
icon | Set an icon class for topology. | Icon | |
owner | Specify owner for the topology. | string | |
properties | Customize topology properties as to be visualized on Mission control UI. | []Property | |
schedule | Set schedule to update topology at the set interval. | string | |
text | Set description or text of choice pertaining to topology. | string | |
tooltip | Set tooltip outlining information pertaining to the topology. | string | |
type | Set type of topology e.g. service, API, website, library, /guide/canary-checker/reference/database, etc. | string | |
push | Set type of topology e.g. service, API, website, library, /guide/canary-checker/reference/database, etc. | HTTPConnection |
ID Selector
Field | Description | Scheme |
---|---|---|
expr | ||
javascript | ||
template |
You must specify one of
expr
,javascript
ortemplate
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.
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.
Field | Description | Scheme |
---|---|---|
tag* | The tag to group by. |
|
selector | Narrow down the tags. |
---
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
Field | Description | Scheme | Required |
---|---|---|---|
checks | Specify checks based on inline and selector | []Check | |
components | RawMessage 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 | |
configs | Specify selectors for config items that should be associated with this component. | []Config | |
forEach | Only applies when using lookup. When specified, the components and properties specified under ForEach will be templated using the components returned by the lookup. | ForEach | |
icon | Specify icon for component | string | |
id | Specify unique ID for component | ID | |
labels | Labels for the component | map[string]string | |
lifecycle | The lifecycle state of the component e.g. production, staging, dev, etc. | string | |
lookup | Lookup component definitions from an external source, use the forEach property to iterate over the results to further enrich each component. | Lookup | |
name | Set name for component | string | |
namespace | Set namespace for component | string | |
order | Set integer order value for component | int | |
owner | Specify owner of component | string | |
properties | Customize component properties as to be visualized on Mission control UI | []Property | |
relationships | Specify relationship of component | []RelationshipSpec | |
selectors | Specify component for topology based on fieldSelector and labelSelector | []ResourceSelector | |
tooltip | Set tooltip outlining information pertaining to the component | string | |
type | Set type of component e.g. service, API, website, library, /guide/canary-checker/reference/database, etc. | string |
RelationshipSpec
Field | Description | Scheme | Required |
---|---|---|---|
ref | Set reference for components relationship | string | |
type | Set the type of relationship, e.g. dependsOn, subcomponentOf, providesApis, consumesApis | string |
ForEach
Field | Description | Scheme | Required |
---|---|---|---|
components | Set name for component | []Component | |
properties | Set name for property | []Property | |
configs | Set name for config | []Config | |
relationship | Set name for relationship | []RelationshipSpec | |
checks | Set name for check | []Check |
Config Selector
Field | Description | Scheme | Required |
---|---|---|---|
id | Specify the name of the config item. | []string | |
name | Specify the name of the config item. | string | |
namespace | Specify the namespace of the config item. | string | |
type | Specify type of config item. | string | |
class | Specify type of config item. | string | |
external_id | Specify type of config item. | string | |
tags | Specify tags of config item. | map[string]string |
Check
Field | Description | Scheme | Required |
---|---|---|---|
inline | Define a new health check inline | CanarySpec | |
selector | Select an existing health check | []ResourceSelector |
Lookup
Field | Description | Type | Required |
---|---|---|---|
catalog | Lookup catalogs in configDB. | []Catalog | |
exec | Lookup by running (bash/powershell) scripts. | []Exec | |
kubernetes | Lookup kubernetes resources | []Kubernetes | |
http | Lookup an HTTP endpoint. | []HTTP | |
mongodb | Query records from a MongoDB /guide/canary-checker/reference/database. | []MongoDB | |
sql | Query records from a MSSQL /guide/canary-checker/reference/database. | []SQL | |
redis | Query records from a Redis server. | []Redis | |
prometheus | Query metrics from Prometheus. | []Prometheus |