docs: update README for Komodo deployment
This commit is contained in:
101
README.md
101
README.md
@@ -1,6 +1,6 @@
|
|||||||
# Prefect Deployment
|
# Prefect Deployment
|
||||||
|
|
||||||
GitOps deployment for Prefect workflow orchestration with Tailscale HTTPS access.
|
GitOps deployment for Prefect workflow orchestration with Tailscale HTTPS access via Komodo.
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
@@ -18,30 +18,56 @@ GRANT ALL PRIVILEGES ON DATABASE prefect TO prefect;
|
|||||||
GRANT ALL ON SCHEMA public TO prefect;
|
GRANT ALL ON SCHEMA public TO prefect;
|
||||||
```
|
```
|
||||||
|
|
||||||
### Host Configuration
|
|
||||||
|
|
||||||
Download configuration files to `/opt/prefect` (first time only):
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo mkdir -p /opt/prefect/tailscale
|
|
||||||
sudo curl -o /opt/prefect/tailscale/serve-config.json https://gitea.arnodo.fr/Damien/prefect-deployment/raw/branch/main/serve-config.json
|
|
||||||
```
|
|
||||||
|
|
||||||
### Tailscale Auth Key
|
### Tailscale Auth Key
|
||||||
|
|
||||||
Generate a reusable auth key from https://login.tailscale.com/admin/settings/keys
|
Generate a reusable auth key from https://login.tailscale.com/admin/settings/keys
|
||||||
|
|
||||||
## Deployment
|
## Deployment with Komodo
|
||||||
|
|
||||||
1. Create a new stack in Portainer
|
### 1. Add Git Provider (if using private repo)
|
||||||
2. Select "Repository" and point to this repository
|
|
||||||
3. Portainer will load `stack.env` automatically
|
In Komodo UI: Settings → Git Providers → Add your Gitea instance credentials.
|
||||||
4. Override sensitive values (`CHANGE_ME`) in the environment variables section:
|
|
||||||
- `TS_AUTHKEY` - Tailscale auth key (reusable recommended)
|
### 2. Create Stack
|
||||||
- `DB_PASSWORD` - PostgreSQL password
|
|
||||||
- `S3_ACCESS_KEY` - Garage S3 access key
|
1. Navigate to **Stacks** → **New Stack**
|
||||||
- `S3_SECRET_KEY` - Garage S3 secret key
|
2. Configure:
|
||||||
5. Deploy
|
- **Name**: `prefect`
|
||||||
|
- **Server**: Select your target server
|
||||||
|
- **Source**: Git Repo
|
||||||
|
- **Git Provider**: `gitea.arnodo.fr` (or your provider)
|
||||||
|
- **Repo**: `Damien/prefect-deployment`
|
||||||
|
- **Branch**: `main`
|
||||||
|
|
||||||
|
### 3. Configure Environment Variables
|
||||||
|
|
||||||
|
In the stack configuration, add the following environment variables:
|
||||||
|
|
||||||
|
| Variable | Description | Example |
|
||||||
|
|----------|-------------|---------|
|
||||||
|
| `TS_AUTHKEY` | Tailscale auth key (reusable) | `tskey-auth-xxx` |
|
||||||
|
| `DB_HOST` | PostgreSQL host | `postgresql.taila5ad8.ts.net` |
|
||||||
|
| `DB_PORT` | PostgreSQL port | `5432` |
|
||||||
|
| `DB_USER` | Database user | `prefect` |
|
||||||
|
| `DB_PASSWORD` | Database password | *secret* |
|
||||||
|
| `S3_ACCESS_KEY` | Garage S3 access key | *secret* |
|
||||||
|
| `S3_SECRET_KEY` | Garage S3 secret key | *secret* |
|
||||||
|
| `S3_ENDPOINT_URL` | Garage S3 endpoint | `https://s3.taila5ad8.ts.net` |
|
||||||
|
|
||||||
|
> **Tip**: Use Komodo's secret variables (marked with 🔒) for sensitive values.
|
||||||
|
|
||||||
|
### 4. Deploy
|
||||||
|
|
||||||
|
Click **Deploy** in Komodo. The stack will clone the repository and start all services.
|
||||||
|
|
||||||
|
## GitOps Workflow
|
||||||
|
|
||||||
|
### Auto-deploy on Git Push
|
||||||
|
|
||||||
|
1. In Komodo, go to your stack settings
|
||||||
|
2. Enable **Auto Deploy** on push
|
||||||
|
3. Copy the webhook URL
|
||||||
|
4. Add it to your Gitea repository: Settings → Webhooks
|
||||||
|
|
||||||
## Access
|
## Access
|
||||||
|
|
||||||
@@ -76,10 +102,37 @@ my_backup_flow.deploy(
|
|||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
## Directory Structure
|
## Architecture
|
||||||
|
|
||||||
```
|
```
|
||||||
/opt/prefect/
|
┌─────────────────────────────────────────────────────────────┐
|
||||||
└── tailscale/
|
│ Tailscale Network │
|
||||||
└── serve-config.json # Tailscale HTTPS configuration
|
├─────────────────────────────────────────────────────────────┤
|
||||||
|
│ │
|
||||||
|
│ ┌─────────────┐ ┌─────────────┐ ┌──────────────┐ │
|
||||||
|
│ │ Tailscale │────▶│ Prefect │────▶│ PostgreSQL │ │
|
||||||
|
│ │ Sidecar │ │ Server │ │ (external) │ │
|
||||||
|
│ │ :443 │ │ :4200 │ │ │ │
|
||||||
|
│ └─────────────┘ └──────┬──────┘ └──────────────┘ │
|
||||||
|
│ │ │
|
||||||
|
│ ┌──────▼──────┐ │
|
||||||
|
│ │ Redis │ │
|
||||||
|
│ │ (messaging) │ │
|
||||||
|
│ └─────────────┘ │
|
||||||
|
│ │
|
||||||
|
│ ┌─────────────────┐ ┌─────────────────┐ │
|
||||||
|
│ │ Prefect Services│ │ Backup Worker │──▶ Garage S3 │
|
||||||
|
│ │ (background) │ │ (pg-backup-pool)│ │
|
||||||
|
│ └─────────────────┘ └─────────────────┘ │
|
||||||
|
│ │
|
||||||
|
└─────────────────────────────────────────────────────────────┘
|
||||||
|
```
|
||||||
|
|
||||||
|
## Repository Structure
|
||||||
|
|
||||||
|
```
|
||||||
|
prefect-deployment/
|
||||||
|
├── docker-compose.yml # Stack definition (relative paths)
|
||||||
|
├── serve-config.json # Tailscale HTTPS serve config
|
||||||
|
└── README.md
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user