### Exec Setup with Bun Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/guide/playbooks/actions/exec.mdx Configuration to automatically install the Bun runtime environment before executing a script. ```yaml file=/modules/mission-control/fixtures/playbooks/exec-deps-pkgs-bun.yaml ``` -------------------------------- ### Exec Setup with Python Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/guide/playbooks/actions/exec.mdx Configuration to automatically install Python runtime using uv, supporting PEP 723 inline script metadata. ```yaml file=/modules/mission-control/fixtures/playbooks/exec-deps-pkgs-python.yaml ``` -------------------------------- ### Verify APM Hub Installation Source: https://github.com/flanksource/docs/blob/main/docs/apm-hub/tutorials/install.md Run the 'apm-hub serve' command to start the APM Hub server and verify the installation. The output will show loaded backends and server information. ```shell > apm-hub serve 2023-03-17T11:22:43.590+0545 INFO loaded 0 backends in total ____ __ / __/___/ / ___ / _// __/ _ \/ _ \ /___/\__/_//_/\___/ v4.6.3 High performance, minimalist Go web framework https://echo.labstack.com ____________________________________O/_______ O\ ⇨ http server started on [::]:8080 ``` -------------------------------- ### Start Minikube Cluster Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/installation/local-testing.md Initializes and starts a minikube cluster. ```bash minikube start ``` -------------------------------- ### Catalog YAML Example Source: https://github.com/flanksource/docs/blob/main/canary-checker/docs/reference/1-catalog.mdx Example of a catalog configuration file. ```yaml ```yaml title="catalog.yaml" file=/modules/canary-checker/fixtures/external/catalog.yaml ``` ``` -------------------------------- ### Pod Action Example Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/guide/playbooks/actions/pod.mdx Example of a Pod Action configuration to ping a database from a pod. ```yaml apiVersion: mission-control.flanksource.com/v1 kind: PlaybookAction metadata: name: ping-database-from-pod spec: action: pod # Pod Action configuration pod: # Full pod specification spec: containers: - name: ping image: alpine:latest command: ["sh", "-c", "echo \"Pinging database...\"; sleep 30"] # Maximum length of the logs to show maxLength: 10kb # Files generated in the pod that need to be saved artifacts: - path: "/tmp/output.txt" ``` -------------------------------- ### Exec Scraper with Git Checkout and Python Setup Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/guide/config-db/scrapers/exec.mdx An advanced example demonstrating a git checkout followed by a Python script execution, including inline dependency management. ```yaml exec: - script: | #!/usr/bin/env python3 # /// script # dependencies = [ # "pyyaml", # "requests", # ] # /// import yaml import json # Your script logic here print(json.dumps([{"id": "1", "type": "Example", "name": "test"}])) setup: python: version: "3.10.19" ``` -------------------------------- ### Install Kubernetes Playbooks Helm Chart Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/integrations/kubernetes/playbooks.md Install the mission-control-playbooks-kubernetes helm chart. This chart needs to be installed only once. ```bash helm install mission-control-playbooks-kubernetes mission-control-playbooks-kubernetes --create-namespace ``` -------------------------------- ### Example Config Query Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/guide/views/queries/configs.md This is an example of a configuration query in YAML format. It specifies the file path and the relevant lines for the query definition. ```yaml apiVersion: v1 kind: CronJob metadata: name: "{{ name }}" spec: schedule: "{{ schedule }}" jobTemplate: spec: template: spec: containers: - name: "{{ name }}" image: "{{ image }}" command: ["/bin/sh", "-c", "{{ command }}"] restartPolicy: OnFailure ``` -------------------------------- ### Public ntfy.sh Connection Example Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/reference/connections/ntfy.mdx Example of configuring a connection to the public ntfy.sh service. Ensure the topic name is unique. ```yaml apiVersion: mission-control.flanksource.com/v1 kind: Connection metadata: name: ntfy-alerts spec: ntfy: host: https://ntfy.sh topic: my-alerts-topic ``` -------------------------------- ### Install mission-control-flux Helm Chart Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/integrations/flux/topology.md Install the mission-control-flux Helm chart to enable Flux Topology. This chart should be installed only once and groups all Flux resources by cluster. ```bash helm upgrade --install mission-control-flux oci://ghcr.io/flanksource/charts/mission-control-flux --namespace flux-system --create-namespace ``` -------------------------------- ### Install and Run Render Script for Mission Control Source: https://github.com/flanksource/docs/blob/main/scripts/README.md Navigate to the mission-control directory, install dependencies, and run the render-for-context7 script. ```bash cd mission-control npm install # Install dependencies npm run render-for-context7 ``` -------------------------------- ### Example API Documentation Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/style-guide/graphics.mdx An example demonstrating the structure and content of an API documentation entry. ```APIDOC ## GET /api/v1/health ### Description Retrieves the current health status of all monitored services. ### Method GET ### Endpoint /api/v1/health ### Request Example ```curl curl -X GET https://api.example.com/api/v1/health \ -H "Authorization: Bearer YOUR_TOKEN" ``` ### Response #### Success Response (200) Returns a JSON object with service health information. ``` -------------------------------- ### Install and Run Render Script for Canary Checker Source: https://github.com/flanksource/docs/blob/main/scripts/README.md Navigate to the canary-checker directory, install dependencies, and run the render-for-context7 script. ```bash cd canary-checker npm install # Install dependencies npm run render-for-context7 ``` -------------------------------- ### PubSub Scraper Configuration Example Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/guide/config-db/scrapers/pubsub.mdx Example configuration for the PubSub scraper, specifying GCP Pub/Sub details. ```yaml ```yaml title="pubsub-scraper.yaml" file=/modules/config-db/fixtures/pubsub-gcp.yaml ``` ``` -------------------------------- ### SQL Query Configuration Example Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/guide/views/queries/sql.md This example demonstrates the configuration of an SQL query within a Mission Control view. It specifies the file path and line numbers for the configuration. ```yaml ```yaml title="failing-health-checks.yaml" file=/modules/mission-control/fixtures/views/failing-health-checks.yaml {33-59} ``` ``` -------------------------------- ### HTTP Query Configuration Example Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/guide/views/queries/http.md This example demonstrates a basic HTTP query configuration, including URL, method, and JSONPath for data extraction. ```yaml recipes-http.yaml: http: url: https://api.example.com/data jsonpath: "$.data.items[*].name" headers: - name: "X-Api-Key" value: "my-secret-key" ``` -------------------------------- ### Install Helm Chart Source: https://github.com/flanksource/docs/blob/main/canary-checker/docs/concepts/secret-management.md Command to install the podinfo Helm chart. This is a prerequisite for using `helmRef`. ```bash helm install podinfo podinfo/podinfo -n podinfo --set ingress.enabled=true ``` -------------------------------- ### Capability Section Example Source: https://github.com/flanksource/docs/blob/main/mission-control/AGENTS.md Defines a section for a specific integration capability, including use cases and an example configuration. ```mdx --- **Use cases:** - [Specific use case 1] - [Specific use case 2] - [Specific use case 3] ### Example ```yaml title="platform-scraper.yaml" apiVersion: configs.flanksource.com/v1 kind: ScrapeConfig metadata: name: platform-scraper spec: schedule: '@every 5m' platform: - # minimal working config ``` ``` -------------------------------- ### Scale Deployment Playbook Example Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/reference/playbooks/parameters.mdx An example of a playbook YAML file used for scaling deployments. This snippet shows the basic structure and file reference. ```yaml file: /modules/mission-control/fixtures/playbooks/scale-deployment.yaml ``` -------------------------------- ### HTTP Query with Pagination Example Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/guide/views/queries/http.md This example demonstrates how to implement pagination in an HTTP query by specifying page and per_page parameters in the URL. ```yaml queries: paged-data: http: url: https://api.example.com/items?page=1&per_page=100 connection: connection://my-api ``` -------------------------------- ### Example Resource with Origin Annotation Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/guide/playbooks/actions/gitops.mdx This is an example of a resource that would be created with the `config.kubernetes.io/origin` annotation when the `originAnnotations` build metadata is applied. The annotation details the path of the kustomization file that generated it. ```yaml apiVersion: apps/v1 kind: Deployment metadata: annotations: config.kubernetes.io/origin: | path: monitoring/alertmanager.yaml ... ``` -------------------------------- ### Install Canary Checker using Makefile Source: https://github.com/flanksource/docs/blob/main/common/snippets/_install.mdx Use the provided Makefile to download and install Canary Checker, automatically detecting the OS and architecture. ```bash OS = $(shell uname -s | tr '[:upper:]' '[:lower:]') ARCH = $(shell uname -m | sed 's/x86_64/amd64/') wget -nv -nc https://github.com/flanksource/canary-checker/releases/latest/download/canary-checker_$(OS)_$(ARCH) \ -O /usr/local/bin/canary-checker && \ chmod +x /usr/local/bin/canary-checker ``` -------------------------------- ### Kubernetes Scraper Configuration Example Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/guide/config-db/scrapers/kubernetes.mdx This is a basic example of a Kubernetes scraper configuration file. It shows how to set up event exclusions and severity keywords. ```yaml spec: kubernetes: - event: exclusions: reason: - SuccessfulCreate - Created - DNSConfigForming severityKeywords: error: - failed - error warn: - backoff - nodeoutofmemory ``` -------------------------------- ### BigQuery Logs Configuration Example Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/guide/config-db/scrapers/logs.mdx Example configuration for scraping logs from BigQuery, specifying project, query, and optional credentials. ```yaml apiVersion: configs.flanksource.com/v1 kind: ScrapeConfig metadata: name: unified-app-logs spec: logs: - openSearch: url: https://elasticsearch:9200 index: app-logs-* fieldMapping: timestamp: ['@timestamp'] message: ['message'] severity: ['level', 'log.level'] id: ['trace.id', 'request_id'] - loki: url: http://loki:3100 query: '{app="myservice"}' fieldMapping: timestamp: ['ts', 'timestamp'] message: ['line', 'msg'] severity: ['level', 'detected_level'] id: ['traceID'] ``` -------------------------------- ### LogQL Query Examples Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/integrations/loki.mdx Provides examples of LogQL queries for various use cases, including filtering by namespace, app, content, and using rate functions. ```logql # All logs from a namespace {namespace="production"} ``` ```logql # Logs containing "error" (case-insensitive) {app="api"} |~ "(?i)error" ``` ```logql # JSON logs with specific field {job="app"} | json | level="error" ``` ```logql # Rate of errors per minute rate({app="api"} |= "error" [1m]) ``` ```logql # Logs from multiple apps {app=~"api|worker|scheduler"} ``` -------------------------------- ### GCP PubSub Configuration Example Source: https://github.com/flanksource/docs/blob/main/canary-checker/docs/reference/1-pubsub.mdx Example configuration for a GCP PubSub check. Ensure you have the correct project ID and subscription name. ```yaml ```yaml title="pubsub-gcp.yaml" file=/modules/canary-checker/fixtures/external/pubsub-gcp.yaml ``` ``` -------------------------------- ### GCP KMS Configuration Example Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/reference/connections/KMS/gcp-kms.mdx Example YAML configuration for a GCP KMS connection. Ensure the file path is correctly set. ```yaml connection: gcp_kms project_id: "your-gcp-project-id" location: "your-gcp-kms-location" key_ring: "your-gcp-kms-key-ring" key_name: "your-gcp-kms-key-name" ``` -------------------------------- ### Bar Gauge Configuration Example Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/guide/views/panels/bargauge.md Example YAML configuration for a Bar Gauge panel. This demonstrates how to set up the panel with properties like min, max, unit, and thresholds. ```yaml min: "0" max: "100" precision: 2 unit: "%" group: "CPU" format: "percentage" thresholds: - percent: 75 color: "#f59e0b" - percent: 90 color: "#ef4444" ``` -------------------------------- ### Container Width Examples Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/style-guide/web.mdx Examples of different max-width classes for controlling content width. Use these to define layout constraints for various content types. ```html

