Skip to main content

Config DB

ConfigDB component lookup enables you to query configs from the database to use as components.

kubernetes-cluster.yml
apiVersion: canaries.flanksource.com/v1
kind: Topology
metadata:
name: kubernetes-cluster
spec:
type: KubernetesCluster
icon: kubernetes
schedule: '@every 10m'
id:
javascript: properties.id
components:
- name: nodes
icon: server
type: KubernetesNode
lookup:
configDB:
- query: SELECT name, type FROM config_items WHERE type = 'Kubernetes::Node'
FieldDescriptionSchemeRequired
authenticationUsername and password value, configMapKeyRef or SecretKeyRef for ConfigDB serverAuthentication
displayTemplate to display query results in text (overrides default bar format for UI)Template
hostHost is the server against which check needs to be executedstringYes
labelsLabels for the checkLabels
queryQuery that needs to be executed on the serverstringYes
transformTemplate to transform results toTemplate

Results

The results variable in the template will contain the following fields

FieldDescriptionScheme
rowsstderr from the script[]map[string]any
countexit code of the scriptint