Skip to content

Add CRD Documentation for Mission Control #387

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
148 changes: 148 additions & 0 deletions mission-control/docs/reference/crds/canary.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
---
title: Canary CRD
---

# Canary

The `Canary` CRD allows you to define health checks for monitoring the availability and performance of your services and infrastructure.

## Definition

```yaml
apiVersion: canaries.flanksource.com/v1
kind: Canary
metadata:
name: example-canary
spec:
# Schedule on which to execute the canary
interval: 30s

# Specify the number of replicas for this canary
replicas: 1

# Checks to run for this canary
http:
- name: example-http-check
url: https://example.com

dns:
- name: example-dns-check
server: 8.8.8.8
query: example.com
querytype: A
```

## Schema

The `Canary` resource supports the following top-level fields:

| Field | Description |
|-------|-------------|
| `spec.interval` | The schedule on which to execute the canary checks |
| `spec.replicas` | The number of replicas for this canary |
| `spec.cloudwatch` | AWS CloudWatch checks |
| `spec.containerdPull` | Containerd image pull checks |
| `spec.containerdPush` | Containerd image push checks |
| `spec.dns` | DNS resolution checks |
| `spec.dockerPull` | Docker image pull checks |
| `spec.dockerPush` | Docker image push checks |
| `spec.elasticsearch` | Elasticsearch health and query checks |
| `spec.exec` | Command execution checks |
| `spec.folder` | File system and folder checks |
| `spec.git` | Git repository checks |
| `spec.github` | GitHub actions and repository checks |
| `spec.helm` | Helm chart checks |
| `spec.http` | HTTP endpoint checks |
| `spec.icmp` | ICMP/Ping checks |
| `spec.jmeter` | JMeter performance tests |
| `spec.junit` | JUnit test checks |
| `spec.kubernetes` | Kubernetes resource checks |
| `spec.ldap` | LDAP connectivity checks |
| `spec.mongodb` | MongoDB health and query checks |
| `spec.mssql` | Microsoft SQL Server checks |
| `spec.mysql` | MySQL database checks |
| `spec.postgres` | PostgreSQL database checks |
| `spec.redis` | Redis health checks |
| `spec.restic` | Restic backup checks |
| `spec.s3` | S3 bucket checks |
| `spec.tcp` | TCP connection checks |
| `spec.webhook` | Webhook checks |

## Status

The Canary controller updates the resource with status information, including:

| Status Field | Description |
|--------------|-------------|
| `status.lastCheck` | The time of the last check |
| `status.status` | The overall status of the canary (Healthy, Unhealthy) |
| `status.message` | A descriptive message about the current status |
| `status.errorMessage` | Detailed error message when checks fail |
| `status.uptime1h` | Availability percentage over the last hour |
| `status.latency1h` | Average response time over the last hour |
| `status.lastTransitionedTime` | The time when the status last changed |

## Example

### Basic HTTP Check

```yaml
apiVersion: canaries.flanksource.com/v1
kind: Canary
metadata:
name: website-check
spec:
interval: 1m
http:
- name: website
url: https://example.com
thresholdMillis: 500
responseCodes: [200]
responseContent: "Welcome"
maxSSLExpiry: 7d
```

### DNS Check

```yaml
apiVersion: canaries.flanksource.com/v1
kind: Canary
metadata:
name: dns-check
spec:
interval: 2m
dns:
- name: google-dns
server: 8.8.8.8:53
query: google.com
querytype: A
minrecords: 1
```

### Multiple Check Types

```yaml
apiVersion: canaries.flanksource.com/v1
kind: Canary
metadata:
name: multi-check
spec:
interval: 5m
http:
- name: api-check
url: https://api.example.com/health
thresholdMillis: 200
tcp:
- name: database-connection
host: db.example.com
port: 5432
icmp:
- name: network-check
endpoint: 192.168.1.1
```

## See Also

- [Canary Checker Documentation](../../canary-checker/index.mdx)
- [HTTP Checks Reference](../../canary-checker/docs/reference/1-http.mdx)
- [TCP Checks Reference](../../canary-checker/docs/reference/1-tcp.mdx)
152 changes: 152 additions & 0 deletions mission-control/docs/reference/crds/component.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
---
title: Component CRD
---

# Component

The `Component` CRD allows you to define and organize components in your infrastructure, enabling you to model, visualize, and track various elements of your system.

## Definition

```yaml
apiVersion: canaries.flanksource.com/v1
kind: Component
metadata:
name: example-component
spec:
# Human readable name of the component
name: Example Service

# Optional type classification
type: service

# Description of the component
description: An example component for demonstration purposes

# Owner of the component
owner: platform-team

# Icon to represent the component
icon: https://example.com/icons/service.svg

# Labels for categorization
labels:
environment: production
tier: frontend
```

## Schema

The `Component` resource supports the following fields:

| Field | Description |
|-------|-------------|
| `spec.name` | Human-readable name of the component |
| `spec.displayName` | Alternative display name for the component |
| `spec.description` | Description of the component's purpose |
| `spec.type` | Type classification (e.g., service, database, app) |
| `spec.subtype` | Sub-classification of the component type |
| `spec.icon` | Icon URL or name to visually represent the component |
| `spec.owner` | Owner of the component (team/person) |
| `spec.labels` | Key-value pairs for categorizing the component |
| `spec.config` | Component-specific configuration |
| `spec.items` | Child items or sub-components |
| `spec.properties` | Additional properties as key-value pairs |
| `spec.checks` | Health checks to perform for this component |
| `spec.dashboards` | Associated dashboards for monitoring |
| `spec.costs` | Cost tracking configuration |
| `spec.ticket` | Ticketing system integration |
| `spec.slo` | Service Level Objectives |
| `spec.statusMessage` | Custom status message |
| `spec.statusReason` | Reason for the current status |

## Status

The Component controller updates the resource with status information, including:

| Status Field | Description |
|--------------|-------------|
| `status.health` | Overall health status of the component |
| `status.costPerMonth` | Monthly cost of the component |
| `status.artifacts` | Associated artifacts |
| `status.dependencies` | Component dependencies |
| `status.incidents` | Active incidents related to the component |
| `status.lastScrape` | Timestamp of the last data scrape |
| `status.lastSeen` | Timestamp when the component was last seen |

## Examples

### Basic Component

```yaml
apiVersion: canaries.flanksource.com/v1
kind: Component
metadata:
name: frontend-web
spec:
name: Frontend Web Application
type: web-application
description: Customer-facing web application for product browsing and purchasing
owner: web-team
labels:
tier: frontend
environment: production
criticality: high
```

### Component with Checks

```yaml
apiVersion: canaries.flanksource.com/v1
kind: Component
metadata:
name: payment-service
spec:
name: Payment Processing Service
type: microservice
description: Handles all payment processing operations
owner: payments-team
checks:
http:
- name: api-health
url: https://payments.example.com/health
interval: 1m
thresholdMillis: 300
tcp:
- name: db-connection
host: payments-db.example.com
port: 5432
interval: 5m
```

### Hierarchical Component

```yaml
apiVersion: canaries.flanksource.com/v1
kind: Component
metadata:
name: e-commerce-platform
spec:
name: E-Commerce Platform
type: platform
description: Complete e-commerce solution
owner: platform-team
items:
- name: Web Frontend
type: web-application
owner: web-team
- name: Authentication Service
type: microservice
owner: auth-team
- name: Payment Processing
type: microservice
owner: payments-team
- name: Order Management
type: microservice
owner: orders-team
```

## See Also

- [Topology CRD](./topology.mdx)
- [Component Relationships](../topology/relationships.mdx)
Loading