Maximum content width: 1100px

For main application layouts and wide content areas

``` ```html

Article width: 900px

For blog posts, documentation, and reading content

``` ```html

Narrow content: 700px

For forms, narrow layouts, and focused content

``` ```html

Form max width: 600px

For forms, modals, and input-focused interfaces

``` -------------------------------- ### Install Canary Checker Helm Chart Source: https://github.com/flanksource/docs/blob/main/canary-checker/docs/installation/1-helm.canary.md Deploy the canary-checker Helm chart to your Kubernetes cluster. This command installs the chart with a default configuration, including an embedded PostgreSQL database. For persistent history, refer to the Database installation guide. ```bash ``` -------------------------------- ### Example VM Configuration (web-server.json) Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/guide/config-db/tutorials/date-mapping.md A sample JSON file representing a virtual machine with an 'installed_on' date field. ```json { "name": "web-server", "ip": "192.168.1.100", "port": 80, "role": "frontend", "installed_on": "2024-03-01 12:30:00" } ``` -------------------------------- ### Example VM Configuration (api-server.json) Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/guide/config-db/tutorials/date-mapping.md A sample JSON file representing another virtual machine with a 'deployed_at' date field. ```json { "name": "api-server", "ip": "192.168.1.101", "port": 80, "role": "backend", "deployed_at": "2024-03-02 14:25:00" } ``` -------------------------------- ### Example Input Configuration Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/guide/config-db/concepts/transform.md This is a sample JSON configuration file that will be processed by the `file-scraper`. ```json { "name": "Config1", "id": 1, "password": "p1", "secret": "secret_1" } ``` -------------------------------- ### Get File Extension Source: https://github.com/flanksource/docs/blob/main/canary-checker/docs/scripting/cel.mdx Extracts the file name extension from a path. The extension is the suffix starting at the final dot; it's empty if no dot exists. ```go filepath.Ext("/opt/image.jpg") // .jpg ``` -------------------------------- ### Install a Canary via Kubernetes Manifest Source: https://github.com/flanksource/docs/blob/main/canary-checker/README.md Apply a Kubernetes manifest to install a sample HTTP canary. This command uses kubectl to apply a YAML file from a remote URL. ```bash kubectl apply -f https://raw.githubusercontent.com/flanksource/canary-checker/master/fixtures/minimal/http_pass_single.yaml ``` -------------------------------- ### YAML Configuration Example Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/style-guide/graphics.mdx Demonstrates the format for a YAML configuration file, including API version, kind, and comments for configuration details. Always specify the language for syntax highlighting. ```yaml apiVersion: v1 kind: ConfigMap # Configuration details here ``` -------------------------------- ### Get Data Kind with Kind Source: https://github.com/flanksource/docs/blob/main/canary-checker/docs/scripting/gotemplate.mdx Returns the Kind of the given argument, which is a more general classification than its specific type. For example, 'slice' is a Kind, while '[]string' is a Type. ```go {{ kind "hello world" }} // string ``` ```go {{ dict "key1" true "key2" "foobar" | test.Kind }} // map ``` -------------------------------- ### PostgreSQL Connection Examples Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/guide/config-db/scrapers/postgres.mdx Demonstrates various ways to configure PostgreSQL connections, including direct connection strings, connection references, and templated connections using secret references for authentication. ```yaml # Direct connection string connection: postgresql://user:password@host:5432/database?sslmode=require ``` ```yaml # Connection reference connection: connection://postgres/production ``` ```yaml # Templated connection with auth connection: postgresql://$(username):$(password)@host:5432/database auth: username: valueFrom: secretKeyRef: name: pg-credentials key: username password: valueFrom: secretKeyRef: name: pg-credentials key: password ``` -------------------------------- ### Basic API Health Check Canary Definition Source: https://github.com/flanksource/docs/blob/main/mission-control/blog/distributed-canaries/index.mdx Defines a simple HTTP canary to check the /health endpoint of an API service. This example is for a single cluster and demonstrates the repetitive nature of multi-cluster setups. ```yaml apiVersion: canaries.flanksource.com/v1 kind: Canary metadata: name: api-health spec: schedule: "@every 5m" http: - name: api-endpoint url: http://api-service.default.svc:8080/health responseCodes: [200] ``` -------------------------------- ### Install Dependencies Source: https://github.com/flanksource/docs/blob/main/mission-control/README.md Installs project dependencies using Yarn. ```bash yarn ``` -------------------------------- ### Example pipelines.yaml Configuration Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/guide/views/examples/pipeline-monitoring.md This YAML file defines pipeline configurations. Ensure it's correctly placed within your project structure. ```yaml ```yaml title="pipelines.yaml" file=/modules/mission-control/fixtures/views/pipelines.yaml ``` ``` -------------------------------- ### backups.yaml Configuration Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/guide/views/examples/database-backups.md Example YAML configuration file for setting up database backups. This file defines the backup parameters and schedule. ```yaml ```yaml title="backups.yaml" file=/modules/mission-control/fixtures/views/backups.yaml ``` ``` -------------------------------- ### State-Driven Cloud Resource Monitoring with Config-DB Source: https://github.com/flanksource/docs/blob/main/prompts/blog.md This example illustrates a state-driven approach using config-db to monitor cloud resources. It's more scalable and provides real-time alerts on state changes, suitable for platform-level health monitoring. ```go package main import ( "context" "fmt" "github.com/flanksource/config-db/api" "github.com/flanksource/config-db/db" "github.com/flanksource/config-db/utils" "github.com/flanksource/duty-duty/context" "github.com/flanksource/duty-duty/db" "github.com/flanksource/duty-duty/utils" "github.com/flanksource/flink/api" "github.com/flanksource/flink/pkg/cmd" "github.com/flanksource/flink/pkg/db" "github.com/flanksource/flink/pkg/models" "github.com/flanksource/flink/pkg/scheduler" "github.com/flanksource/flink/pkg/types" "github.com/flanksource/gomplate/v3" "github.com/flanksource/is-healthy/pkg/checks" "github.com/flanksource/is-healthy/pkg/types" "github.com/flanksource/model-matrix/pkg/model" "github.com/flanksource/model-matrix/pkg/utils" "github.com/flanksource/duty-duty/pkg/db" "github.com/flanksource/duty-duty/pkg/utils" "github.com/flanksource/duty-duty/pkg/context" ) func main() { ctx := context.Background() // Example: Watch for changes in an AWS EC2 instance state // This is a conceptual example; actual implementation would involve specific AWS SDK calls // and event handlers within the config-db framework. // Assume 'resource' is an object representing an EC2 instance with a 'State' field resource := map[string]interface{}{ "id": "i-0123456789abcdef0", "state": "running", } // Simulate a state change event newState := "stopped" if resource["state"] != newState { fmt.Printf("Resource state changed from %s to %s\n", resource["state"], newState) // In a real scenario, config-db would detect this change and trigger an event. // This event could then trigger playbooks or alerts. // For example, an event could be fired to a message queue or a webhook. api.FireEvent(ctx, api.Event{ Type: "resource.state.changed", ResourceID: resource["id"].(string), NewState: newState, OldState: resource["state"].(string), }) } } ``` -------------------------------- ### Install mission-control-gcp Helm Chart Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/integrations/gcp.mdx Install the mission-control-gcp Helm chart to enable GCP integration. Ensure you have the necessary prerequisites like Mission Control installed and kubectl access. Configure the chart with your GCP project name. ```bash helm install mission-control-gcp oci://ghcr.io/flanksource/charts/mission-control-gcp --version= --namespace=mission-control --create-namespace --set project= ``` -------------------------------- ### Deployment Configuration Example Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/guide/views/examples/deployment-monitoring.md This YAML file defines the configuration for deployments, specifying details relevant to monitoring and management. ```yaml apiVersion: v1 kind: Deployment metadata: name: my-app spec: replicas: 3 selector: matchLabels: app: my-app template: metadata: labels: app: my-app spec: containers: - name: my-app-container image: nginx:latest ports: - containerPort: 80 ``` -------------------------------- ### Sample Playbook Response (Database Backup) Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/guide/mcp/resources/playbooks.mdx This JSON response details a playbook for creating database backups. It outlines the playbook's metadata, description, and parameters, including required fields like database name and backup type, with available options and defaults. ```json { "id": "database-backup", "name": "Database Backup", "description": "Create a backup of the specified database and store it in the configured backup location", "category": "Database", "created_at": "2025-01-05T12:00:00Z", "updated_at": "2025-01-20T10:15:00Z", "parameters": [ { "name": "database_name", "type": "text", "required": true, "description": "The name of the database to backup", "example": "production_app_db" }, { "name": "backup_type", "type": "list", "required": true, "options": ["full", "incremental", "differential"], "default": "full", "description": "Type of backup to perform" } ] } ``` -------------------------------- ### GCP Scraper Configuration Example Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/guide/config-db/scrapers/gcp.mdx Example configuration for the GCP scraper, specifying the connection and resources to scrape. ```yaml logLevel: info schedule: "0 * * * *" retention: enabled: true days: 30 gcp: - project: "my-gcp-project" include: - "compute.googleapis.com/Instance" exclude: - "storage.googleapis.com/Bucket" auditLogs: dataset: "default._AllLogs" since: "7d" userAgents: - "*" principalEmails: - "*" permissions: - "*" serviceNames: - "compute.googleapis.com" methods: - "compute.instances.create" ``` -------------------------------- ### Helm Installation Component Source: https://github.com/flanksource/docs/blob/main/mission-control/AGENTS.md Embeds Helm and Flux install tabs for integrations that require specific Helm values. ```mdx ``` -------------------------------- ### Example File Backend Configuration Source: https://github.com/flanksource/docs/blob/main/docs/apm-hub/backends/file.md This configuration defines two file backends, one for Nginx access logs and another for Apache access logs, specifying their paths, routes, and labels. ```yaml apiVersion: apm-hub.flanksource.com/v1 kind: LoggingBackend metadata: name: k8s-backend spec: backends: - file: - routes: type: nginx idPrefix: pod-1- labels: name: acmehost type: Nginx path: - /var/log/nginx/access.log - routes: type: apache idPrefix: pod-1- labels: name: acmehost type: Apache path: - /var/log/apache2/access.log ``` -------------------------------- ### Install Canary Checker on macOS (arm64) Source: https://github.com/flanksource/docs/blob/main/common/snippets/_install.mdx Download and install the arm64 version of Canary Checker for macOS systems. ```bash wget https://github.com/flanksource/canary-checker/releases/latest/download/canary-checker_darwin_arm64 \ -O /usr/local/bin/canary-checker && \ chmod +x /usr/local/bin/canary-checker ``` -------------------------------- ### Install Canary Checker on macOS (amd64) Source: https://github.com/flanksource/docs/blob/main/common/snippets/_install.mdx Download and install the amd64 version of Canary Checker for macOS systems. ```bash wget https://github.com/flanksource/canary-checker/releases/latest/download/canary-checker_darwin_amd64 \ -O /usr/local/bin/canary-checker && \ chmod +x /usr/local/bin/canary-checker ``` -------------------------------- ### Install Canary Checker on Linux (arm64) Source: https://github.com/flanksource/docs/blob/main/common/snippets/_install.mdx Download and install the arm64 version of Canary Checker for Linux systems. ```bash wget https://github.com/flanksource/canary-checker/releases/latest/download/canary-checker_linux_arm64 \ -O /usr/bin/canary-checker && \ chmod +x /usr/bin/canary-checker ``` -------------------------------- ### Example [Platform] Health Check Configuration Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/integrations/_template.mdx Sets up a Canary resource to monitor [Platform] resources and services. Configure the 'interval' and the specific [platform] checks required. ```yaml apiVersion: canaries.flanksource.com/v1 kind: Canary metadata: name: [platform]-check spec: interval: 30 [platform]: - name: sample-check # Add minimal working configuration ``` -------------------------------- ### YAML Code Block Example Source: https://github.com/flanksource/docs/blob/main/prompts/style.md Format code and examples using MDX with a title attribute for the code block. ```yaml ```yaml title=some-title.yaml ``` ``` -------------------------------- ### SQL Server Connection String Source: https://github.com/flanksource/docs/blob/main/canary-checker/docs/reference/1-sql.mdx Example connection string for SQL Server. Replace placeholders with your actual credentials and server details. Note the format for server, user ID, password, port, and database. ```yaml kind: Canary spec: mssql: - url: "server=mssql.default.svc;user id=$(username);password=$(password);port=1433;database=master" # ... ``` -------------------------------- ### Install mission-control-kubernetes Helm Chart Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/integrations/kubernetes/catalog.mdx Installs the mission-control-kubernetes Helm chart. Ensure you replace 'CHANGEME' with your actual cluster name. ```bash helm upgrade --install mission-control-kubernetes oci://ghcr.io/flanksource/charts/mission-control-kubernetes \ --namespace mission-control \ --create-namespace \ --set clusterName=CHANGEME ``` -------------------------------- ### Example Notification Configuration for [Platform] Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/integrations/_template.mdx Configures a Notification resource to send alerts via [Platform]. Specify the '[platform]' connection URI and the 'events' to trigger notifications. ```yaml apiVersion: mission-control.flanksource.com/v1 kind: Notification metadata: name: [platform]-alerts spec: to: [platform]: [connection-uri] events: - incident.created - check.failed ``` -------------------------------- ### Install mission-control-helm Chart Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/integrations/helm.mdx Installs the mission-control-helm chart with specific configurations for playbooks and scrapers. Ensure FluxCD is running in the cluster. ```jsx ``` -------------------------------- ### Run Docusaurus Development Server Source: https://github.com/flanksource/docs/blob/main/AGENTS.md Use this command to start the Docusaurus development server for local previewing. ```bash yarn start ``` -------------------------------- ### Install Mission Control Playbooks Helm Chart Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/installation/saas/kubectl.mdx Install the `mission-control-playbooks-kubernetes` Helm chart using the specified kubeconfig file. ```shell helm install mission-control-playbooks-kubernetes flanksource/mission-control-playbooks-kubernetes --kubeconfig=./kubeconfig.yaml ``` -------------------------------- ### Create and Wait for Nginx Deployment Source: https://github.com/flanksource/docs/blob/main/mission-control/blog/state-based-alerting/index.md Use kubectl to create a deployment and wait until it is ready. This is a common setup step for testing deployment behaviors. ```bash kubectl create deployment nginx --image=nginx:latest --wait ``` -------------------------------- ### Duration Column Definition Example Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/guide/views/table/columns/duration.md Example of how to define a duration column in a YAML configuration file. Values are expected in nanoseconds. ```yaml duration: "2h 30m" ``` -------------------------------- ### Playbook Parameters Configuration Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/reference/playbooks/parameters.mdx Example of a playbook parameters configuration file, specifying various parameter types and their settings. ```yaml apiVersion: mission-control.tetrate.io/v1alpha1 kind: Playbook metadata: name: "example-playbook" spec: description: "An example playbook" parameters: - name: "check_param" description: "A check parameter" type: "check" checks: - name: "example-check" description: "An example check" - name: "config_param" description: "A config parameter" type: "config" config: filter: - "resource.name=example-resource" - name: "code_param" description: "A code parameter" type: "code" code: language: "yaml" - name: "people_param" description: "A people parameter" type: "people" people: role: "developer" - name: "text_param" description: "A text parameter" type: "text" text: multiline: true - name: "list_param" description: "A list parameter" type: "list" list: options: - label: "Option 1" value: "value1" - label: "Option 2" value: "value2" - name: "secret_param" description: "A secret parameter" type: "secret" ``` -------------------------------- ### Install APM Hub CLI on Linux (amd64) Source: https://github.com/flanksource/docs/blob/main/docs/apm-hub/tutorials/install.md Download the amd64 binary for Linux and make it executable in /usr/bin. ```shell wget https://github.com/flanksource/apm-hub/releases/latest/download/apm-hub_linux_amd64 \ -O /usr/bin/apm-hub && \ chmod +x /usr/bin/apm-hub ``` -------------------------------- ### AWS Scraper Configuration Example Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/guide/config-db/scrapers/aws.mdx This is an example of an AWS scraper configuration file. It demonstrates how to set up scraping for AWS resources. ```yaml schedule: "0 * * * *" retention: enabled: true duration: "24h" aws: - compliance: true cloudtrail: enabled: true costReporting: enabled: true exclude: - "ec2:instance:i-0123456789abcdef0" include: - "s3:bucket:my-bucket-*" ``` -------------------------------- ### Example Config with Access Entries Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/guide/config-db/scrapers/custom.mdx This JSON demonstrates a Mission Control configuration file that includes organization details, user, role, and group definitions, along with access control entries and change logs. It showcases how aliases are used for users, roles, and groups, and how external config IDs are referenced. ```json { "id": "test-org-role-access", "config": { "name": "Test Organization", "type": "organization" }, "users": [ { "name": "Charlie Brown", "account_id": "org-789", "user_type": "human", "email": "charlie@example.com", "aliases": ["charlie-brown", "charlie@example.com"] } ], "roles": [ { "name": "Editor", "account_id": "org-789", "role_type": "custom", "description": "Edit access", "aliases": ["editor-role", "edit-access"] } ], "groups": [ { "name": "Editors Group", "account_id": "org-789", "group_type": "team", "aliases": ["editors-group", "edit-team"] } ], "access": [ { "id": "role-access-001", "external_config_id": { "config_type": "Organization", "external_id": "test-org-role-access" }, "user": "charlie-brown", "role": "editor-role", "group": "editors-group" } ], "changes": [ { "change_type": "permission_grant", "summary": "Charlie granted editor access", "created_at": "2025-01-08T10:00:00Z" } ] } ``` -------------------------------- ### Crossplane Kubernetes Resource Example Source: https://github.com/flanksource/docs/blob/main/canary-checker/docs/reference/1-kubernetes-resource.mdx An example of a Kubernetes resource manifest used with Crossplane, demonstrating external resource management. ```yaml apiVersion: "apiextensions.crossplane.io/v1" kind: Composition metadata: name: "example-composition" spec: compositeTypeRef: apiVersion: "example.crossplane.io/v1alpha1" kind: "XNginx" resources: - name: "nginx" base: | apiVersion: "stable.nginx.crossplane.io/v1" kind: "Nginx" spec: replicas: 1 patches: - fromFieldPath: "spec.parameters.image" toFieldPath: "spec.parameters.image" ``` -------------------------------- ### Get Slack Health Emoji Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/reference/notifications/template_functions.mdx Use `slackHealthEmoji` to get the appropriate Slack emoji based on the health status string. ```js slackHealthEmoji(health) ``` -------------------------------- ### Install Canary Checker using Helm Source: https://github.com/flanksource/docs/blob/main/canary-checker/docs/getting-started.canary.mdx Install the canary checker using Helm. Ensure you specify the correct chart and namespace. ```yaml ``` -------------------------------- ### Scale Deployment Playbook Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/guide/playbooks/actions/exec.mdx Example of a playbook action to scale a deployment using the Exec action. ```yaml apiVersion: mission-control.flux.com/v1 kind: PlaybookAction metadata: name: scale-deployment spec: action: exec exec: script: | echo "Scaling deployment..." kubectl scale deployment my-deployment --replicas=3 echo "Deployment scaled." artifacts: paths: - "output.log" connections: - name: "kubernetes" type: "kubernetes" ``` -------------------------------- ### Terraform Scraper Configuration Example Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/guide/config-db/scrapers/terraform.mdx Example YAML configuration for the Terraform scraper, specifying schedule, retention, and Terraform configurations to scrape. ```yaml ```yaml title="terraform-scraper.yaml" file=/modules/config-db/fixtures/terraform.yaml ``` ``` -------------------------------- ### Project Structure Example Source: https://github.com/flanksource/docs/blob/main/mission-control/AGENTS.md Illustrates the directory layout for the Mission Control project, including documentation, source code, and configuration files. ```tree mission-control/ ├── docs/ │ ├── integrations/ # Integration pages (flat .mdx or index.mdx + subdirs) │ ├── guide/ # How-to guides (grouped by topic) │ ├── reference/ # API/config reference docs │ ├── installation/ # Deployment guides │ └── style-guide/ # Brand guidelines ├── src/ │ ├── components/ # Symlink → common/src/components │ ├── css/ # Symlink → common/src/css │ └── theme/ # Symlink → common/src/theme ├── docusaurus.config.ts ├── sidebars.js # Autogenerated sidebars for integrations, guide, reference └── package.json ``` -------------------------------- ### Install Mission Control with Helm Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/installation/local-testing.md Installs Mission Control using Helm, specifying the namespace, wait flag, and a custom values file. ```bash helm repo add flanksource https://flanksource.github.io/charts helm repo update helm install mission-control \ flanksource/mission-control \ -n mission-control \ --create-namespace \ --wait \ -f values.yaml ``` -------------------------------- ### Basic Configuration Access Permission Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/reference/permissions/actions.mdx This example demonstrates a basic permission configuration granting access to specific configurations within 'dev' and 'staging' namespaces, along with playbook run and approve actions, and all CRUD operations. ```yaml apiVersion: mission-control.flanksource.com/v1 kind: Permission metadata: name: dev-team-config-access spec: subject: team: developers object: configs: - namespaces: ["dev", "staging"] actions: - "playbook:run" - "playbook:approve" - "create,read,update,delete" ``` -------------------------------- ### Terraform State File Example Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/guide/config-db/scrapers/terraform.mdx An example of a Terraform state file showing sensitive data like 'master_password' stored in plain text. ```json { "mode": "managed", "type": "aws_db_instance", "name": "example", "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]", "instances": [ { "attributes": { "address": "mydb.123456789012.us-east-1.rds.amazonaws.com", "engine": "mysql", "engine_version": "5.7", "master_username": "admin", "master_password": "MyPa$$w0rd123!", // Stored in plain text! "endpoint": "mydb.123456789012.us-east-1.rds.amazonaws.com:3306" } } ] } ``` -------------------------------- ### SQL Server Connection Strings Source: https://github.com/flanksource/docs/blob/main/mission-control/docs/guide/config-db/scrapers/mssql.mdx Examples of different connection string formats for SQL Server, including direct, referenced, and Windows Authentication. ```yaml # Direct connection string connection: sqlserver://user:password@host:1433?database=master ``` ```yaml # Connection reference connection: connection://sqlserver/production ``` ```yaml # With Windows Authentication (when running on Windows) connection: sqlserver://host:1433?database=master&trusted_connection=true ``` ```yaml # With authentication parameters connection: sqlserver://host:1433?database=master auth: username: valueFrom: secretKeyRef: name: mssql-credentials key: username password: valueFrom: secretKeyRef: name: mssql-credentials key: password ``` -------------------------------- ### Build APM Hub CLI Locally Source: https://github.com/flanksource/docs/blob/main/docs/apm-hub/tutorials/install.md Clone the repository, navigate to the directory, and use make commands to build and install the CLI. ```shell git clone https://github.com/flanksource/apm-hub cd apm-hub make build make install ```