- Points to ghcr.io/sirius0xdev/trading-execute-service:7b77854 (includes model_validator for POSTGRES_PASSWORD etc.) - Sets pullPolicy: Always to ensure fresh image on rollout. - This resolves the persistent SQLite OperationalError on startup. See hermes-projects commit 7b77854 for the code change + RUNBOOK.md. After merge, run helm upgrade or kubectl rollout restart.
412 lines
10 KiB
YAML
412 lines
10 KiB
YAML
# Trading Platform Helm Chart - Default Values
|
|
# ============================================================
|
|
|
|
# Global settings
|
|
global:
|
|
namespace: customer1
|
|
replicaCount: 2
|
|
imagePullSecrets: []
|
|
clusterName: customer1-gke
|
|
environment: staging
|
|
registry: us-central1-docker.pkg.dev/customer1-gke/trading
|
|
|
|
# Resource defaults for all microservices
|
|
resources:
|
|
requests:
|
|
cpu: 250m
|
|
memory: 256Mi
|
|
limits:
|
|
cpu: "1"
|
|
memory: 512Mi
|
|
|
|
# Pod security context defaults
|
|
podSecurityContext:
|
|
runAsNonRoot: true
|
|
runAsUser: 1000
|
|
runAsGroup: 1000
|
|
fsGroup: 1000
|
|
seccompProfile:
|
|
type: RuntimeDefault
|
|
|
|
# Container security context defaults
|
|
containerSecurityContext:
|
|
allowPrivilegeEscalation: false
|
|
readOnlyRootFilesystem: true
|
|
capabilities:
|
|
drop:
|
|
- ALL
|
|
|
|
# =================================================================
|
|
# Execute Service (Hyperliquid + Solana trading engine)
|
|
# =================================================================
|
|
executeService:
|
|
enabled: true
|
|
name: execute-service
|
|
image:
|
|
repository: "ghcr.io/sirius0xdev/trading-execute-service"
|
|
tag: "7b77854"
|
|
pullPolicy: Always
|
|
port: 8000
|
|
resources:
|
|
requests:
|
|
cpu: 500m
|
|
memory: 512Mi
|
|
limits:
|
|
cpu: "2"
|
|
memory: 1Gi
|
|
autoscaling:
|
|
enabled: true
|
|
minReplicas: 2
|
|
maxReplicas: 10
|
|
targetCPUUtilizationPercentage: 70
|
|
env:
|
|
LOG_LEVEL: "INFO"
|
|
KAFKA_BOOTSTRAP_SERVERS: "kafka-headless:9092"
|
|
KAFKA_TOPIC_TRADES: "trades.executed"
|
|
KAFKA_TOPIC_ORDERS: "orders.new"
|
|
REDIS_HOST: "redis-master"
|
|
REDIS_PORT: "6379"
|
|
DB_HOST: "postgres-primary"
|
|
DB_PORT: "5432"
|
|
DB_NAME: "trading_db"
|
|
|
|
# =================================================================
|
|
# News Service (CNPG connector + Kafka producer)
|
|
# =================================================================
|
|
newsService:
|
|
enabled: true
|
|
name: news-service
|
|
image:
|
|
repository: ""
|
|
tag: "0.1.0"
|
|
pullPolicy: IfNotPresent
|
|
port: 8000
|
|
resources:
|
|
requests:
|
|
cpu: 300m
|
|
memory: 384Mi
|
|
limits:
|
|
cpu: "1"
|
|
memory: 768Mi
|
|
autoscaling:
|
|
enabled: true
|
|
minReplicas: 2
|
|
maxReplicas: 6
|
|
targetCPUUtilizationPercentage: 75
|
|
env:
|
|
LOG_LEVEL: "INFO"
|
|
DB_POOL_SIZE: "5"
|
|
DB_MAX_OVERFLOW: "10"
|
|
KAFKA_BOOTSTRAP_SERVERS: "kafka-headless:9092"
|
|
KAFKA_GROUP_ID: "news-analyzer"
|
|
KAFKA_TOPIC_ARTICLES: "news.articles"
|
|
KAFKA_TOPIC_ANALYSIS: "news.analysis"
|
|
API_PREFIX: "/api/v1"
|
|
CORS_ORIGINS: '["https://app.customer1.trading.com"]'
|
|
DB_HOST: "customer1-cnpg-r"
|
|
DB_PORT: "5432"
|
|
DB_NAME: "news"
|
|
|
|
# =================================================================
|
|
# Data Service (Postgres + Redis + Kafka consumers)
|
|
# =================================================================
|
|
dataService:
|
|
enabled: true
|
|
name: data-service
|
|
image:
|
|
repository: ""
|
|
tag: "0.1.0"
|
|
pullPolicy: IfNotPresent
|
|
port: 8000
|
|
resources:
|
|
requests:
|
|
cpu: 300m
|
|
memory: 384Mi
|
|
limits:
|
|
cpu: "1"
|
|
memory: 768Mi
|
|
autoscaling:
|
|
enabled: true
|
|
minReplicas: 2
|
|
maxReplicas: 6
|
|
targetCPUUtilizationPercentage: 70
|
|
env:
|
|
LOG_LEVEL: "INFO"
|
|
DB_HOST: "postgres-primary"
|
|
DB_PORT: "5432"
|
|
DB_NAME: "trading_db"
|
|
REDIS_HOST: "redis-master"
|
|
REDIS_PORT: "6379"
|
|
KAFKA_BOOTSTRAP_SERVERS: "kafka-headless:9092"
|
|
KAFKA_CONSUMER_GROUP: "data-service"
|
|
|
|
# =================================================================
|
|
# Dashboard (Next.js frontend)
|
|
# =================================================================
|
|
dashboard:
|
|
enabled: true
|
|
name: dashboard
|
|
image:
|
|
repository: ""
|
|
tag: "0.2.0-autonomous-bot"
|
|
pullPolicy: IfNotPresent
|
|
port: 3000
|
|
resources:
|
|
requests:
|
|
cpu: 200m
|
|
memory: 256Mi
|
|
limits:
|
|
cpu: "500m"
|
|
memory: 512Mi
|
|
autoscaling:
|
|
enabled: true
|
|
minReplicas: 2
|
|
maxReplicas: 8
|
|
targetCPUUtilizationPercentage: 60
|
|
env:
|
|
NODE_ENV: "production"
|
|
NEXT_PUBLIC_API_BASE_URL: "/api"
|
|
NEXT_PUBLIC_EXEC_SERVICE_URL: "http://execute-service:8000"
|
|
NEXT_PUBLIC_NEWS_SERVICE_URL: "http://news-service:8001"
|
|
|
|
# =================================================================
|
|
# Ingress
|
|
# =================================================================
|
|
ingress:
|
|
enabled: true
|
|
className: "gce"
|
|
annotations:
|
|
kubernetes.io/ingress.class: gce
|
|
kubernetes.io/ingress.allow-http: "true"
|
|
nginx.ingress.kubernetes.io/ssl-redirect: "true"
|
|
hosts:
|
|
- host: app.customer1.trading.com
|
|
paths:
|
|
- path: /
|
|
pathType: Prefix
|
|
service: dashboard
|
|
- path: /api/trades
|
|
pathType: Prefix
|
|
service: execute-service
|
|
- path: /api/auth
|
|
pathType: Prefix
|
|
service: execute-service
|
|
- path: /api/news
|
|
pathType: Prefix
|
|
service: news-service
|
|
- path: /api/data
|
|
pathType: Prefix
|
|
service: data-service
|
|
tls:
|
|
- secretName: trading-tls
|
|
hosts:
|
|
- app.customer1.trading.com
|
|
|
|
# =================================================================
|
|
# Cert-Manager / mTLS
|
|
# =================================================================
|
|
certManager:
|
|
enabled: true
|
|
externalIssuer:
|
|
name: letsencrypt-prod
|
|
server: https://acme-v02.api.letsencrypt.org/directory
|
|
email: ops@customer1.trading.com
|
|
internalIssuer:
|
|
name: trading-ca
|
|
|
|
# =================================================================
|
|
# PostgreSQL
|
|
# =================================================================
|
|
postgres:
|
|
enabled: true
|
|
image:
|
|
repository: postgres
|
|
tag: "17-alpine"
|
|
primary:
|
|
replicaCount: 1
|
|
resources:
|
|
requests:
|
|
cpu: "1"
|
|
memory: 2Gi
|
|
limits:
|
|
cpu: "2"
|
|
memory: 4Gi
|
|
storage:
|
|
size: 50Gi
|
|
storageClass: "standard-rwo"
|
|
postgresqlDatabase: trading_db
|
|
|
|
# =================================================================
|
|
# Redis
|
|
# =================================================================
|
|
redis:
|
|
enabled: true
|
|
image:
|
|
repository: redis
|
|
tag: "7-alpine"
|
|
replicaCount: 3
|
|
master:
|
|
resources:
|
|
requests:
|
|
cpu: 250m
|
|
memory: 256Mi
|
|
limits:
|
|
cpu: "500m"
|
|
memory: 512Mi
|
|
storage:
|
|
size: 10Gi
|
|
storageClass: "standard-rwo"
|
|
|
|
# =================================================================
|
|
# Kafka (KRaft mode)
|
|
# =================================================================
|
|
kafka:
|
|
enabled: true
|
|
image:
|
|
repository: apache/kafka
|
|
tag: "3.9.0"
|
|
replicaCount: 3
|
|
resources:
|
|
requests:
|
|
cpu: 500m
|
|
memory: 1Gi
|
|
limits:
|
|
cpu: "1"
|
|
memory: 2Gi
|
|
storage:
|
|
size: 20Gi
|
|
storageClass: "standard-rwo"
|
|
topics:
|
|
- name: trades.executed
|
|
partitions: 6
|
|
replicationFactor: 3
|
|
- name: orders.new
|
|
partitions: 6
|
|
replicationFactor: 3
|
|
- name: news.articles
|
|
partitions: 6
|
|
replicationFactor: 3
|
|
- name: news.analysis
|
|
partitions: 6
|
|
replicationFactor: 3
|
|
# Solana quant bot topics
|
|
- name: solana.bot.signals
|
|
partitions: 6
|
|
replicationFactor: 3
|
|
- name: solana.bot.trades
|
|
partitions: 6
|
|
replicationFactor: 3
|
|
- name: solana.bot.alerts
|
|
partitions: 3
|
|
replicationFactor: 3
|
|
- name: solana.token.data
|
|
partitions: 6
|
|
replicationFactor: 3
|
|
- name: solana.pool.data
|
|
partitions: 6
|
|
replicationFactor: 3
|
|
|
|
# =================================================================
|
|
# Solana RPC (ExternalName service for external RPC providers)
|
|
# =================================================================
|
|
solanaRpc:
|
|
enabled: true
|
|
name: solana-rpc
|
|
# ExternalName points to external RPC provider (Helius, QuickNode, etc.)
|
|
externalName: "mainnet.helius-rpc.com"
|
|
port: 443
|
|
# env var for internal DNS: http://solana-rpc.<namespace>.svc.cluster.local:443
|
|
|
|
# =================================================================
|
|
# Solana Quant Bot (autonomous trading agent)
|
|
# =================================================================
|
|
solanaQuantBot:
|
|
enabled: true
|
|
name: solana-quant-bot
|
|
replicaCount: 2
|
|
image:
|
|
repository: ""
|
|
tag: "0.1.0"
|
|
pullPolicy: IfNotPresent
|
|
port: 8000
|
|
metricsPort: 9090
|
|
resources:
|
|
requests:
|
|
cpu: 1
|
|
memory: 1Gi
|
|
limits:
|
|
cpu: "2"
|
|
memory: 2Gi
|
|
migrationResources:
|
|
requests:
|
|
cpu: 250m
|
|
memory: 256Mi
|
|
limits:
|
|
cpu: "500m"
|
|
memory: 512Mi
|
|
autoscaling:
|
|
enabled: true
|
|
minReplicas: 2
|
|
maxReplicas: 5
|
|
targetCPUUtilizationPercentage: 70
|
|
env:
|
|
LOG_LEVEL: "INFO"
|
|
DB_NAME: "solana_quant_db"
|
|
KAFKA_GROUP_ID: "solana-quant-bot"
|
|
KAFKA_TOPIC_SIGNALS: "solana.bot.signals"
|
|
KAFKA_TOPIC_TRADES: "solana.bot.trades"
|
|
KAFKA_TOPIC_ALERTS: "solana.bot.alerts"
|
|
KAFKA_TOPIC_TOKEN_DATA: "solana.token.data"
|
|
KAFKA_TOPIC_POOL_DATA: "solana.pool.data"
|
|
# Solana RPC via internal DNS (ExternalName service)
|
|
SOLANA_RPC_ENDPOINT: "http://solana-rpc:443"
|
|
# Trading config
|
|
MIN_LIQUIDITY_USD: "50000"
|
|
MAX_POSITION_SIZE_USD: "10000"
|
|
SLIPPAGE_BPS: "100"
|
|
SCORING_THRESHOLD: "60"
|
|
HEALTHCHECK_INTERVAL: "300"
|
|
# Secrets (override via secret, not here)
|
|
SOLANA_BOT_PRIVATE_KEY_BASE58: "<CHANGE_ME>"
|
|
SOLANA_RPC_API_KEY: "<CHANGE_ME>"
|
|
BIRDEYE_API_KEY: "<CHANGE_ME>"
|
|
JUPITER_API_KEY: ""
|
|
DEXSCREENER_API_KEY: ""
|
|
|
|
# =================================================================
|
|
# Network Policies (from security audit)
|
|
# =================================================================
|
|
networkPolicies:
|
|
enabled: true
|
|
defaultDenyIngress: true
|
|
defaultDenyEgress: true
|
|
allowDNS: true
|
|
|
|
# =================================================================
|
|
# Observability (Prometheus + Grafana + Alertmanager)
|
|
# =================================================================
|
|
prometheus:
|
|
enabled: true
|
|
scrapeInterval: "15s"
|
|
retention: "15d"
|
|
retentionSize: "10GB"
|
|
|
|
alertmanager:
|
|
enabled: true
|
|
# Alert routes configured separately
|
|
|
|
grafana:
|
|
enabled: true
|
|
namespace: "" # defaults to global.namespace
|
|
adminUser: admin
|
|
# adminPassword comes from secret
|
|
dashboards:
|
|
- solana-quant-bot-dashboard
|
|
|
|
# =================================================================
|
|
# SOPS Encryption
|
|
# =================================================================
|
|
sops:
|
|
enabled: true
|
|
ageKeyFile: /etc/sops/age.key
|
|
secretsPath: trading-secrets.yaml
|