Skip to content

Commit

Permalink
chore: doc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
moshloop committed Jul 14, 2024
1 parent e13c2dc commit 684ddbf
Show file tree
Hide file tree
Showing 33 changed files with 479 additions and 348 deletions.
5 changes: 4 additions & 1 deletion canary-checker/docs/reference/1-alert-manager.mdx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
title: Alertmanager
hide_title: true
sidebar_class_name: popular
---

# <Icon name="prometheus"/> Alertmanager
# <Icon name="prometheus">Alertmanager</Icon>

Checks [Prometheus AlertManager](https://prometheus.io/docs/alerting/latest/alertmanager/) for any firing alerts.

Expand Down Expand Up @@ -59,6 +60,7 @@ spec:
}
]}/>
<SkipOSS>
## Relationships
<Fields
Expand Down Expand Up @@ -122,6 +124,7 @@ Lookup specifies the type of lookup to perform.
]}
/>
</SkipOSS>
## Inserting checks into different namespaces
You can specify different namespaces for checks using the `namespace` field. This is helpful when checks are dynamically generated via transformation
Expand Down
3 changes: 2 additions & 1 deletion canary-checker/docs/reference/1-aws-cloudwatch.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
title: AWS Cloud Watch
hide_title: true
---

# <Icon name="aws-cloudwatch" /> CloudWatch
# <Icon name="aws-cloudwatch" size={32}> CloudWatch</Icon>

Cloudwatch checks for all active alarms

Expand Down
5 changes: 4 additions & 1 deletion canary-checker/docs/reference/1-catalog.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
---
title: Flanksource Catalog
title: Config DB
hide_title: true
sidebar_class_name: popular
---

# <Icon name="config-db">Config DB</Icon>

