Skip to content

Implement 'dev' mode with Docker Compose #18

@y0s3ph

Description

@y0s3ph

Context

The dev mode provides a local Docker Compose stack for testing and learning k8scope without a Kubernetes cluster. This lowers the barrier of entry dramatically.

Requirements

Docker Compose stack

Embed a `docker-compose.yaml` in `embed/compose/`:

  • Prometheus — Single instance, scraping itself and the other containers
  • Grafana — Pre-configured with datasources and dashboards
  • Loki — Single instance for log aggregation
  • No Alertmanager, no OTel Collector (keep it minimal)
  • Ephemeral storage (no volumes)

CLI integration

```bash

Start the local stack

k8scope install --mode dev

Behind the scenes:

1. Extract docker-compose.yaml to a temp directory

2. Run docker compose up -d

3. Print access URLs

Stop and remove

k8scope uninstall --mode dev
```

Detection

  • `k8scope install --mode dev` should detect if Docker is available
  • If no Docker, print error with installation instructions
  • If no Kubernetes and no `--mode dev`, suggest dev mode

Output

```
Starting k8scope dev stack with Docker Compose...

Grafana: http://localhost:3000 (admin/admin)
Prometheus: http://localhost:9090
Loki: http://localhost:3100

Stack is ready. Use 'k8scope uninstall --mode dev' to stop.
```

Acceptance criteria

  • `k8scope install --mode dev` starts the stack with Docker Compose
  • Grafana is accessible with dashboards and datasources pre-loaded
  • `k8scope uninstall --mode dev` stops and removes containers
  • Works on Linux, macOS, and Windows (Docker Desktop)

Metadata

Metadata

Assignees

Labels

Projects

Status

Todo

Relationships

None yet

Development

No branches or pull requests

Issue actions