+
+
+## Types
+
+| name | Description | UI Component | Schema | Properties |
+| ----------- | ---------------------------------- | ------------ | --------- | ---------------------------------------------------------- |
+| `check` | Limits the value to a check. | Dropdown | `string` | [`Check`](#checks) |
+| `checkbox` | Boolean value toggle | Checkbox | `boolean` | - |
+| `code` | Text area | Code Editor | `string` | [`Code`](#code) |
+| `component` | Limits the value to a component. | Dropdown | `string` | [`Component`](#component) |
+| `config` | Limits the value to a config item. | Dropdown | `string` | [`Config`](#config) |
+| `list` | Specify a custom list of values | Dropdown | `string` | [`List`](#list) |
+| `people` | Limits the value to people. | Dropdown | `string` | [`People`](#people) |
+| `team` | Limits the value to teams. | Dropdown | `string` | - |
+| `text` | Text input | Text Input | `string` | [`Text`](#text) |
+
+
+### component
+
+| Field | Description | Schema |
+| ------ | -------------------------------------- | -------- |
+| `filter.type` | Limit the components to the given type | `string` |
+
+### config
+
+| Field | Description | Schema |
+| ------ | -------------------------------------- | -------- |
+| `filter.type` | Limit the components to the given type | `string` |
+
+### checks
+
+| Field | Description | Schema |
+| ------ | -------------------------------------- | -------- |
+| `filter.type` | Limit the components to the given type | `string` |
+
+### code
+
+
+| Field | Description | Schema |
+| ---------- | ----------------------------------------- | -------- |
+| `language` | Langauge name e.g. yaml, json, toml, etc. | `string` |
+
+### people
+
+| Field | Description | Schema |
+| ------ | ---------------------------------- | ------- |
+| `role` | Limit the people to the given role | `string |
+
+### text
+
+| Field | Description | Schema |
+| ----------- | ------------------------------------------------------- | --------- |
+| `multiline` | Whether the text field should be rendered as a text are | `boolean` |
+
+### list
+
+| Field | Description | Schema |
+| ------- | -------------------------------- | -------- |
+| `options[].label` | Specify label of the list option | `string` |
+| `options[].value` | Specify value of the list option | `string` |
diff --git a/mission-control/docs/reference/playbooks/playbook.md b/mission-control/docs/reference/playbooks/playbook.md
new file mode 100644
index 00000000..5d523221
--- /dev/null
+++ b/mission-control/docs/reference/playbooks/playbook.md
@@ -0,0 +1,69 @@
+# Playbooks
+
+
+| Field | Description | Scheme | Required |
+| ------------- | ------------------------------------------------------------ | ---------------------------------------------------- | -------- |
+| `description` | A short description | `string` | `true` |
+| `icon` | Icon for the playbook | `string` | |
+| `on` | Specify events to automatically trigger the Playbook. . | [`[]Trigger`](#trigger) | |
+| `runsOn` | Specify the [runners](./runners.md) that can run this playbook. One will be chosen on random. When empty, the playbook will run on the main instance itself | `[]string` | |
+| `templatesOn` | Specify where the templating of the action spec should occur | `host` or `agent` | |
+| `checks` | Specify selectors for checks that can be run on the Playbook. | [`[]ResourceSelector`](/reference/resource-selector) | |
+| `configs` | Specify selectors for config items that can be run on the Playbook. | [`[]ResourceSelector`](/reference/resource-selector) | |
+| `components` | Specify selectors for component items that can be run on the Playbook. | [`[]ResourceSelector`](/reference/resource-selector) | |
+| `parameters` | Define a set of labeled parameters for the Playbook. | [`[]Parameter`](./parameters) | |
+| `actions` | Specify the set of actions to run. | [`[]Action`](#action) | `true` |
+| `approval` | Specify who can approve runs on this playbook. | [`Approval`](#approval) | |
+
+
+## Action
+
+| Field | Description | Scheme | Required |
+| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- | -------- |
+| `name` | Name of action. | `string` | `true` |
+| `runsOn` | Specify the [runners](./runners.md) that can run this action. One will be chosen on random. When empty, the playbook will run on the main instance itself | `[]string` | |
+| `templatesOn` | Specify where the templating of the action spec should occur | `host` or `agent` | |
+| `delay` | A delay before running the action e.g. `8h` | `Duration` or [`Expression`](../concepts/expression) | |
+| `filter` | Whether to run the step or not | [`Expression`](../concepts/expression) | |
+| `timeout` | Timeout on this action. | `Duration` | |
+| `exec` | Specify exec of action. | [`Exec`](/playbooks/actions/exec.md) | |
+| `gitops` | Specify gitops of action. | [`Gitops`](/playbooks/actions/gitops.md) | |
+| `http` | Specify http of action. | [`Http`](/playbooks/actions/http.md) | |
+| `sql` | Specify sql of action. | [`Sql`](/playbooks/actions/sql.md) | |
+| `pod` | Specify pod of action. | [`Pod`](/playbooks/actions/pod.md) | |
+| `notification` | Specify notification of action. | [`Notification`](/playbooks/actions/notification.md) | |
+
+
+## Trigger
+
+| Field | Description | Scheme | Required |
+| ----------- | ---------------------------------------------------- | ---------------------------------------- | -------- |
+| `canary` | Setup trigger on canary events | [`EventTrigger`](../concepts/events#event-spec) | |
+| `component` | Setup trigger on health check events. | [`EventTrigger`](../concepts/events#event-spec) | |
+| `webhook` | Setup a webhook endpoint that triggers the playbook. | [`WebhookTrigger`](../concepts/webhook#spec) | |
+
+
+## Approval
+
+Authorization safeguards can be applied to playbook runs, ensuring their execution is limited to specific individuals or teams who grant approval.
+
+```yaml title="approve-kubernetes-scaling.yaml"
+#...
+kind: Playbook
+spec:
+ #...
+ approval:
+ type: any
+ approvers:
+ people:
+ - admin@local
+ teams:
+ - DevOps
+```
+
+| Field | Description | Scheme | Required |
+| ----------- | ------------------------------ | ------------ | -------- |
+| `type` | How many approvals required. Defaults to `all` | `any` or `all` | `false` |
+| `approvers.[]people` | Login or id of a person| `People` | `false` |
+| `approvers.[]teams` | Name or id of a team | `Team` | `false` |
+
diff --git a/mission-control/docs/reference/property.md b/mission-control/docs/reference/property.md
index 6085c8e1..279d1e77 100644
--- a/mission-control/docs/reference/property.md
+++ b/mission-control/docs/reference/property.md
@@ -1,23 +1,26 @@
# Property
-| Field | Description | Schema | Required |
-| ---------------- | ----------------------------------- | -------- | -------- |
-| `label` | The label of the property. | `string` | |
-| `name` | The name of the property. | `string` | |
-| `tooltip` | The tooltip of the property. | `string` | |
-| `icon` | The icon of the property. | `string` | |
-| `type` | The type of the property. | `string` | |
-| `color` | The color of the property. | `string` | |
-| `order` | The order of the property. | `int` | |
-| `headline` | The headline of the property. | `bool` | |
-| `text` | The text of the property. | `string` | |
-| `value` | The value of the property. | `int` | |
-| `unit` | The unit of the property. | `string` | |
-| `max` | The max of the property. | `int` | |
-| `min` | The min of the property. | `int` | |
-| `status` | The status of the property. | `string` | |
-| `lastTransition` | The lastTransition of the property. | `string` | |
-| `links` | The links of the property. | `[]Link` | |
+| Field | Description | Scheme | Required |
+| -------------- | ----------------------------------------------------------------------------- | --------------------------------------- | ---------- |
+| `name` | Set name for component property. | `string` | |
+| `value` | Mutually exclusive with `text` | `int64` | |
+| `text` | Mutually exclusive with `value` | `string` | |
+| `type` | Specify type of component property, one of `currency`, `number`, `url` | `string` | |
+| `unit` | Unit for component property e.g. milliseconds, bytes, millicores, epoch etc. | `string` | |
+| `color` | Set color for component property. | `string` | |
+| `headline` | Toggle headline for component property. | `bool` | |
+| `icon` | Specify icon for component. | `string` | |
+| `label` | Specify label for component property. | `string` | |
+| `links` | Set links pertaining to component. | [`[]Link`](#link) | |
+| `max` | Set maximum value for components to display. | `int64` | `optional` |
+| `min` | Set minimum value for components to display. | `int64` | |
+| `order` | Set integer value order for component property. | `int` | |
+| `status` | Specify status for component property. | `string` | |
+| `tooltip` | Set tooltip outlining information pertaining to the component. | `string` | |
+| `configLookup` | Specify lookup for component config. | [`ConfigLookup`](#config-lookup) | `optional` |
+
+
+
## Link
@@ -29,3 +32,15 @@
| `icon` | The icon of the link. | `string` | |
| `text` | The text of the link. | `string` | |
| `label` | The label of the link. | `string` | |
+
+
+## Config Lookup
+
+| Field | Description | Scheme | Required |
+| --------------- | -------------------------------------------------------- | -------------------------------------- | -------- |
+| `config.name` | The name of the config item. | `string` | |
+| `config.type` | The type of config item. | `string` | |
+| `config.labels` | Match labels of the config item, all labels must match | `map[string]string` | |
+| `field` | A JSONPath expression to lookup the value in the config. | `string` | `true` |
+| `display` | Apply transformations to the value. | [`Display`](../concepts/templating.md) | |
+| `id` | The UUID of config item, rarely used | `string` | |
diff --git a/mission-control/docs/reference/resource-selector.md b/mission-control/docs/reference/resource-selector.md
new file mode 100644
index 00000000..847e2862
--- /dev/null
+++ b/mission-control/docs/reference/resource-selector.md
@@ -0,0 +1,50 @@
+# ResourceSelector
+
+Resource Selectors are used in multiple places including:
+
+* Attaching components to a topology
+* Creating relationships between configs and configs/components
+* Finding resources to run health checks or playbooks on
+
+| Field | Description | Scheme | Required |
+| ------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -------- |
+| id | ID of the component | `string` | |
+| name | Name of the component/config | `string` | |
+| namespace | Select resources in this namespace only, if empty find resources in all namespaces | `string` | |
+| types | Match any of the types specified | `[]string` | |
+| statuses | Match any of the statuses specified | `[]string` | |
+| labelSelector | Kubernetes Style Label Selector | [LabelSelector](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) | |
+| fieldSelector | Kubernetes Style Field Selector Property fields of the component in kubernetes format (or database columns: owner, topology_id, parent_id) | [FieldSelector](https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors/) | |
+| agent | Select resources created on this agent, Defaults to `local` | `uuid`, `{name}`, `local` or `all` | |
+| cache | Cache settings to use for the results, expensive selectors or selectors that are are use very often should be cached for longer periods. Defaults to `max-age=10m` | `no-cache`, `no-store` or `max-age={duration}` | |
+
+
+
+## Examples
+
+### Selecting components in a topology
+
+```yaml title="topology-component-selectors.yaml"
+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'
+```
diff --git a/mission-control/docs/reference/resource_selector.md b/mission-control/docs/reference/resource_selector.md
deleted file mode 100644
index 1a8d3335..00000000
--- a/mission-control/docs/reference/resource_selector.md
+++ /dev/null
@@ -1,44 +0,0 @@
-# ResourceSelector
-
-We use resource selectors to link components with each other
-
-| Field | Description | Scheme | Required |
-|---------------|----------------------------------------------------------------------------------------------------------------------------------------|----------|----------|
-| id | ID of the component | string | |
-| name | Name of the component | string | |
-| namespace | Namespace of the component | string | |
-| types | List of types of the component | []string | |
-| statuses | List of statuses of the component | []string | |
-| labelSelector | Labels to select the component in kubernetes format | string | |
-| fieldSelector | Property fields of the component in kubernetes format (or database columns: owner, topology_id, parent_id) | string | |
-| agent | ID or name of the agent (Default: local agent). Use 'all' to select all the agents | string | |
-| cache | One 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
-```yaml
-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'
-```
diff --git a/mission-control/docs/reference/types.md b/mission-control/docs/reference/types.md
new file mode 100644
index 00000000..4e5dd8f4
--- /dev/null
+++ b/mission-control/docs/reference/types.md
@@ -0,0 +1,12 @@
+# Common Types
+
+## Duration
+
+Valid time units are "s", "m", "h", "d", "w", "y". Eg:
+
+- `1m15s`
+- `1h5m`
+- `23h`
+- `1d8h`
+- `1w6d8h`
+- `19w0d8h`
diff --git a/mission-control/docs/system-properties.md b/mission-control/docs/system-properties.md
new file mode 100644
index 00000000..6057f71c
--- /dev/null
+++ b/mission-control/docs/system-properties.md
@@ -0,0 +1,11 @@
+topology.cache.age
+ctx.Properties().Int("check.status.retention.days", 30)*9
+
+ },
+ BatchSize: ctx.Properties().Int("push_queue.batch.size", 50),
+ ConsumerOption: &postq.ConsumerOption{
+ NumConsumers: ctx.Properties().Int("push_queue.consumers", 5),
+
+ component.retention.period = 7d
+ canary.retention.age
+ check.retention.age
diff --git a/mission-control/docs/topology/concepts/catalog.md b/mission-control/docs/topology/concepts/catalog.md
index 40676265..279b9f5b 100644
--- a/mission-control/docs/topology/concepts/catalog.md
+++ b/mission-control/docs/topology/concepts/catalog.md
@@ -4,7 +4,7 @@ You can link components with configs. The linked config items appears in the com
To establish this relationship, you need to specify which config items to link with using the `config` field.
-
+
```yaml title="kubernetes-cluster.yaml"
apiVersion: canaries.flanksource.com/v1
diff --git a/mission-control/docs/topology/concepts/health-checks.md b/mission-control/docs/topology/concepts/health-checks.md
index c4abd751..b4b62a2e 100644
--- a/mission-control/docs/topology/concepts/health-checks.md
+++ b/mission-control/docs/topology/concepts/health-checks.md
@@ -12,7 +12,7 @@ Health checks can be associated in 2 ways:
| Field | Description | Scheme | Required |
| ---------- | -------------------------------- | -------------------------------------------------------------- | -------- |
| `inline` | Define a new health check inline | [`CanarySpec`](../../canary-checker/reference/canary-spec.mdx) | |
-| `selector` | Select an existing health check | [`[]ResourceSelector`](../../reference/resource_selector) | |
+| `selector` | Select an existing health check | [`[]ResourceSelector`](../../reference/resource-selector) | |
### Selector
diff --git a/mission-control/docs/topology/concepts/lookup.md b/mission-control/docs/topology/concepts/lookup.md
index c6e565c3..8aecadf2 100644
--- a/mission-control/docs/topology/concepts/lookup.md
+++ b/mission-control/docs/topology/concepts/lookup.md
@@ -87,7 +87,7 @@ spec:
| `properties` | Create or lookup properties for each component | [`[]Property`](./properties.md) | |
| `configs` | Link configuration items for each component | [`[]ConfigSelector`](./catalog.md#config-selector) | |
| `checks` | Create or link health checks for each component | [`[]CheckSelector`](./health-checks.md#check) | |
-| `selectors` | Select existing components to be used as the child components. | [`[]ResourceSelector`](../../reference/resource_selector.md) | |
+| `selectors` | Select existing components to be used as the child components. | [`[]ResourceSelector`](../../reference/resource-selector.md) | |
## Templating
diff --git a/mission-control/docs/topology/concepts/properties.md b/mission-control/docs/topology/concepts/properties.md
index d4e47f13..85f24363 100644
--- a/mission-control/docs/topology/concepts/properties.md
+++ b/mission-control/docs/topology/concepts/properties.md
@@ -23,29 +23,8 @@ properties:
text: '447'
```
-
+
-## Property
-
-| Field | Description | Scheme | Required |
-| -------------- | ----------------------------------------------------------------------------- | --------------------------------------- | ---------- |
-| `name` | Set name for component property. | `string` | |
-| `value` | Mutually exclusive with `text` | `int64` | |
-| `text` | Mutually exclusive with `value` | `string` | |
-| `type` | Specify type of component property, one of `currency`, `number`, `url` | `string` | |
-| `unit` | Unit for component property e.g. milliseconds, bytes, millicores, epoch etc. | `string` | |
-| `color` | Set color for component property. | `string` | |
-| `headline` | Toggle headline for component property. | `bool` | |
-| `icon` | Specify icon for component. | `string` | |
-| `label` | Specify label for component property. | `string` | |
-| `links` | Set links pertaining to component. | [`[]Link`](#link) | |
-| `max` | Set maximum value for components to display. | `int64` | `optional` |
-| `min` | Set minimum value for components to display. | `int64` | |
-| `order` | Set integer value order for component property. | `int` | |
-| `status` | Specify status for component property. | `string` | |
-| `summary` | Set Summary for component property e.g Healthy, Unhealthy, Warning, and Info. | [`Template`](../concepts/templating.md) | `optional` |
-| `tooltip` | Set tooltip outlining information pertaining to the component. | `string` | |
-| `configLookup` | Specify lookup for component config. | [`ConfigLookup`](#configlookup) | `optional` |
### Configuration Lookup
@@ -73,22 +52,3 @@ spec:
This `config` object is used to find the config item to lookup a value from, if there are multiple matches, the first match is used.
-| Field | Description | Scheme | Required |
-| --------------- | -------------------------------------------------------- | -------------------------------------- | -------- |
-| `config.name` | The name of the config item. | `string` | |
-| `config.type` | The type of config item. | `string` | |
-| `config.labels` | Match labels of the config item, all labels must match | `map[string]string` | |
-| `field` | A JSONPath expression to lookup the value in the config. | `string` | `true` |
-| `display` | Apply transformations to the value. | [`Display`](../concepts/templating.md) | |
-| `id` | The UUID of config item, rarely used | `string` | |
-
-### Link
-
-| Field | Description | Scheme | Required |
-| --------- | ----------------------------------------------------------- | -------- | -------- |
-| `icon` | Set icon for link. | `string` | |
-| `label` | Set label for link. | `string` | |
-| `text` | Set text of choice for link. | `string` | |
-| `tooltip` | Set tooltip outlining information pertaining to the link. | `string` | |
-| `type` | Specify type of link e.g. documentation, support, playbook. | `string` | |
-| `url` | Specify URL for link. | `string` | |
diff --git a/mission-control/docs/topology/examples/embedding.md b/mission-control/docs/topology/examples/embedding.md
new file mode 100644
index 00000000..84675da4
--- /dev/null
+++ b/mission-control/docs/topology/examples/embedding.md
@@ -0,0 +1 @@
+# Embedding Cards
diff --git a/mission-control/docs/topology/overview.md b/mission-control/docs/topology/overview.md
index ee37ae46..4158e150 100644
--- a/mission-control/docs/topology/overview.md
+++ b/mission-control/docs/topology/overview.md
@@ -1,9 +1,84 @@
+---
+slug: /topology
+title: Topology
+hide_title: true
+# hide_table_of_contents: true
+
+pagination_next: canary-checker/health-checks
+pagination_prev: playbooks/overview
+---
+
+
# Topology
-
+A topology is a represenation of logical system made up of components and sub-components. Many views can be created using the same underlying components based on the way the consumer thinks about the system - e.g. from an Infrastructure or Application focused view.
+
+
+
+