Runs a [config-db](https://github.com/flanksource/config-db) query.

```yaml title="catalog.yaml" file=../../../modules/canary-checker/fixtures/external/catalog.yaml
Expand Down
71 changes: 31 additions & 40 deletions canary-checker/docs/reference/1-folder.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ title: Folder

Checks the contents of a folder for size, age and count. Folder based checks are useful in a number of scenarios:

* Verifying that backups have been uploaded and are the appropriate size
* Checking that logs or other temporary files are being cleaned up
* For batch processes:
* Checking if files are being processed (and/or produced)
* Checking the size of queue processing backlog
* Checking if any error (`.err` or `.log`) files have been produced.
- Verifying that backups have been uploaded and are the appropriate size
- Checking that logs or other temporary files are being cleaned up
- For batch processes:
- Checking if files are being processed (and/or produced)
- Checking the size of queue processing backlog
- Checking if any error (`.err` or `.log`) files have been produced.

```yaml title="folder-check.yaml"
apiVersion: canaries.flanksource.com/v1
Expand All @@ -27,8 +27,6 @@ spec:
minCount: 10
```
<HealthCheck name="folder" edition="standard" rows={[
{
field: 'path',
Expand All @@ -49,16 +47,15 @@ spec:

]}/>


## FolderFilter

| Field | Description | Scheme | Required |
| --------- | ----------------------------------------------------------- | ---------------------------------------------------- | -------- |
| `maxAge` | MaxAge the latest object should be younger than defined age | [Duration](/reference/types#duration) | |
| `maxSize` | MaxSize of the files inside the searchPath | [Size](/reference/types#size) | |
| `minAge` | MinAge the latest object should be older than defined age | [Duration](/reference/types#duration) | |
| `minSize` | MinSize of the files inside the searchPath | [Size](/reference/types#size) | |
| `regex` | Filter files based on regular expression | *[regex](https://github.com/google/re2/wiki/Syntax)* | |
| `maxAge` | MaxAge the latest object should be younger than defined age | [Duration](/reference/types#duration) | |
| `maxSize` | MaxSize of the files inside the searchPath | [Size](/reference/types#size) | |
| `minAge` | MinAge the latest object should be older than defined age | [Duration](/reference/types#duration) | |
| `minSize` | MinSize of the files inside the searchPath | [Size](/reference/types#size) | |
| `regex` | Filter files based on regular expression | _[regex](https://github.com/google/re2/wiki/Syntax)_ | |

e.g. to verify that database backups are being performed

Expand All @@ -72,7 +69,7 @@ spec:
folder:
- path: /data/backups
filter:
regex: "pg-backups-.*.zip"
regex: 'pg-backups-.*.zip'
maxAge: 1d # require a daily backup
minSize: 10mb # the backup should be at least 10mb
```
Expand All @@ -81,34 +78,33 @@ spec:

The following fields are available in `test`, `display` and `transform` [expressions](../concepts/expressions)

| Field | Scheme |
| --------------------- | -------------------------------------------------- |
| `Oldest` | [os.FileInfo](https://pkg.go.dev/io/fs#FileInfo) |
| `Newest` | [os.FileInfo](https://pkg.go.dev/io/fs#FileInfo) |
| `MinSize` | [os.FileInfo](https://pkg.go.dev/io/fs#FileInfo) |
| `MaxSize` | [os.FileInfo](https://pkg.go.dev/io/fs#FileInfo) |
| `SupportsTotalSize` (Only true for SMB folders) | bool |
| Field | Scheme |
| --------------------------------------------------- | -------------------------------------------------- |
| `Oldest` | [os.FileInfo](https://pkg.go.dev/io/fs#FileInfo) |
| `Newest` | [os.FileInfo](https://pkg.go.dev/io/fs#FileInfo) |
| `MinSize` | [os.FileInfo](https://pkg.go.dev/io/fs#FileInfo) |
| `MaxSize` | [os.FileInfo](https://pkg.go.dev/io/fs#FileInfo) |
| `SupportsTotalSize` (Only true for SMB folders) | bool |
| `SupportsAvailableSize` (Only true for SMB folders) | bool |
| `TotalSize` | int64 |
| `AvailableSize` | int64 |
| `Files` | [[]os.FileInfo](https://pkg.go.dev/io/fs#FileInfo) |
| `TotalSize` | int64 |
| `AvailableSize` | int64 |
| `Files` | [[]os.FileInfo](https://pkg.go.dev/io/fs#FileInfo) |

### FolderFilter

| Field | Description | Scheme | Required |
| --------- | ----------- | ----------------------- | -------- |
| Field | Description | Scheme | Required |
| --------- | ----------- | --------------------------------------- | -------- |
| `minAge` | | [`Duration`](/reference/types#duration) | |
| `maxAge` | | [`Duration`](/reference/types#duration) | |
| `minSize` | | [`Size`](/reference/types#size) | |
| `maxSize` | | [`Size`](/reference/types#size) | |
| `regex` | | `string` | |

| `regex` | | `string` | |

## Connection Types

### SFTP

<Fields connection="sftp"/>
<Fields connection="sftp" />

<details summary="SFTP Check">
<div>
Expand All @@ -118,12 +114,9 @@ The following fields are available in `test`, `display` and `transform` [express
</div>
</details>



### S3

<Fields connection="aws"/>

<Fields connection="aws" />

```yaml title="s3-check.yaml"
# ...
Expand All @@ -145,10 +138,9 @@ spec:
</div>
</details>


### SMB

<Fields connection="smb"/>
<Fields connection="smb" />

```yaml title="smb-check.yaml"
# ...
Expand All @@ -161,7 +153,7 @@ spec:
#...
```

<Fields connection="smb"/>
<Fields connection="smb" />

<div className="mt-5"/>
<details summary="SMB / CIFS" >
Expand All @@ -172,10 +164,9 @@ spec:
</div>
</details>


### GCS

<Fields connection="gcp"/>
<Fields connection="gcp" />

```yaml title="gcs-check.yaml"
# ...
Expand All @@ -187,6 +178,7 @@ spec:
gcpConnection:
# ...
```

<div className="mt-5"/>
<details summary="GCS Check" >
<div>
Expand All @@ -195,4 +187,3 @@ spec:

</div>
</details>

2 changes: 1 addition & 1 deletion canary-checker/docs/reference/1-s3-protocol.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ tags:
- enterprise
---

# <Icon name="s3" /> S3 Protocol
# <Icon name="aws-s3" /> S3 Protocol

Checks if S3 compatible endpoints (like Minio, EMC ECS) are functioning correctly,

Expand Down
2 changes: 1 addition & 1 deletion canary-checker/docs/reference/3-gcs-database-backup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: GCS Database Backup
sidebar_class_name: beta
---

# <Icon name="database2" /> Google Cloud SQL Backups
# <Icon name="database" /> Google Cloud SQL Backups

Checks if a Google Cloud SQL instance has been successfully backed up recently.

Expand Down
8 changes: 1 addition & 7 deletions common/src/components/Helm.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import CodeBlock from '@theme/CodeBlock'
import CopyButton from '@theme/CodeBlock/CopyButton'
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import Link from '@docusaurus/Link';
import { useState, useRef } from "react"
import Details from '@theme/Details';
import Properties from '@site/docs/installation/_properties.mdx'


function generateCli(
Expand Down Expand Up @@ -48,7 +45,6 @@ function generateCli(
if (wait) {
s += " --wait \n"
}
console.log('generate', s, values)
return s

}
Expand All @@ -72,8 +68,6 @@ export default function Helm({
const [cli, setCli] = useState(generateCli(
repo, repoName, chart, namespace, createNamespace, createRepo, wait, state, valueFile, args))

console.log(values)

return <>

{/* <form>
Expand Down Expand Up @@ -130,7 +124,7 @@ export default function Helm({
<Tabs>

<TabItem value="helm" label="Helm">
<CodeBlock language="bash" forwardRef={bash}>
<CodeBlock language="bash">
{cli}
</CodeBlock>

Expand Down
29 changes: 22 additions & 7 deletions common/src/components/Icon.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,28 @@

import React from "react";
export default function Icon({ name, height = "32px", className, url }) {
let img = <img
src={`/img/icons/${name}.svg`}
style={{ height: { height } }}
className={className}
/>;
import { IconMap as Icons } from "@flanksource/icons/mi";
import clsx from "clsx"

export default function Icon({ name, height = 22, className, url, children }) {
name = name
.replaceAll("--", "-")
.replaceAll("::", "-")
.toLowerCase()
.replaceAll("k8-", "k8s-")
.replaceAll("kubernetes-", "k8s-");

let IconSVG = Icons[name];

if (!IconSVG) {
return <span>{name}</span>
}
let img = <span className={clsx("align-middle", className)}><IconSVG className="my-auto" name={name} size={height} />
<span className="pl-1.5">{children}</span>
</span>

if (url != null) {
return <a href={url} className="pr-2">{img}</a>;
return <a href={url}>{img}</a>
}
return img
}

Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ title: Architecture

Mission Control has a micro-service architecture with a shared data source with multiple deployment models.

import EnvVarTypes from './partials/_envVarTypes.mdx'



1. CLI
2. Kubernetes (Helm Chart)
Expand All @@ -31,8 +34,5 @@ All services use a shared database and model via the [duty](https://github.com/f
* Library updates happen automatically using dependabot


## Kubernetes & Gitops

Mission control is kubernetes-native with all configuration being possible by Custom Resource Definition (CRD's)

The single source of truth is still the database, the operators only function is to synchronize CRD's into the database and update the CRD status periodically.
57 changes: 8 additions & 49 deletions mission-control/docs/config-db/concepts/health_status.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,14 @@
title: Health & Status
---

A config item has two key attributes associated with it: health and status. These attributes are assigned by the scrapers by evaluating the config.
Each config item has attributes used to quickly determine the health and status of an item.

The health attribute represents the overall condition or well-being of the config item. It can have one of the following values: healthy, unhealthy, unknown, or warning. This attribute provides a high-level indication of whether the config item is functioning as expected or if there are any issues that need attention.
- `health` can be one of `healthy`, `unhealthy`,`unknown`, `warning` and correspondes with RAG (Red, Amber, Green) status that will be associated with an item
- `status` is a config type specific short description of the current running state e.g. `Running`, `Terminating`, `in-use`
- `ready` indicates whether an item is still progressing

The status attribute, on the other hand, provides more granular information about the current state or phase of the config item. The possible values for the status attribute can vary widely depending on the type of config item being monitored. For example, a Kubernetes Pod config could have statuses like "Running", "Pending", "Terminating", and so on.
:::note Health is orthagonal to readiness
A config item could have a state of `heath: unhealthy, status: failed, ready: true` - this indicates that the item will unlikely change its state, while an item of `health: health, status: rolling-out, ready: false` indicates a healthy item that has not yet finished rolling out.
:::

To illustrate with an example, consider an AWS EC2 instance that is currently in the process of shutting down. In this case, the scrapers would assign an "Unknown" health and a "Deleting" status to this config item.

## Health

- healthy
- unhealthy
- unknown
- warning

## Status

Here's a list of all the possible statuses (subject to change):

- Completed
- CrashLoopBackOff
- Creating
- Degraded
- Deleted
- Deleting
- Error
- Healthy
- Inaccesible
- Info
- Maintenance
- Missing
- Pending
- Progressing
- Restarting
- Rolling Out
- Rollout Failed
- Running
- Scaled to Zero
- Scaling
- Scaling Down
- Scaling Up
- Starting
- Stopped
- Stopping
- Suspended
- Terminating
- Unhealthy
- Unknown
- Unschedulable
- Updating
- UpgradeFailed
- Warning
The [github.com/flanksource/is-healthy](https://github.com/flanksource/is-healthy) is used to derive these conditions.
Loading

0 comments on commit 684ddbf

Please sign in to comment.