2026-06-16 00:23:18 +07:00
|
|
|
# Infrastruktur — ZeaVis Edu
|
2026-06-07 23:02:35 +07:00
|
|
|
|
2026-06-16 00:23:18 +07:00
|
|
|
> Arsitektur multi-VPS untuk deployment produksi ZeaVis Edu dengan Tailscale mesh VPN dan observabilitas penuh.
|
|
|
|
|
|
|
|
|
|
← [Kembali ke README utama](../README.md)
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Daftar Isi
|
|
|
|
|
|
|
|
|
|
1. [Arsitektur](#1-arsitektur)
|
|
|
|
|
2. [Prasyarat GitHub Secrets](#2-prasyarat-github-secrets)
|
|
|
|
|
3. [Setup VPS](#3-setup-vps)
|
|
|
|
|
4. [Port yang Dibuka](#4-port-yang-dibuka)
|
|
|
|
|
5. [Metrics Flow](#5-metrics-flow)
|
|
|
|
|
6. [Perintah Penting](#6-perintah-penting)
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## 1. Arsitektur
|
|
|
|
|
|
|
|
|
|
ZeaVis Edu berjalan di **dua VPS terpisah** yang terhubung melalui **Tailscale** mesh VPN:
|
2026-06-07 23:02:35 +07:00
|
|
|
|
|
|
|
|
```
|
|
|
|
|
┌─────────────────────────────────────────────┐ ┌──────────────────────────────────────────────┐
|
|
|
|
|
│ App VPS (imrnes) │ │ Telemetry VPS (orange) │
|
|
|
|
|
│ 100.108.1.124 │ │ 100.96.248.86 │
|
|
|
|
|
│ Arch Linux │ │ Ubuntu │
|
|
|
|
|
│ │ │ │
|
|
|
|
|
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │ ┌──────────┐ ┌──────────────┐ │
|
|
|
|
|
│ │ Web │ │ API │ │ ML │ │ │ │Prometheus│ │Metric │ │
|
|
|
|
|
│ │:80 │ │:3000 │ │:8000 │ │ │ │:9090 │ │Ingester │ │
|
|
|
|
|
│ │/metrics │ │/metrics │ │/metrics │ │ │ │ │ │:9091 │ │
|
|
|
|
|
│ └──────────┘ └──────────┘ └──────────┘ │ │ └────┬─────┘ └──────┬───────┘ │
|
|
|
|
|
│ ┌──────────────────────────────────────┐ │ │ │ │ │
|
|
|
|
|
│ │ Node Exporter │ │ │ │ remote_write │ │
|
|
|
|
|
│ │ :9100 │ │ │ ▼ ▼ │
|
|
|
|
|
│ └──────────────────────────────────────┘ │ │ ┌──────────────────────────────────────┐ │
|
|
|
|
|
│ │ │ │ Vector │ │
|
|
|
|
|
│ ┌──────────────┐ │ │ │ :9001 │ │
|
|
|
|
|
│ │ Traefik │ │ │ └────────────────┬─────────────────────┘ │
|
|
|
|
|
│ │ (Coolify) │ │ │ │ │
|
|
|
|
|
│ └──────────────┘ │ │ ▼ │
|
|
|
|
|
│ │ │ ┌──────────────────────────────────────┐ │
|
|
|
|
|
│ ZeaVis Edu Apps via │ │ │ ClickHouse │ │
|
|
|
|
|
│ zeavisedu.asepharyana.my.id │ │ │ :8123 │ │
|
|
|
|
|
│ │ │ └───────────────┬──────────────────────┘ │
|
|
|
|
|
│ │ │ │ │
|
|
|
|
|
│ │ │ ▼ │
|
|
|
|
|
│ ==== Tailscale (WireGuard) ==== │ │ ┌──────────────────────────────────────┐ │
|
|
|
|
|
│ │ │ │ Query Proxy │ │
|
|
|
|
|
│ │ │ │ :9092 │ │
|
|
|
|
|
│ │ │ └───────────────┬──────────────────────┘ │
|
|
|
|
|
│ │ │ │ │
|
|
|
|
|
│ │ │ ▼ │
|
|
|
|
|
│ │ │ ┌──────────────────────────────────────┐ │
|
|
|
|
|
│ │ │ │ Telemetry UI (nginx) │ │
|
|
|
|
|
│ │ │ │ :8181 │ │
|
|
|
|
|
│ │ │ └──────────────────────────────────────┘ │
|
|
|
|
|
│ │ │ │
|
|
|
|
|
│ │ │ Coolify + Traefik handles: │
|
|
|
|
|
│ │ │ telemetry.zeavisedu.asepharyana.my.id │
|
|
|
|
|
└─────────────────────────────────────────────┘ └──────────────────────────────────────────────┘
|
|
|
|
|
```
|
|
|
|
|
|
2026-06-16 00:23:18 +07:00
|
|
|
| VPS | Hostname | OS | Peran |
|
|
|
|
|
|---|---|---|---|
|
|
|
|
|
| **App VPS** | `imrnes` | Arch Linux | Web (:80), API (:3000), ML Service (:8000) |
|
|
|
|
|
| **Telemetry VPS** | `orange` | Ubuntu | Prometheus, ClickHouse, Telemetry UI |
|
2026-06-07 23:02:35 +07:00
|
|
|
|
2026-06-16 00:23:18 +07:00
|
|
|
---
|
2026-06-07 23:02:35 +07:00
|
|
|
|
2026-06-16 00:23:18 +07:00
|
|
|
## 2. Prasyarat GitHub Secrets
|
|
|
|
|
|
|
|
|
|
### App VPS — `.github/workflows/deploy.yml`
|
|
|
|
|
|
|
|
|
|
| Secret | Keterangan |
|
|
|
|
|
|---|---|
|
2026-06-07 23:02:35 +07:00
|
|
|
| `VPS_HOST` | `100.108.1.124` (imrnes) |
|
|
|
|
|
| `VPS_USER` | `mytheclipse` |
|
2026-06-16 00:23:18 +07:00
|
|
|
| `VPS_SSH_KEY` | Private SSH key untuk imrnes |
|
2026-06-07 23:02:35 +07:00
|
|
|
| `VPS_PORT` | `22` |
|
|
|
|
|
| `DATABASE_URL` | PostgreSQL connection string |
|
|
|
|
|
| `SESSION_SECRET` | Random session secret |
|
|
|
|
|
|
2026-06-16 00:23:18 +07:00
|
|
|
### Telemetry VPS — `.github/workflows/telemetry-ci-cd.yml`
|
|
|
|
|
|
|
|
|
|
| Secret | Keterangan |
|
|
|
|
|
|---|---|
|
2026-06-07 23:02:35 +07:00
|
|
|
| `TELEMETRY_VPS_HOST` | `100.96.248.86` (orange) |
|
2026-06-16 00:23:18 +07:00
|
|
|
| `TELEMETRY_VPS_USER` | SSH username |
|
|
|
|
|
| `TELEMETRY_VPS_SSH_KEY` | Private SSH key |
|
2026-06-07 23:02:35 +07:00
|
|
|
| `TELEMETRY_VPS_PORT` | `22` |
|
2026-06-16 00:23:18 +07:00
|
|
|
| `GHCR_PAT` | GitHub PAT dengan `write:packages` + `read:packages` |
|
2026-06-07 23:02:35 +07:00
|
|
|
|
2026-06-16 00:23:18 +07:00
|
|
|
---
|
2026-06-07 23:02:35 +07:00
|
|
|
|
2026-06-16 00:23:18 +07:00
|
|
|
## 3. Setup VPS
|
|
|
|
|
|
|
|
|
|
### App VPS (imrnes — 100.108.1.124)
|
2026-06-07 23:02:35 +07:00
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
# Create Docker network
|
|
|
|
|
docker network create app-shared-net
|
|
|
|
|
docker network create telemetry-net
|
|
|
|
|
|
|
|
|
|
# ZeaVis Edu apps deploy automatically via GitHub Actions
|
|
|
|
|
```
|
|
|
|
|
|
2026-06-16 00:23:18 +07:00
|
|
|
### Telemetry VPS (orange — 100.96.248.86)
|
2026-06-07 23:02:35 +07:00
|
|
|
|
2026-06-16 00:23:18 +07:00
|
|
|
Deploy via GitHub Actions atau manual:
|
2026-06-07 23:02:35 +07:00
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
ssh mytheclipse@100.96.248.86
|
|
|
|
|
mkdir -p /opt/telemetry
|
|
|
|
|
cd /opt/telemetry
|
|
|
|
|
docker compose up -d
|
|
|
|
|
bash clickhouse/init.sh
|
|
|
|
|
```
|
|
|
|
|
|
2026-06-16 00:23:18 +07:00
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## 4. Port yang Dibuka
|
2026-06-07 23:02:35 +07:00
|
|
|
|
|
|
|
|
### App VPS (imrnes)
|
2026-06-16 00:23:18 +07:00
|
|
|
|
2026-06-07 23:02:35 +07:00
|
|
|
| Port | Service | Akses |
|
2026-06-16 00:23:18 +07:00
|
|
|
|---|---|---|
|
2026-06-07 23:02:35 +07:00
|
|
|
| 80/443 | Web (via Traefik/Coolify) | Public |
|
|
|
|
|
| 3000 | API metrics | Tailscale-only |
|
|
|
|
|
| 8000 | ML service metrics | Tailscale-only |
|
|
|
|
|
| 9100 | Node Exporter | Tailscale-only |
|
|
|
|
|
|
|
|
|
|
### Telemetry VPS (orange)
|
2026-06-16 00:23:18 +07:00
|
|
|
|
2026-06-07 23:02:35 +07:00
|
|
|
| Port | Service | Akses |
|
2026-06-16 00:23:18 +07:00
|
|
|
|---|---|---|
|
2026-06-07 23:02:35 +07:00
|
|
|
| 80/443 | Telemetry UI (via Coolify Traefik) | Public |
|
|
|
|
|
| 8181 | Telemetry UI (direct) | Tailscale-only |
|
|
|
|
|
| 9090 | Prometheus | Tailscale-only |
|
|
|
|
|
| 9091 | Metric Ingester | Tailscale-only |
|
|
|
|
|
| 9001 | Vector HTTP source | Tailscale-only |
|
|
|
|
|
| 8123 | ClickHouse HTTP | Tailscale-only |
|
|
|
|
|
| 9000 | ClickHouse Native | Tailscale-only |
|
|
|
|
|
|
2026-06-16 00:23:18 +07:00
|
|
|
---
|
2026-06-07 23:02:35 +07:00
|
|
|
|
2026-06-16 00:23:18 +07:00
|
|
|
## 5. Metrics Flow
|
|
|
|
|
|
|
|
|
|
1. **App services** mengekspos `GET /metrics` di port masing-masing
|
2026-06-07 23:02:35 +07:00
|
|
|
2. **Prometheus** di orange VPS scrape via Tailscale IP (`100.108.1.124:PORT`)
|
2026-06-16 00:23:18 +07:00
|
|
|
3. Prometheus forward ke **Metric Ingester** via `remote_write`
|
|
|
|
|
4. Metric Ingester enrich → filter → forward ke **Vector**
|
|
|
|
|
5. Vector buffer → write ke **ClickHouse**
|
2026-06-07 23:02:35 +07:00
|
|
|
6. **Telemetry UI** query via **Query Proxy** → **ClickHouse**
|
|
|
|
|
|
2026-06-16 00:23:18 +07:00
|
|
|
```
|
|
|
|
|
App Services (/metrics)
|
|
|
|
|
│
|
|
|
|
|
▼ (scrape via Tailscale)
|
|
|
|
|
Prometheus ──(remote_write)──► Metric Ingester ──► Vector ──► ClickHouse
|
|
|
|
|
│
|
|
|
|
|
Query Proxy ◄── Telemetry UI
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## 6. Perintah Penting
|
2026-06-07 23:02:35 +07:00
|
|
|
|
|
|
|
|
```bash
|
2026-06-16 00:23:18 +07:00
|
|
|
# Status telemetry stack
|
2026-06-07 23:02:35 +07:00
|
|
|
make telemetry-status
|
|
|
|
|
|
2026-06-16 00:23:18 +07:00
|
|
|
# Lihat log service tertentu
|
2026-06-07 23:02:35 +07:00
|
|
|
make telemetry-logs s=prometheus
|
|
|
|
|
|
2026-06-16 00:23:18 +07:00
|
|
|
# Kirim test metric
|
2026-06-07 23:02:35 +07:00
|
|
|
make telemetry-test-metric
|
|
|
|
|
|
2026-06-16 00:23:18 +07:00
|
|
|
# Restart service
|
2026-06-07 23:02:35 +07:00
|
|
|
make telemetry-restart s=vector
|
|
|
|
|
```
|
2026-06-16 00:23:18 +07:00
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
← [Kembali ke README utama](../README.md) • [ML Service →](../apps/ml-service/README.md) • [Pipeline ML →](../Machine_Learning/README.md)
|