Skip to content

Commit

Permalink
chore: fix canary checker docs
Browse files Browse the repository at this point in the history
  • Loading branch information
moshloop committed Jul 14, 2024
1 parent b217941 commit 71373d1
Show file tree
Hide file tree
Showing 28 changed files with 901 additions and 747 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ site/
.docusaurus
node_modules
.vscode
modules/
20 changes: 7 additions & 13 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
[submodule "mission-control/canary-checker/canary-checker"]
path = mission-control/canary-checker/canary-checker
url = https://github.com/flanksource/canary-checker
[submodule "mission-control/modules/config-db"]
path = mission-control/modules/config-db
[submodule "modules/config-db"]
path = modules/config-db
url = https://github.com/flanksource/config-db.git
[submodule "mission-control/modules/mission-control"]
path = mission-control/modules/mission-control
[submodule "modules/mission-control"]
path = modules/mission-control
url = https://github.com/flanksource/mission-control.git
[submodule "mission-control/modules/canary-checker"]
path = mission-control/modules/canary-checker
url = https://github.com/flanksource/canary-checker
[submodule "docs-vale-package"]
path = docs-vale-package
url = https://github.com/flanksource/docs-vale-package
[submodule "modules/canary-checker"]
path = modules/canary-checker
url = https://github.com/flanksource/canary-checker.git
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.PHONY: lint
lint:
vale sync
vale canary-checker/docs
vale mission-control/docs
markdownlint mission-control/docs
markdownlint canary-checker/docs


.PHONY:
sync:
git submodule update --init --recursive

update-submodules:
git submodule update --remote --merge && git submodule sync
105 changes: 58 additions & 47 deletions canary-checker/docs/getting-started.mdx
Original file line number Diff line number Diff line change
@@ -1,68 +1,80 @@
---
title: Getting Started
---

import { HiOutlineExternalLink } from "react-icons/hi";

# Getting Started

<Step step={1} name="Install canary checker">
1. Install canary checker using helm

```bash
helm repo add flanksource https://flanksource.github.io/charts
helm repo update
helm install canary-checker \
flanksource/canary-checker \
-n "canary-checker" \
--create-namespace
```
<p/>

2. Create a new check

```bash
helm repo add flanksource https://flanksource.github.io/charts
helm repo update
helm install canary-checker flanksource/canary-checker -n "canary-checker" --create-namespace
```
</Step>
<Step step={2} name="Create a new check">
```yaml title="canary.yaml"
apiVersion: canaries.flanksource.com/v1
kind: Canary
metadata:
name: http-check
spec:
interval: 30
http:
- name: basic-check
url: https://httpbin.demo.aws.flanksource.com/status/200
- name: failing-check
url: https://httpbin.demo.aws.flanksource.com/status/500
```
<p/>
3. And then apply it to the cluster:

```shell
kubectl apply -f canary.yaml
```
<p/>
<Details summary="Run the check locally">
You can also run the check locally to see its output by using the [cli](./cli)

```yaml title="canary.yaml"
apiVersion: canaries.flanksource.com/v1
kind: Canary
metadata:
name: http-check
spec:
interval: 30
http:
- name: basic-check
url: https://httpbin.demo.aws.flanksource.com/status/200
- name: failing-check
url: https://httpbin.demo.aws.flanksource.com/status/500
```
```bash
canary-checker run canary.yaml
```

And then apply it to the cluster:
<Asciinema id="594517" width="850px"/>
</Details>

```shell
kubectl apply -f canary.yaml
```

:::info
You can also run the check locally to see its output by using the [cli](./cli)
4. Check the status via kubectl

```bash
canary-checker run canary.yaml
```
```shell
kubectl get canary
```

<Asciinema id="594517" width="850px"/>
:::
<Asciinema id="tXluDS5sH68gVdko4qctIZEC1"/>

</Step>
<Step name="Check the status" step={3}>
5. Port Forward the dashboard

```shell
kubectl get canary
```
You can access the web dashboard by forwarding the port:

<Asciinema id="tXluDS5sH68gVdko4qctIZEC1"/>
```bash
kubectl -n canary-checker port-forward svc/canary-checker-ui 8080:80
```
<p/>
6. View the dashboard

</Step>
<Step step={4} name="Check the Dashboard">
The dashboard can be accessed at <HiOutlineExternalLink/>[http://localhost:8080](http://localhost:8080)

You can access the web dashboard by forwarding the port:

```bash
kubectl -n canary-checker port-forward svc/canary-checker-ui 8080:80
```

![](./images/http-checks.png)
![](./images/http-checks.png)

[http://localhost:8080](http://localhost:8080)

The canary checker itself only presents an API. To view the data graphically, the Flanksource UI is required, and is installed by default. The UI should be configured in [values.yaml](https://github.com/flanksource/canary-checker/blob/699f31a2326034f761ba1b30d966436d6318dd06/chart/values.yaml#L105) to allow external access via ingress

Expand All @@ -74,7 +86,6 @@ The canary checker itself only presents an API. To view the data graphically, th

More details regarding ingress configuration can be found in the [kubernetes documentation](https://kubernetes.io/docs/concepts/services-networking/ingress/)

</Step>

## Getting Help

Expand Down
60 changes: 60 additions & 0 deletions canary-checker/docs/health-checks.canary.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
slug: /overview
title: Health Checks
id: health-checks
---

<img src="/img/health-checks.svg" style={{width: "900px"}}/>


Canary Checker is a Kubernetes native health check platform that periodically runs different types of tests:


1. Synthetic

Synthetic checks are periodically run by canary checker to directly test services/applications by generating requests using http, sql, mongo, redis, ldap, etc.

1. Passive

Passive checks consolidate alerts from monitoring systems like Prometheus, Datadog, Dynatrace, CloudWatch and ElasticSearch

1. Infrastructure

Active infrastructure checks provision infrastructure (e.g. EC2 Instances, Kubernetes Pods) and then run synthetic checks against them to verify the ability to provision infrastructure. This allows detecting issues in infrastructure provisioning processes.

1. Integration

Integration checks run automated test suites using tools like Playwright, JUnit, Newman and K6 to validate end-to-end functionality across services and infrastructure.


### Metrics Exporter

In addition to returning a pass/fail status, health checks can export metrics to Prometheus, replacing the need for many custom prometheus exporters.

### Scripting

Evaluate the health of checks using scripts in CEL, Javascript or Go Templating. Scripts can also be used to filter and transform alerts from external systems.


## Dashboard

<Step step={1} name="Dashboard" style="list">
The health checks page provides a high level view of the overall health of all services, infrastructure and applications. It surfaces recent failures and provides a high level latency and reliability metrics.

![](./images/canary-dashboard.png)
</Step>


<Step step={1} name="Prometheus" style="list">

[Prometheus](canary-checker/concepts/metrics) metrics are exposed from health checks to provide high level visibility into latency, error rates and other metrics. This allows monitoring the health of services and applications using existing Prometheus alerts and [Grafana](canary-checker/concepts/metrics/grafana) dashboards.

</Step>

<Step step={1} name="Synthetic" style="list">
Synthetic checks are periodically run by canary checker to directly test services/applications by generating requests using http, sql, mongo, redis, ldap, etc.

</Step>



Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
pagination_next: notifications/index
pagination_prev: topology/index
slug: /canary-checker
id: health-checks
title: Health Checks
---

Expand Down
Loading

0 comments on commit 71373d1

Please sign in to comment.