version: 1
kind: platform-infra-n8n

metadata:
  id: n8n-public
  owner: unidesk
  relatedIssues:
    - 300

defaults:
  targetId: G14

image:
  repository: n8nio/n8n
  tag: "1.123.55"
  pullPolicy: IfNotPresent

dependencyImages:
  postgresClient: docker.io/library/postgres:16-alpine

targets:
  - id: G14
    route: G14:k3s
    namespace: platform-infra
    enabled: true
    replicas: 1
    publicExposure:
      enabled: true
      publicBaseUrl: https://n8n.pikapython.com
      dns:
        hostname: n8n.pikapython.com
        expectedA: 82.156.23.220
        resolvers: [1.1.1.1, 8.8.8.8, 223.5.5.5, 114.114.114.114]
      frpc:
        deploymentName: n8n-frpc
        secretName: n8n-frpc-secrets
        secretKey: frpc.toml
        image: fatedier/frpc:v0.68.1
        serverAddr: 82.156.23.220
        serverPort: 22000
        proxyName: platform-infra-n8n-g14-web
        remotePort: 22099
        localIP: n8n.platform-infra.svc.cluster.local
        localPort: 5678
        tokenSourceRef: platform-infra/pk01-frp.env
        tokenSourceKey: FRP_TOKEN
      pk01:
        route: PK01
        caddyConfigPath: /etc/caddy/Caddyfile
        caddyServiceName: caddy
        responseHeaderTimeoutSeconds: 600

runtime:
  timezone: Asia/Shanghai
  database:
    mode: external
    sourceRef: platform-db/n8n-db.env
    sourceKeys:
      user: N8N_DB_USER
      password: N8N_DB_PASSWORD
      dbName: N8N_DB_NAME
    secretName: n8n-secrets
    host: 82.156.23.220
    port: 5432
    user: n8n
    dbName: n8n
    sslMode: require
    sslRejectUnauthorized: false
  secrets:
    root: /root/.unidesk/.state/secrets
    appSourceRef: platform-infra/n8n.env
    encryptionKey: N8N_ENCRYPTION_KEY
  storage:
    data:
      name: n8n-data
      size: 10Gi
  public:
    host: n8n.pikapython.com
    protocol: https
    editorBaseUrl: https://n8n.pikapython.com
    webhookUrl: https://n8n.pikapython.com
    proxyHops: 1
  security:
    diagnosticsEnabled: false
    personalisationEnabled: false
    secureCookie: true
