From 6cfb3e17abc4c0a5c7873fea25cf67073f48185d Mon Sep 17 00:00:00 2001 From: Adam Kamali Date: Tue, 20 Oct 2026 04:56:43 +0000 Subject: [PATCH] Move side services out of add-on resourceDefinitions (#136) kubero-server only accepts add-on catalog kinds (plus Secret/ConfigMap) in addons[].resourceDefinitions and refuses host-access fields, so these templates failed validation on dedicated clusters and their side services never ran on the shared tier. Each side service is now its own templateServices companion app, reached as -{{KUBERO_NAME_SUFFIX}}-kuberoapp on port 80 and, where it needs the database, bound to the primary's add-ons with usePrimaryAddons. - n8n: SearXNG becomes the n8n-searxng companion (writes a settings.yml that enables the JSON API). The code sandbox (privileged Docker-in-Docker runner) is dropped and N8N_INSTANCE_AI_SANDBOX_ENABLED is false. - cryptomator: Keycloak becomes the cryptomator-keycloak companion (seed realm passed as an env var, PG contract env, generated admin password); Hub datasource credentials use $(PGUSER)/$(PGPASSWORD). - dittofeed: Temporal becomes the dittofeed-temporal companion on the PG contract (no superuser literal); the CNPG role gets CREATEDB. - langfuse: MinIO becomes the langfuse-minio companion on a volume, with a generated root password shared with Langfuse. - posthog: Redpanda becomes the posthog-kafka companion. - unomi: Elasticsearch becomes the unomi-elasticsearch companion without the privileged sysctl / chown init containers (single-node, mmap off); the placeholder Valkey add-on that carried it is removed. --- index.json | 6 +- services/cryptomator/app.yaml | 340 ++++++++++++++++------------------ services/dittofeed/app.yaml | 121 ++++++------ services/langfuse/app.yaml | 124 ++++++------- services/n8n/app.yaml | 314 +++++-------------------------- services/posthog/app.yaml | 187 ++++++++----------- services/unomi/app.yaml | 190 ++++++------------- 7 files changed, 441 insertions(+), 841 deletions(-) diff --git a/index.json b/index.json index 67f98e84..f93fca33 100644 --- a/index.json +++ b/index.json @@ -156,7 +156,7 @@ "source": "https://github.com/n8n-io/n8n", "icon": "https://avatars.githubusercontent.com/u/45487711?s=200&v=4", "website": "https://n8n.io", - "installation": "Queue mode with Postgres, Valkey, and a worker. With Load demo data enabled, first boot creates owner demo@stackblaze.local / changeme and three sample workflows. Without it, complete the one-time owner setup at your app URL, then sign in. AI Assistant uses a bundled n8n sandbox and SearXNG for web search; add an Anthropic, OpenAI, or OpenRouter key in n8n AI settings or set N8N_INSTANCE_AI_MODEL_API_KEY. Optional: set INSTANCE_AI_BRAVE_SEARCH_API_KEY to prefer Brave over SearXNG.", + "installation": "Queue mode with Postgres, Valkey, and a worker. With Load demo data enabled, first boot creates owner demo@stackblaze.local / changeme and three sample workflows. Without it, complete the one-time owner setup at your app URL, then sign in. AI Assistant searches the web through a bundled SearXNG companion app (the n8n code sandbox is not included: it needs privileged containers); add an Anthropic, OpenAI, or OpenRouter key in n8n AI settings or set N8N_INSTANCE_AI_MODEL_API_KEY. Optional: set INSTANCE_AI_BRAVE_SEARCH_API_KEY to prefer Brave over SearXNG.", "architecture": [], "categories": [ "work", @@ -11952,9 +11952,7 @@ "https://unomi.apache.org/manual/latest/index.html", "https://github.com/apache/unomi/tree/master/docker" ], - "addons": [ - "Valkey" - ], + "addons": [], "stars": 600, "forks": 60, "watchers": 600, diff --git a/services/cryptomator/app.yaml b/services/cryptomator/app.yaml index 2cd83fe5..d4be8167 100644 --- a/services/cryptomator/app.yaml +++ b/services/cryptomator/app.yaml @@ -7,12 +7,16 @@ metadata: kubero.dev/template.description: Self-hosted key management and access control server for sharing Cryptomator-encrypted vaults across teams. kubero.dev/template.icon: https://raw.githubusercontent.com/stackblaze/stack-templates/main/services/cryptomator/icon.png - kubero.dev/template.installation: Bundled PostgreSQL (CloudNativePG) and Cryptomator - Keycloak (ghcr.io/cryptomator/keycloak) with a seed realm for smoke-test boot. - Rotate default cryptomator/cryptomator credentials and HUB_KEYCLOAK_SYSTEM_CLIENT_SECRET - before exposing publicly. External /kc ingress routing to Keycloak may require - an additional reverse-proxy path rule beyond the Hub web ingress. Use cryptomator.org/hub/self-hosted - Setup Wizard output to customize realm/clients for production. + kubero.dev/template.installation: Deploys Cryptomator Hub with PostgreSQL (CloudNativePG) + and a Cryptomator Keycloak companion app (ghcr.io/cryptomator/keycloak) seeded + with a cryptomator realm for a smoke-test boot. Keycloak gets its own public + URL; after the first deploy set HUB_KEYCLOAK_PUBLIC_URL on the Hub app to that + URL (browsers sign in there) and redeploy. Keycloak stores its data in a separate + `keycloak` database that the PostgreSQL add-on creates on a dedicated cluster; + on shared zones that database is not provisioned. Rotate the seed realm credentials + (admin/cryptomator, client secret cryptomator, HUB_KEYCLOAK_SYSTEM_CLIENT_SECRET) + before exposing publicly. Use the cryptomator.org/hub/self-hosted Setup Wizard + output to customize realm/clients for production. kubero.dev/template.links: '["https://docs.cryptomator.org/hub/", "https://docs.cryptomator.org/hub/deployment/"]' kubero.dev/template.screenshots: '[]' kubero.dev/template.source: https://github.com/cryptomator/hub @@ -82,194 +86,27 @@ spec: stringData: username: cryptomator password: cryptomator - keycloakConfig: - apiVersion: v1 - kind: ConfigMap - metadata: - name: '{{KUBERO_APP_NAME}}-config' - data: - KC_DB: postgres - KC_DB_URL: jdbc:postgresql://{{KUBERO_APP_NAME}}-postgresql:5432/keycloak - KC_DB_USERNAME: cryptomator - KC_BOOTSTRAP_ADMIN_USERNAME: admin - KC_HEALTH_ENABLED: 'true' - KC_METRICS_ENABLED: 'true' - KC_HTTP_ENABLED: 'true' - KC_PROXY_HEADERS: xforwarded - KC_HOSTNAME_STRICT: 'false' - KC_HOSTNAME_BACKCHANNEL_DYNAMIC: 'true' - QUARKUS_TRANSACTION_MANAGER_ENABLE_RECOVERY: 'false' - keycloakSecret: - apiVersion: v1 - kind: Secret - metadata: - name: cryptomator-keycloak-secret - type: Opaque - stringData: - kc_admin_password: cryptomator - kc_db_password: cryptomator - realm.json: "{\n \"realm\": \"cryptomator\",\n \"displayName\": \"Cryptomator\ - \ Hub\",\n \"loginTheme\": \"cryptomator\",\n \"enabled\": true,\n \ - \ \"sslRequired\": \"external\",\n \"defaultRole\": { \"name\": \"user\"\ - , \"description\": \"User\" },\n \"roles\": {\n \"realm\": [\n \ - \ { \"name\": \"user\", \"description\": \"User\", \"composite\": false\ - \ },\n { \"name\": \"create-vaults\", \"description\": \"Can create\ - \ vaults\", \"composite\": false },\n {\n \"name\": \"admin\"\ - ,\n \"description\": \"Administrator\",\n \"composite\"\ - : true,\n \"composites\": {\n \"realm\": [\"user\", \"\ - create-vaults\"],\n \"client\": { \"realm-management\": [\"realm-admin\"\ - ] }\n }\n }\n ]\n },\n \"users\": [\n {\n \"\ - username\": \"admin\",\n \"enabled\": true,\n \"credentials\"\ - : [{ \"type\": \"password\", \"value\": \"cryptomator\", \"temporary\"\ - : true }],\n \"requiredActions\": [\"UPDATE_PASSWORD\"],\n \"\ - realmRoles\": [\"admin\"]\n },\n {\n \"username\": \"system\"\ - ,\n \"email\": \"system@localhost\",\n \"enabled\": true,\n\ - \ \"serviceAccountClientId\": \"cryptomatorhub-system\",\n \"\ - clientRoles\": {\n \"realm-management\": [\"realm-admin\", \"view-system\"\ - ]\n }\n }\n ],\n \"scopeMappings\": [{ \"client\": \"cryptomatorhub\"\ - , \"roles\": [\"user\", \"admin\"] }],\n \"clients\": [\n {\n \ - \ \"clientId\": \"cryptomatorhub\",\n \"serviceAccountsEnabled\"\ - : false,\n \"publicClient\": true,\n \"name\": \"Cryptomator\ - \ Hub\",\n \"enabled\": true,\n \"redirectUris\": [\"*\"],\n\ - \ \"webOrigins\": [\"+\"],\n \"bearerOnly\": false,\n \"\ - frontchannelLogout\": false,\n \"protocol\": \"openid-connect\",\n\ - \ \"attributes\": { \"pkce.code.challenge.method\": \"S256\" }\n\ - \ },\n {\n \"clientId\": \"cryptomator\",\n \"serviceAccountsEnabled\"\ - : false,\n \"publicClient\": true,\n \"name\": \"Cryptomator\ - \ App\",\n \"enabled\": true,\n \"redirectUris\": [\"*\"],\n\ - \ \"webOrigins\": [\"+\"],\n \"protocol\": \"openid-connect\"\ - ,\n \"attributes\": { \"pkce.code.challenge.method\": \"S256\" }\n\ - \ },\n {\n \"clientId\": \"cryptomatorhub-system\",\n \ - \ \"serviceAccountsEnabled\": true,\n \"publicClient\": false,\n\ - \ \"name\": \"Cryptomator Hub System\",\n \"enabled\": true,\n\ - \ \"clientAuthenticatorType\": \"client-secret\",\n \"secret\"\ - : \"cryptomator\",\n \"standardFlowEnabled\": false\n }\n ]\n\ - }\n" - keycloakService: - apiVersion: v1 - kind: Service - metadata: - name: cryptomator-idp - spec: - type: ClusterIP - selector: - app: cryptomator-idp - ports: - - name: http - port: 8080 - targetPort: 8080 - - name: management - port: 9000 - targetPort: 9000 - keycloakDeployment: - apiVersion: apps/v1 - kind: Deployment - metadata: - name: cryptomator-idp - spec: - replicas: 1 - strategy: - type: Recreate - selector: - matchLabels: - app: cryptomator-idp - template: - metadata: - labels: - app: cryptomator-idp - spec: - containers: - - name: keycloak - image: ghcr.io/cryptomator/keycloak:26.6.2 - imagePullPolicy: Always - command: - - /opt/keycloak/bin/kc.sh - - start - - --optimized - - --import-realm - ports: - - name: http - containerPort: 8080 - - name: management - containerPort: 9000 - envFrom: - - configMapRef: - name: '{{KUBERO_APP_NAME}}-config' - env: - - name: KC_DB_PASSWORD - valueFrom: - secretKeyRef: - name: cryptomator-keycloak-secret - key: kc_db_password - - name: KC_BOOTSTRAP_ADMIN_PASSWORD - valueFrom: - secretKeyRef: - name: cryptomator-keycloak-secret - key: kc_admin_password - startupProbe: - httpGet: - path: /health/started - port: management - initialDelaySeconds: 15 - periodSeconds: 5 - failureThreshold: 36 - readinessProbe: - httpGet: - path: /health/ready - port: management - periodSeconds: 5 - failureThreshold: 6 - livenessProbe: - httpGet: - path: /health/live - port: management - periodSeconds: 10 - failureThreshold: 6 - resources: - requests: - cpu: 100m - memory: 256Mi - limits: - cpu: '1' - memory: 768Mi - volumeMounts: - - name: tmp - mountPath: /tmp - subPath: tmp - - name: data - mountPath: /opt/keycloak/data - - name: realm - mountPath: /opt/keycloak/data/import/realm.json - subPath: realm.json - readOnly: true - volumes: - - name: tmp - emptyDir: {} - - name: data - emptyDir: {} - - name: realm - secret: - secretName: cryptomator-keycloak-secret - items: - - key: realm.json - path: realm.json envVars: - name: QUARKUS_HTTP_PORT value: '8080' - name: QUARKUS_DATASOURCE_JDBC_URL value: 'jdbc:postgresql://$(PGHOST):$(PGPORT)/$(PGDATABASE)' - name: QUARKUS_DATASOURCE_USERNAME - value: cryptomator + value: '$(PGUSER)' - name: QUARKUS_DATASOURCE_PASSWORD - value: cryptomator + value: '$(PGPASSWORD)' - name: HUB_PUBLIC_ROOT_PATH value: / - name: HUB_PUBLIC_URL value: '{{KUBERO_APP_URL}}' + # Browser-facing Keycloak URL: set it to the public URL of the + # cryptomator-keycloak app once that app has one (see installation notes). - name: HUB_KEYCLOAK_PUBLIC_URL value: '{{KUBERO_APP_URL}}/kc' + # The Keycloak companion app below; sibling apps of a catalog group are + # reached as --kuberoapp on port 80. - name: HUB_KEYCLOAK_LOCAL_URL - value: http://cryptomator-idp:8080 + value: http://cryptomator-keycloak-{{KUBERO_NAME_SUFFIX}}-kuberoapp - name: HUB_KEYCLOAK_REALM value: cryptomator - name: HUB_KEYCLOAK_SYSTEM_CLIENT_ID @@ -281,7 +118,7 @@ spec: - name: HUB_KEYCLOAK_OIDC_CRYPTOMATOR_CLIENT_ID value: cryptomator - name: QUARKUS_OIDC_AUTH_SERVER_URL - value: http://cryptomator-idp:8080/realms/cryptomator + value: http://cryptomator-keycloak-{{KUBERO_NAME_SUFFIX}}-kuberoapp/realms/cryptomator - name: QUARKUS_OIDC_CLIENT_ID value: cryptomatorhub - name: QUARKUS_OIDC_TOKEN_ISSUER @@ -317,3 +154,144 @@ spec: run: securityContext: readOnlyRootFilesystem: false + # Keycloak for Hub sign-in, as its own app (it was a Deployment + Service + # baked into the Postgres add-on's resourceDefinitions, which the server + # refuses: #136). It shares the Hub's Postgres add-on (usePrimaryAddons + # injects PGHOST/PGPORT/PGUSER/PGPASSWORD) and uses the `keycloak` database + # the add-on's initdb creates. The command writes the seed realm from + # CRYPTOMATOR_REALM_JSON into Keycloak's import folder, then starts it + # (the image ships bash, which kc.sh needs anyway). + # exposeInternet is left unset on purpose: the dashboard then gives this + # companion its own public URL (browsers must reach Keycloak to sign in) + # without making it the group's public entry, so the Hub stays public too. + templateServices: + - id: keycloak + nameHint: cryptomator-keycloak + serviceType: web + usePrimaryAddons: true + image: + repository: ghcr.io/cryptomator/keycloak + tag: 26.6.2 + containerPort: '8080' + command: + - /bin/bash + - -c + - | + mkdir -p /opt/keycloak/data/import + printf '%s' "$CRYPTOMATOR_REALM_JSON" > /opt/keycloak/data/import/realm.json + exec /opt/keycloak/bin/kc.sh start --import-realm + envVars: + - name: KC_DB + value: postgres + - name: KC_DB_URL_HOST + value: '$(PGHOST)' + - name: KC_DB_URL_PORT + value: '$(PGPORT)' + - name: KC_DB_URL_DATABASE + value: keycloak + - name: KC_DB_USERNAME + value: '$(PGUSER)' + - name: KC_DB_PASSWORD + value: '$(PGPASSWORD)' + - name: KC_BOOTSTRAP_ADMIN_USERNAME + value: admin + - name: KC_BOOTSTRAP_ADMIN_PASSWORD + value: '{{KUBERO_GEN_ALNUM:24}}' + - name: KC_HEALTH_ENABLED + value: 'true' + - name: KC_METRICS_ENABLED + value: 'true' + - name: KC_HTTP_ENABLED + value: 'true' + - name: KC_PROXY_HEADERS + value: xforwarded + - name: KC_HOSTNAME_STRICT + value: 'false' + - name: QUARKUS_TRANSACTION_MANAGER_ENABLE_RECOVERY + value: 'false' + - name: CRYPTOMATOR_REALM_JSON + value: | + { + "realm": "cryptomator", + "displayName": "Cryptomator Hub", + "loginTheme": "cryptomator", + "enabled": true, + "sslRequired": "external", + "defaultRole": { "name": "user", "description": "User" }, + "roles": { + "realm": [ + { "name": "user", "description": "User", "composite": false }, + { "name": "create-vaults", "description": "Can create vaults", "composite": false }, + { + "name": "admin", + "description": "Administrator", + "composite": true, + "composites": { + "realm": ["user", "create-vaults"], + "client": { "realm-management": ["realm-admin"] } + } + } + ] + }, + "users": [ + { + "username": "admin", + "enabled": true, + "credentials": [{ "type": "password", "value": "cryptomator", "temporary": true }], + "requiredActions": ["UPDATE_PASSWORD"], + "realmRoles": ["admin"] + }, + { + "username": "system", + "email": "system@localhost", + "enabled": true, + "serviceAccountClientId": "cryptomatorhub-system", + "clientRoles": { + "realm-management": ["realm-admin", "view-system"] + } + } + ], + "scopeMappings": [{ "client": "cryptomatorhub", "roles": ["user", "admin"] }], + "clients": [ + { + "clientId": "cryptomatorhub", + "serviceAccountsEnabled": false, + "publicClient": true, + "name": "Cryptomator Hub", + "enabled": true, + "redirectUris": ["*"], + "webOrigins": ["+"], + "bearerOnly": false, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { "pkce.code.challenge.method": "S256" } + }, + { + "clientId": "cryptomator", + "serviceAccountsEnabled": false, + "publicClient": true, + "name": "Cryptomator App", + "enabled": true, + "redirectUris": ["*"], + "webOrigins": ["+"], + "protocol": "openid-connect", + "attributes": { "pkce.code.challenge.method": "S256" } + }, + { + "clientId": "cryptomatorhub-system", + "serviceAccountsEnabled": true, + "publicClient": false, + "name": "Cryptomator Hub System", + "enabled": true, + "clientAuthenticatorType": "client-secret", + "secret": "cryptomator", + "standardFlowEnabled": false + } + ] + } + healthcheck: + enabled: true + path: /realms/cryptomator + startupSeconds: 600 + timeoutSeconds: 10 + periodSeconds: 15 diff --git a/services/dittofeed/app.yaml b/services/dittofeed/app.yaml index 9c7310c2..e387f701 100644 --- a/services/dittofeed/app.yaml +++ b/services/dittofeed/app.yaml @@ -10,11 +10,12 @@ metadata: kubero.dev/template.icon: https://raw.githubusercontent.com/stackblaze/stack-templates/main/services/dittofeed/icon.png kubero.dev/template.installation: 'Dittofeed is a multi-service stack. This template runs the all-in-one dittofeed/dittofeed-lite image (API + dashboard + worker - in one process) on port 3000 in single-tenant mode. It needs two operator add-ons - (Postgres + ClickHouse, both provisioned here) AND an external Temporal cluster, - which is NOT an available add-on: deploy Temporal separately (image temporalio/auto-setup:1.22.4 - with its own Postgres, plus optional temporalio/ui:2.22.1) and point TEMPORAL_ADDRESS - at it (default temporal:7233). For production scale you may instead run the + in one process) on port 3000 in single-tenant mode. It uses two operator add-ons + (Postgres + ClickHouse, both provisioned here) and a Temporal companion app + (temporalio/auto-setup:1.22.4, wired through TEMPORAL_ADDRESS) that keeps its + temporal and temporal_visibility databases on the same Postgres add-on. Temporal + creates those databases at first start, which needs CREATEDB: granted on a dedicated + cluster, possibly not on shared zones. For production scale you may instead run the split images dittofeed/api, dittofeed/dashboard, and dittofeed/worker (worker handles the Temporal-driven journey processing) rather than the lite bundle; blob storage (any S3/MinIO) is optional. BOOTSTRAP=true auto-creates the default @@ -70,6 +71,10 @@ spec: - GRANT ALL ON SCHEMA public TO dittofeed - GRANT CREATE ON SCHEMA public TO dittofeed - ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON TABLES TO dittofeed + # The Temporal companion creates its own temporal and + # temporal_visibility databases as this user. + postInitSQL: + - ALTER ROLE dittofeed CREATEDB enableSuperuserAccess: true superuserSecret: name: '{{KUBERO_APP_NAME}}-postgresql-superuser' @@ -91,69 +96,6 @@ spec: stringData: username: dittofeed password: dittofeed - temporalService: - apiVersion: v1 - kind: Service - metadata: - name: dittofeed-temporal - spec: - type: ClusterIP - selector: - app: dittofeed-temporal - ports: - - name: grpc - port: 7233 - targetPort: 7233 - temporalDeployment: - apiVersion: apps/v1 - kind: Deployment - metadata: - name: dittofeed-temporal - spec: - replicas: 1 - strategy: - type: Recreate - selector: - matchLabels: - app: dittofeed-temporal - template: - metadata: - labels: - app: dittofeed-temporal - spec: - containers: - - name: temporal - image: docker.io/temporalio/auto-setup:1.22.4 - imagePullPolicy: Always - ports: - - name: grpc - containerPort: 7233 - env: - - name: DB - value: postgresql - - name: DB_PORT - value: '5432' - - name: POSTGRES_SEEDS - value: '{{KUBERO_APP_NAME}}-postgresql' - - name: POSTGRES_USER - value: postgres - - name: POSTGRES_PWD - value: dittofeed - - name: ENABLE_ES - value: 'false' - - name: BIND_ON_IP - value: 0.0.0.0 - - name: TEMPORAL_BROADCAST_ADDRESS - valueFrom: - fieldRef: - fieldPath: status.podIP - resources: - requests: - cpu: 100m - memory: 256Mi - limits: - cpu: '1' - memory: 512Mi - displayName: ClickHouse env: [] icon: /img/addons/clickhouse.svg @@ -231,8 +173,10 @@ spec: value: dittofeed - name: CLICKHOUSE_DATABASE value: '$(PGDATABASE)' + # The Temporal companion app below (gRPC). Sibling apps of a catalog group + # are reached as --kuberoapp on port 80. - name: TEMPORAL_ADDRESS - value: dittofeed-temporal:7233 + value: dittofeed-temporal-{{KUBERO_NAME_SUFFIX}}-kuberoapp:80 - name: DASHBOARD_API_BASE value: '{{KUBERO_APP_URL}}' extraVolumes: [] @@ -262,3 +206,42 @@ spec: run: securityContext: readOnlyRootFilesystem: false + # Temporal (journey/workflow engine) as its own app. It was a Deployment + + # Service baked into the Postgres add-on's resourceDefinitions, which the + # server refuses (#136). It shares the Postgres add-on (usePrimaryAddons + # injects PGHOST/PGPORT/PGUSER/PGPASSWORD; the old one dialled the + # superuser with a literal password) and auto-setup creates its databases. + # Private web service so the group Service fronts gRPC 7233; Temporal + # 1.22 has no HTTP endpoint, so the HTTP health check stays off. + # BIND_ON_IP 0.0.0.0 makes the image's entrypoint broadcast the pod IP. + templateServices: + - id: temporal + nameHint: dittofeed-temporal + serviceType: web + exposeInternet: false + usePrimaryAddons: true + image: + repository: docker.io/temporalio/auto-setup + tag: 1.22.4 + containerPort: '7233' + envVars: + - name: DB + value: postgres12 + - name: DB_PORT + value: '$(PGPORT)' + - name: POSTGRES_SEEDS + value: '$(PGHOST)' + - name: POSTGRES_USER + value: '$(PGUSER)' + - name: POSTGRES_PWD + value: '$(PGPASSWORD)' + - name: DBNAME + value: temporal + - name: VISIBILITY_DBNAME + value: temporal_visibility + - name: ENABLE_ES + value: 'false' + - name: BIND_ON_IP + value: 0.0.0.0 + healthcheck: + enabled: false diff --git a/services/langfuse/app.yaml b/services/langfuse/app.yaml index cd70c466..c964e8f1 100644 --- a/services/langfuse/app.yaml +++ b/services/langfuse/app.yaml @@ -10,9 +10,10 @@ metadata: kubero.dev/template.installation: 'Langfuse v3 is a multi-service stack. This template runs the PRIMARY web/API container (ghcr.io/langfuse/langfuse:3, port 3000). Bundled add-ons provision Postgres (transactional data), ClickHouse (trace/observation - store), Valkey (Redis-compatible queue/cache), plus an in-cluster MinIO deployment - (ephemeral S3 for event uploads). For production durability swap MinIO for the - RustFS add-on or external S3. For full ingestion throughput you should ALSO + store), Valkey (Redis-compatible queue/cache), plus a MinIO companion app + (S3 for event/media uploads, on a 5Gi volume, root password generated at deploy + and shared with Langfuse). You may swap MinIO for the RustFS add-on or external + S3. For full ingestion throughput you should ALSO deploy a companion WORKER from image ghcr.io/langfuse/langfuse-worker:3 (port 3030) sharing the same env vars below. ROTATE before production: NEXTAUTH_SECRET, SALT, ENCRYPTION_KEY (64-char hex via openssl rand -hex 32), Postgres/ClickHouse/MinIO @@ -86,66 +87,6 @@ spec: stringData: username: langfuse password: langfuse - minioService: - apiVersion: v1 - kind: Service - metadata: - name: langfuse-minio - spec: - type: ClusterIP - selector: - app: langfuse-minio - ports: - - name: s3 - port: 9000 - targetPort: 9000 - minioDeployment: - apiVersion: apps/v1 - kind: Deployment - metadata: - name: langfuse-minio - spec: - replicas: 1 - strategy: - type: Recreate - selector: - matchLabels: - app: langfuse-minio - template: - metadata: - labels: - app: langfuse-minio - spec: - containers: - - name: minio - image: cgr.dev/chainguard/minio:latest - imagePullPolicy: Always - command: - - sh - - -c - - mkdir -p /data/langfuse && minio server --address :9000 --console-address - :9001 /data - env: - - name: MINIO_ROOT_USER - value: langfuseadmin - - name: MINIO_ROOT_PASSWORD - value: changeme - ports: - - name: s3 - containerPort: 9000 - volumeMounts: - - name: '{{KUBERO_APP_NAME}}-data' - mountPath: /data - resources: - requests: - cpu: 50m - memory: 128Mi - limits: - cpu: 500m - memory: 512Mi - volumes: - - name: '{{KUBERO_APP_NAME}}-data' - emptyDir: {} - displayName: ClickHouse env: [] icon: /img/addons/clickhouse.svg @@ -231,8 +172,14 @@ spec: envVars: - name: CHHOST value: clickhouse-{{KUBERO_APP_NAME}}-clickhouse + # The MinIO companion app below. Sibling apps of a catalog group are + # reached as --kuberoapp on port 80. - name: S3HOST - value: langfuse-minio + value: langfuse-minio-{{KUBERO_NAME_SUFFIX}}-kuberoapp + # Shared with the MinIO companion (one value per variable name across the + # group), which uses it as MINIO_ROOT_PASSWORD. + - name: LANGFUSE_MINIO_PASSWORD + value: '{{KUBERO_GEN_ALNUM:32}}' - name: DATABASE_URL value: 'postgresql://$(PGUSER):$(PGPASSWORD)@$(PGHOST):$(PGPORT)/$(PGDATABASE)' - name: NEXTAUTH_URL @@ -264,9 +211,9 @@ spec: - name: LANGFUSE_S3_EVENT_UPLOAD_ACCESS_KEY_ID value: langfuseadmin - name: LANGFUSE_S3_EVENT_UPLOAD_SECRET_ACCESS_KEY - value: changeme + value: '$(LANGFUSE_MINIO_PASSWORD)' - name: LANGFUSE_S3_EVENT_UPLOAD_ENDPOINT - value: http://langfuse-minio:9000 + value: http://$(S3HOST) - name: LANGFUSE_S3_EVENT_UPLOAD_FORCE_PATH_STYLE value: 'true' - name: LANGFUSE_S3_MEDIA_UPLOAD_BUCKET @@ -276,9 +223,9 @@ spec: - name: LANGFUSE_S3_MEDIA_UPLOAD_ACCESS_KEY_ID value: langfuseadmin - name: LANGFUSE_S3_MEDIA_UPLOAD_SECRET_ACCESS_KEY - value: changeme + value: '$(LANGFUSE_MINIO_PASSWORD)' - name: LANGFUSE_S3_MEDIA_UPLOAD_ENDPOINT - value: http://langfuse-minio:9000 + value: http://$(S3HOST) - name: LANGFUSE_S3_MEDIA_UPLOAD_FORCE_PATH_STYLE value: 'true' - name: LANGFUSE_INIT_ORG_ID @@ -323,7 +270,7 @@ spec: - sh - -c - 'node -e "const net=require(''net'');const wait=(h,p)=>new Promise(r=>{const - go=()=>{const s=net.connect(p,h,()=>{s.end();r();});s.on(''error'',()=>setTimeout(go,2000));};go();});Promise.all([wait(process.env.PGHOST,5432),wait(process.env.CHHOST,8123),wait(process.env.REDIS_HOST,+process.env.REDIS_PORT),wait(process.env.S3HOST,9000)]).then(()=>process.exit(0));" + go=()=>{const s=net.connect(p,h,()=>{s.end();r();});s.on(''error'',()=>setTimeout(go,2000));};go();});Promise.all([wait(process.env.PGHOST,5432),wait(process.env.CHHOST,8123),wait(process.env.REDIS_HOST,+process.env.REDIS_PORT),wait(process.env.S3HOST,80)]).then(()=>process.exit(0));" && dumb-init -- ./web/entrypoint.sh sh -c ''node ./web/server.js --keepAliveTimeout 110000'' @@ -331,3 +278,42 @@ spec: run: securityContext: readOnlyRootFilesystem: false + # MinIO (S3) for event/media uploads, as its own app. It was a + # Deployment + Service baked into the Postgres add-on's resourceDefinitions, + # which the server refuses (#136). Same image and start command as + # Langfuse's docker-compose (the mkdir creates the `langfuse` bucket); data + # now lives on a volume instead of an emptyDir. Private web service on the + # S3 port; the root password is the group-shared LANGFUSE_MINIO_PASSWORD. + templateServices: + - id: minio + nameHint: langfuse-minio + serviceType: web + exposeInternet: false + image: + repository: cgr.dev/chainguard/minio + tag: latest + containerPort: '9000' + command: + - sh + - -c + - mkdir -p /data/langfuse && exec minio server --address :9000 --console-address :9001 /data + envVars: + - name: LANGFUSE_MINIO_PASSWORD + value: '{{KUBERO_GEN_ALNUM:32}}' + - name: MINIO_ROOT_USER + value: langfuseadmin + - name: MINIO_ROOT_PASSWORD + value: '$(LANGFUSE_MINIO_PASSWORD)' + extraVolumes: + - accessModes: + - ReadWriteMany + emptyDir: false + mountPath: /data + name: '{{KUBERO_APP_NAME}}-minio-data' + size: 5Gi + storageClass: shared + healthcheck: + enabled: true + path: /minio/health/live + timeoutSeconds: 5 + periodSeconds: 10 diff --git a/services/n8n/app.yaml b/services/n8n/app.yaml index 19e79530..1c22df44 100644 --- a/services/n8n/app.yaml +++ b/services/n8n/app.yaml @@ -10,8 +10,9 @@ metadata: complete the one-time owner setup at your app URL, then sign in. Queue mode uses Valkey as the job queue and a companion worker for executions. N8N_ENCRYPTION_KEY is generated at deploy and shared with the worker — do not change it on only - one of the apps. AI Assistant uses a bundled n8n sandbox and SearXNG for web - search. Add an Anthropic, OpenAI, or OpenRouter key in n8n AI settings or set + one of the apps. AI Assistant searches the web through a bundled SearXNG + companion app; code execution in the n8n sandbox is not included (it needs + privileged containers, which the platform does not allow). Add an Anthropic, OpenAI, or OpenRouter key in n8n AI settings or set N8N_INSTANCE_AI_MODEL_API_KEY. Optionally set INSTANCE_AI_BRAVE_SEARCH_API_KEY to prefer Brave over SearXNG. If you are sent back to /setup, delete the app and its PostgreSQL addon together, redeploy, and verify POST /rest/login returns @@ -82,264 +83,6 @@ spec: stringData: username: n8n password: '123456' - sandboxDeployment: - apiVersion: apps/v1 - kind: Deployment - metadata: - name: '{{KUBERO_APP_NAME}}-sandbox' - spec: - replicas: 1 - strategy: - type: Recreate - selector: - matchLabels: - app: '{{KUBERO_APP_NAME}}-sandbox' - template: - metadata: - labels: - app: '{{KUBERO_APP_NAME}}-sandbox' - spec: - hostAliases: - - ip: 127.0.0.1 - hostnames: - - '{{KUBERO_APP_NAME}}-sandbox-api' - - '{{KUBERO_APP_NAME}}-sandbox-runner-1' - initContainers: - - name: certs - image: ghcr.io/n8n-io/n8n-sandbox-service-api:latest - imagePullPolicy: Always - securityContext: - runAsUser: 0 - runAsGroup: 0 - command: - - sh - - -c - - bootstrap-mtls.sh --out-dir /tls --api-san {{KUBERO_APP_NAME}}-sandbox-api - --control-san-prefix {{KUBERO_APP_NAME}}-sandbox-runner --runners - 1 --world-readable && chown -R sandbox-api:sandbox-api /tls/api - env: - - name: NUM_RUNNERS - value: '1' - volumeMounts: - - name: tls - mountPath: /tls - containers: - - name: api - image: ghcr.io/n8n-io/n8n-sandbox-service-api:latest - imagePullPolicy: Always - ports: - - name: http - containerPort: 8080 - - name: grpc - containerPort: 9090 - env: - - name: SANDBOX_API_KEYS - value: changeme-n8n-sandbox-key - - name: SANDBOX_API_RUNNER_REGISTRATION_TOKEN - value: changeme-n8n-sandbox-reg - - name: SANDBOX_API_RUNNER_API_KEY - value: changeme-n8n-sandbox-runner - - name: SANDBOX_API_GRPC_TLS_CERT_FILE - value: /tls/api/grpc-server.crt - - name: SANDBOX_API_GRPC_TLS_KEY_FILE - value: /tls/api/grpc-server.key - - name: SANDBOX_API_GRPC_TLS_CLIENT_CA_FILE - value: /tls/api/ca.crt - - name: SANDBOX_API_RUNNER_CONTROL_GRPC_TLS_CA_FILE - value: /tls/api/ca.crt - - name: SANDBOX_API_RUNNER_CONTROL_GRPC_TLS_CERT_FILE - value: /tls/api/control-grpc-api-client.crt - - name: SANDBOX_API_RUNNER_CONTROL_GRPC_TLS_KEY_FILE - value: /tls/api/control-grpc-api-client.key - - name: SANDBOX_API_RUNNER_CONTROL_GRPC_TLS_SERVER_NAME - value: '{{KUBERO_APP_NAME}}-sandbox-runner-1' - volumeMounts: - - name: tls - mountPath: /tls - readOnly: true - readinessProbe: - httpGet: - path: /healthz - port: 8080 - initialDelaySeconds: 5 - periodSeconds: 5 - failureThreshold: 12 - resources: - requests: - cpu: 50m - memory: 128Mi - limits: - cpu: 500m - memory: 512Mi - - name: runner - image: ghcr.io/n8n-io/n8n-sandbox-service-runner-dind:latest - imagePullPolicy: Always - securityContext: - privileged: true - runAsUser: 0 - ports: - - name: http - containerPort: 8081 - - name: control - containerPort: 9091 - env: - - name: SANDBOX_RUNNER_API_KEYS - value: changeme-n8n-sandbox-runner - - name: SANDBOX_RUNNER_REGISTRATION_TOKEN - value: changeme-n8n-sandbox-reg - - name: SANDBOX_RUNNER_API_GRPC_ADDR - value: '{{KUBERO_APP_NAME}}-sandbox-api:9090' - - name: SANDBOX_RUNNER_LISTEN_ADDR - value: ':8081' - - name: SANDBOX_RUNNER_HTTP_BASE_URL - value: http://{{KUBERO_APP_NAME}}-sandbox-runner-1:8081 - - name: SANDBOX_RUNNER_CONTROL_GRPC_LISTEN_ADDR - value: ':9091' - - name: SANDBOX_RUNNER_CONTROL_GRPC_ADVERTISE_ADDR - value: '{{KUBERO_APP_NAME}}-sandbox-runner-1:9091' - - name: SANDBOX_RUNNER_ID - value: runner-1 - - name: SANDBOX_RUNNER_DOCKER_SANDBOX_IMAGE - value: ghcr.io/n8n-io/n8n-sandbox-service-sandbox:latest - - name: SANDBOX_RUNNER_REGISTRATION_GRPC_CA_FILE - value: /tls/runner/ca.crt - - name: SANDBOX_RUNNER_REGISTRATION_GRPC_CERT_FILE - value: /tls/runner/grpc-client.crt - - name: SANDBOX_RUNNER_REGISTRATION_GRPC_KEY_FILE - value: /tls/runner/grpc-client.key - - name: SANDBOX_RUNNER_REGISTRATION_GRPC_SERVER_NAME - value: '{{KUBERO_APP_NAME}}-sandbox-api' - - name: SANDBOX_RUNNER_CONTROL_GRPC_TLS_CERT_FILE - value: /tls/runner/control-grpc-server.crt - - name: SANDBOX_RUNNER_CONTROL_GRPC_TLS_KEY_FILE - value: /tls/runner/control-grpc-server.key - - name: SANDBOX_RUNNER_CONTROL_GRPC_TLS_CLIENT_CA_FILE - value: /tls/runner/ca.crt - volumeMounts: - - name: tls - mountPath: /tls - readOnly: true - resources: - requests: - cpu: 250m - memory: 512Mi - limits: - cpu: '2' - memory: 2Gi - volumes: - - name: tls - emptyDir: {} - sandboxApiService: - apiVersion: v1 - kind: Service - metadata: - name: '{{KUBERO_APP_NAME}}-sandbox-api' - spec: - type: ClusterIP - selector: - app: '{{KUBERO_APP_NAME}}-sandbox' - ports: - - name: http - port: 8080 - targetPort: 8080 - - name: grpc - port: 9090 - targetPort: 9090 - sandboxRunnerService: - apiVersion: v1 - kind: Service - metadata: - name: '{{KUBERO_APP_NAME}}-sandbox-runner-1' - spec: - type: ClusterIP - selector: - app: '{{KUBERO_APP_NAME}}-sandbox' - ports: - - name: http - port: 8080 - targetPort: 8081 - - name: control - port: 9091 - targetPort: 9091 - searxngConfig: - apiVersion: v1 - kind: ConfigMap - metadata: - name: '{{KUBERO_APP_NAME}}-searxng' - data: - settings.yml: | - use_default_settings: true - search: - formats: - - html - - json - searxngDeployment: - apiVersion: apps/v1 - kind: Deployment - metadata: - name: '{{KUBERO_APP_NAME}}-searxng' - spec: - replicas: 1 - strategy: - type: Recreate - selector: - matchLabels: - app: '{{KUBERO_APP_NAME}}-searxng' - template: - metadata: - labels: - app: '{{KUBERO_APP_NAME}}-searxng' - spec: - containers: - - name: searxng - image: docker.io/searxng/searxng:latest - imagePullPolicy: Always - ports: - - name: http - containerPort: 8080 - env: - - name: SEARXNG_SECRET - value: changeme-n8n-searxng-secret - - name: SEARXNG_PORT - value: '8080' - - name: SEARXNG_BIND_ADDRESS - value: 0.0.0.0 - volumeMounts: - - name: settings - mountPath: /etc/searxng/settings.yml - subPath: settings.yml - readOnly: true - readinessProbe: - httpGet: - path: / - port: 8080 - initialDelaySeconds: 10 - periodSeconds: 10 - failureThreshold: 6 - resources: - requests: - cpu: 50m - memory: 128Mi - limits: - cpu: 250m - memory: 256Mi - volumes: - - name: settings - configMap: - name: '{{KUBERO_APP_NAME}}-searxng' - searxngService: - apiVersion: v1 - kind: Service - metadata: - name: '{{KUBERO_APP_NAME}}-searxng' - spec: - type: ClusterIP - selector: - app: '{{KUBERO_APP_NAME}}-searxng' - ports: - - name: http - port: 8080 - targetPort: 8080 - displayName: Valkey env: [] icon: /img/addons/redis.svg @@ -454,20 +197,15 @@ spec: value: changeme - name: N8N_ENABLED_MODULES value: instance-ai + # The n8n code sandbox (n8n-sandbox-service runner-dind) needs a privileged + # Docker-in-Docker container, which the platform does not allow (#136), so + # it is not bundled: AI Assistant runs without code execution. - name: N8N_INSTANCE_AI_SANDBOX_ENABLED - value: 'true' - - name: N8N_INSTANCE_AI_SANDBOX_PROVIDER - value: n8n-sandbox - - name: N8N_SANDBOX_SERVICE_URL - value: http://{{KUBERO_APP_NAME}}-sandbox-api:8080 - - name: N8N_SANDBOX_SERVICE_API_KEY - value: changeme-n8n-sandbox-key - - name: N8N_INSTANCE_AI_SANDBOX_IMAGE - value: ghcr.io/n8n-io/n8n-sandbox-service-sandbox:latest - - name: N8N_INSTANCE_AI_SANDBOX_TIMEOUT - value: '600000' + value: 'false' + # Web search through the SearXNG companion below. Sibling apps of a catalog + # group are reached as --kuberoapp on port 80. - name: N8N_INSTANCE_AI_SEARXNG_URL - value: http://{{KUBERO_APP_NAME}}-searxng:8080 + value: http://n8n-searxng-{{KUBERO_NAME_SUFFIX}}-kuberoapp extraVolumes: [] image: containerPort: '5678' @@ -528,3 +266,35 @@ spec: path: /healthz timeoutSeconds: 5 periodSeconds: 10 + # SearXNG web search for AI Assistant (was a Deployment baked into the + # Postgres add-on's resourceDefinitions, which the server refuses: #136). + # Private web service; n8n dials it through N8N_INSTANCE_AI_SEARXNG_URL. + # n8n queries SearXNG's JSON API, which the default settings.yml turns off, + # so the command writes a settings file that enables it, then starts the + # image's own entrypoint (the image ships /bin/sh). + - id: searxng + nameHint: n8n-searxng + serviceType: web + exposeInternet: false + image: + repository: docker.io/searxng/searxng + tag: 2026.10.17-1c10abe2d + containerPort: '8080' + command: + - /bin/sh + - -c + - | + printf 'use_default_settings: true\nsearch:\n formats:\n - html\n - json\n' > /etc/searxng/settings.yml + exec /usr/local/searxng/entrypoint.sh + envVars: + - name: SEARXNG_SECRET + value: '{{KUBERO_GEN_ALNUM:32}}' + - name: SEARXNG_PORT + value: '8080' + - name: SEARXNG_BIND_ADDRESS + value: 0.0.0.0 + healthcheck: + enabled: true + path: /healthz + timeoutSeconds: 5 + periodSeconds: 10 diff --git a/services/posthog/app.yaml b/services/posthog/app.yaml index ded5cfcc..1e43265d 100644 --- a/services/posthog/app.yaml +++ b/services/posthog/app.yaml @@ -8,48 +8,43 @@ metadata: feature flags, A/B testing and surveys platform built on PostgreSQL, ClickHouse and Kafka. kubero.dev/template.icon: https://raw.githubusercontent.com/stackblaze/stack-templates/main/services/posthog/icon.png - kubero.dev/template.installation: "PostHog is a LARGE multi-service stack; this\ - \ template runs the PRIMARY all-in-one image posthog/posthog (the `web` role:\ - \ Django backend + frontend) on HTTP port 8000. It is NOT fully functional alone\ - \ - PostHog needs several companion services and TWO datastores that are NOT\ - \ in the allowed add-on set (Kafka and S3-compatible object storage), so plan\ - \ to deploy those alongside it.\n\nADD-ONS provisioned here: postgres (relational\ - \ app DB), clickhouse (the OLAP event store - the heart of PostHog analytics,\ - \ reached at clickhouse-posthog-clickhouse:8123 over plain HTTP, so CLICKHOUSE_SECURE=false\ - \ and CLICKHOUSE_VERIFY=false), and valkey (Redis-compatible cache/broker at\ - \ rfr-posthog-valkey-readwrite:6379, no password).\n\nNOT provisionable as add-ons\ - \ - deploy these as separate Kubero apps and update the *_HOSTS/endpoint env\ - \ vars to point at them:\n - KAFKA / event bus: PostHog requires Kafka. Use\ - \ Redpanda (image `redpandadata/redpanda:latest`, Kafka API on 9092) or `bitnami/kafka`.\ - \ Set KAFKA_HOSTS on EVERY PostHog container to host:9092.\n - OBJECT STORAGE\ - \ (session recordings, exports, uploads): PostHog requires S3-compatible storage.\ - \ Deploy the platform's RustFS/S3 add-on or `minio/minio`, then set OBJECT_STORAGE_ENABLED=true,\ - \ OBJECT_STORAGE_ENDPOINT, OBJECT_STORAGE_ACCESS_KEY_ID, OBJECT_STORAGE_SECRET_ACCESS_KEY,\ - \ OBJECT_STORAGE_BUCKET.\n - TEMPORAL (batch exports / scheduled jobs): image\ - \ `temporalio/auto-setup` on gRPC 7233; only needed if you use batch exports.\n\ - \nCOMPANION POSTHOG CONTAINERS (same posthog/posthog image, different command\ - \ - deploy each as its own Kubero app sharing the SAME env vars / DATABASE_URL\ - \ / CLICKHOUSE / KAFKA / REDIS):\n - WORKER (Celery): command `./bin/docker-worker-celery\ - \ --with-scheduler` - runs async tasks AND the scheduler; REQUIRED for the app\ - \ to work.\n - PLUGIN-SERVER / ingestion: command `./bin/plugin-server` - consumes\ - \ Kafka events into ClickHouse; REQUIRED for any analytics data to appear.\n\ - \ - MIGRATE (one-shot, run FIRST): command `python manage.py migrate && python\ - \ manage.py migrate_clickhouse` to create Postgres + ClickHouse schemas before\ - \ the web/worker start. The migrate-clickhouse step needs Kafka reachable.\n\ - \ - (Optional high-scale, separate Rust images) CAPTURE -> `ghcr.io/posthog/posthog/capture:latest`\ + kubero.dev/template.installation: "PostHog is a LARGE multi-service stack; this template runs\ + \ the PRIMARY all-in-one image posthog/posthog (the `web` role: Django backend + frontend)\ + \ on HTTP port 8000. It is NOT fully functional alone - PostHog needs several companion\ + \ services and S3-compatible object storage, which are not provisioned here, so plan to\ + \ deploy those alongside it. Kafka is bundled as a Redpanda companion app (KAFKA_HOSTS points\ + \ at it).\n\nADD-ONS provisioned here: postgres (relational app DB), clickhouse (the OLAP\ + \ event store - the heart of PostHog analytics, reached at clickhouse-posthog-clickhouse:8123\ + \ over plain HTTP, so CLICKHOUSE_SECURE=false and CLICKHOUSE_VERIFY=false), and valkey (Redis-compatible\ + \ cache/broker at rfr-posthog-valkey-readwrite:6379, no password).\n\nNOT provisionable\ + \ as add-ons - deploy these as separate Kubero apps and update the *_HOSTS/endpoint env\ + \ vars to point at them:\n - KAFKA / event bus: bundled as the posthog-kafka companion\ + \ app (Redpanda in dev-container mode, ephemeral). Copy KAFKA_HOSTS from the web app onto\ + \ EVERY other PostHog container you add.\n - OBJECT STORAGE (session recordings, exports,\ + \ uploads): PostHog requires S3-compatible storage. Deploy the platform's RustFS/S3 add-on\ + \ or `minio/minio`, then set OBJECT_STORAGE_ENABLED=true, OBJECT_STORAGE_ENDPOINT, OBJECT_STORAGE_ACCESS_KEY_ID,\ + \ OBJECT_STORAGE_SECRET_ACCESS_KEY, OBJECT_STORAGE_BUCKET.\n - TEMPORAL (batch exports\ + \ / scheduled jobs): image `temporalio/auto-setup` on gRPC 7233; only needed if you use\ + \ batch exports.\n\nCOMPANION POSTHOG CONTAINERS (same posthog/posthog image, different\ + \ command - deploy each as its own Kubero app sharing the SAME env vars / DATABASE_URL /\ + \ CLICKHOUSE / KAFKA / REDIS):\n - WORKER (Celery): command `./bin/docker-worker-celery\ + \ --with-scheduler` - runs async tasks AND the scheduler; REQUIRED for the app to work.\n\ + \ - PLUGIN-SERVER / ingestion: command `./bin/plugin-server` - consumes Kafka events into\ + \ ClickHouse; REQUIRED for any analytics data to appear.\n - MIGRATE (one-shot, run FIRST):\ + \ command `python manage.py migrate && python manage.py migrate_clickhouse` to create Postgres\ + \ + ClickHouse schemas before the web/worker start. The migrate-clickhouse step needs Kafka\ + \ reachable.\n - (Optional high-scale, separate Rust images) CAPTURE -> `ghcr.io/posthog/posthog/capture:latest`\ \ (event intake on Kafka), FEATURE-FLAGS -> `ghcr.io/posthog/posthog/feature-flags:latest`.\n\ - \nROTATE before production: SECRET_KEY and ENCRYPTION_SALT_KEYS (both set here\ - \ to placeholder `replace-with-openssl-rand-hex-32` values - generate real ones\ - \ with `openssl rand -hex 32`; ENCRYPTION_SALT_KEYS must be a 32-byte base64/urlsafe\ - \ key and CANNOT change after first boot or stored secrets break), plus the\ - \ postgres and clickhouse add-on passwords (default `posthog`).\n\nFIRST-RUN:\ - \ run the MIGRATE job, then start web + worker + plugin-server; open {{KUBERO_APP_URL}}\ - \ and complete the on-screen setup wizard to create the first organization and\ - \ admin user. SITE_URL is preset to your public URL and IS_BEHIND_PROXY=true\ - \ / DISABLE_SECURE_SSL_REDIRECT=true are set because TLS is terminated at the\ - \ Kubero ingress. NOTE: PostHog deprecated its official Helm chart - self-hosting\ - \ is officially Docker-Compose-based and unsupported for high scale; PostHog\ - \ Cloud is the recommended path for large workloads." + \nROTATE before production: SECRET_KEY and ENCRYPTION_SALT_KEYS (both set here to placeholder\ + \ `replace-with-openssl-rand-hex-32` values - generate real ones with `openssl rand -hex\ + \ 32`; ENCRYPTION_SALT_KEYS must be a 32-byte base64/urlsafe key and CANNOT change after\ + \ first boot or stored secrets break), plus the postgres and clickhouse add-on passwords\ + \ (default `posthog`).\n\nFIRST-RUN: run the MIGRATE job, then start web + worker + plugin-server;\ + \ open {{KUBERO_APP_URL}} and complete the on-screen setup wizard to create the first organization\ + \ and admin user. SITE_URL is preset to your public URL and IS_BEHIND_PROXY=true / DISABLE_SECURE_SSL_REDIRECT=true\ + \ are set because TLS is terminated at the Kubero ingress. NOTE: PostHog deprecated its\ + \ official Helm chart - self-hosting is officially Docker-Compose-based and unsupported\ + \ for high scale; PostHog Cloud is the recommended path for large workloads." kubero.dev/template.links: '["https://posthog.com/docs/self-host", "https://posthog.com/docs/self-host/configure/environment-variables"]' kubero.dev/template.screenshots: '["https://posthog.com/images/og/default.png"]' kubero.dev/template.source: https://github.com/PostHog/posthog @@ -245,74 +240,6 @@ spec: limits: cpu: 500m memory: 256Mi - posthogKafkaService: - apiVersion: v1 - kind: Service - metadata: - name: '{{KUBERO_APP_NAME}}-kafka' - spec: - type: ClusterIP - selector: - app: posthog-kafka - ports: - - name: kafka - port: 9092 - targetPort: 9092 - posthogKafkaDeployment: - apiVersion: apps/v1 - kind: Deployment - metadata: - name: '{{KUBERO_APP_NAME}}-kafka' - spec: - replicas: 1 - strategy: - type: Recreate - selector: - matchLabels: - app: posthog-kafka - template: - metadata: - labels: - app: posthog-kafka - spec: - containers: - - name: redpanda - image: docker.redpanda.com/redpandadata/redpanda:v25.1.9 - imagePullPolicy: Always - command: - - rpk - - redpanda - - start - - --kafka-addr - - internal://0.0.0.0:9092 - - --advertise-kafka-addr - - internal://posthog-kafka:9092 - - --mode - - dev-container - - --smp - - '1' - - --memory - - 256M - - --reserve-memory - - 0M - - --overprovisioned - - --set - - redpanda.auto_create_topics_enabled=true - ports: - - name: kafka - containerPort: 9092 - readinessProbe: - tcpSocket: - port: 9092 - initialDelaySeconds: 5 - periodSeconds: 5 - resources: - requests: - cpu: 100m - memory: 256Mi - limits: - cpu: 500m - memory: 384Mi envVars: - name: DATABASE_URL value: 'postgresql://$(PGUSER):$(PGPASSWORD)@$(PGHOST):$(PGPORT)/$(PGDATABASE)' @@ -338,10 +265,12 @@ spec: value: 'false' - name: CLICKHOUSE_VERIFY value: 'false' + # The Redpanda (Kafka API) companion app below. Sibling apps of a catalog + # group are reached as --kuberoapp on port 80. - name: KAFKA_HOSTS - value: '{{KUBERO_APP_NAME}}-kafka:9092' + value: posthog-kafka-{{KUBERO_NAME_SUFFIX}}-kuberoapp:80 - name: KAFKA_URL - value: kafka://{{KUBERO_APP_NAME}}-kafka:9092 + value: kafka://posthog-kafka-{{KUBERO_NAME_SUFFIX}}-kuberoapp:80 - name: SITE_URL value: '{{KUBERO_APP_URL}}' - name: SECRET_KEY @@ -393,3 +322,39 @@ spec: run: securityContext: readOnlyRootFilesystem: false + # Redpanda (Kafka API) as its own app. It was a Deployment + Service baked + # into the Valkey add-on's resourceDefinitions, which the server refuses + # (#136). Private web service: the group Service fronts the Kafka port on + # 80, so Redpanda advertises that address to clients. Ephemeral, as before + # (dev-container mode). No HTTP endpoint on the Kafka port, so the HTTP + # health check stays off. + templateServices: + - id: kafka + nameHint: posthog-kafka + serviceType: web + exposeInternet: false + image: + repository: docker.io/redpandadata/redpanda + tag: v25.1.9 + containerPort: '9092' + command: + - rpk + - redpanda + - start + - --kafka-addr + - internal://0.0.0.0:9092 + - --advertise-kafka-addr + - internal://posthog-kafka-{{KUBERO_NAME_SUFFIX}}-kuberoapp:80 + - --mode + - dev-container + - --smp + - '1' + - --memory + - 256M + - --reserve-memory + - 0M + - --overprovisioned + - --set + - redpanda.auto_create_topics_enabled=true + healthcheck: + enabled: false diff --git a/services/unomi/app.yaml b/services/unomi/app.yaml index e9f7582b..e49add74 100644 --- a/services/unomi/app.yaml +++ b/services/unomi/app.yaml @@ -10,8 +10,9 @@ metadata: kubero.dev/template.icon: https://raw.githubusercontent.com/stackblaze/stack-templates/main/services/unomi/icon.png kubero.dev/template.installation: "Apache Unomi 3.x requires Elasticsearch 9.x\ \ for all profile/event/segment storage. This template provisions a single-node\ - \ Elasticsearch 9.1.3 companion (`elasticsearch` Service on :9200) automatically;\ - \ for production HA you may point UNOMI_ELASTICSEARCH_ADDRESSES at an external\ + \ Elasticsearch 9.1.3 companion app (unomi-elasticsearch, wired through\ + \ UNOMI_ELASTICSEARCH_ADDRESSES; small heap for the default service size, raise\ + \ ES_JAVA_OPTS with the size) automatically; for production HA you may point UNOMI_ELASTICSEARCH_ADDRESSES at an external\ \ cluster instead. Unomi's Karaf runtime state lives on the persistent volume\ \ at /opt/apache-unomi/data. The HTTP context-server and REST API listen on\ \ 8181 (TLS :9443 and Karaf SSH :8102 are also exposed but need separate routing).\ @@ -31,141 +32,16 @@ metadata: spec: name: unomi deploymentstrategy: docker - addons: - - displayName: Elasticsearch - env: [] - icon: /img/addons/opensearch.svg - id: kubero-operator - kind: Valkey - resourceDefinitions: - Valkey: - apiVersion: rds.valkey.buf.red/v1alpha1 - kind: Valkey - metadata: - name: '{{KUBERO_APP_NAME}}-valkey' - spec: - version: '8.0' - arch: replica - replicas: - shards: 1 - replicasOfShard: 1 - access: - serviceType: ClusterIP - storage: - capacity: 1Gi - storageClassName: fast - resources: - requests: - cpu: 50m - memory: 64Mi - limits: - cpu: 100m - memory: 128Mi - unomiEsDeployment: - apiVersion: apps/v1 - kind: Deployment - metadata: - name: '{{KUBERO_APP_NAME}}-es' - spec: - replicas: 1 - strategy: - type: Recreate - selector: - matchLabels: - app: unomi-es - template: - metadata: - labels: - app: unomi-es - spec: - securityContext: - fsGroup: 1000 - fsGroupChangePolicy: OnRootMismatch - initContainers: - - name: sysctl - image: docker.io/library/busybox:1.36 - command: - - sh - - -c - - sysctl -w vm.max_map_count=262144 || true - securityContext: - privileged: true - - name: data-perms - image: docker.io/library/busybox:1.36 - command: - - sh - - -c - - chown -R 1000:1000 /usr/share/elasticsearch/data - volumeMounts: - - name: data - mountPath: /usr/share/elasticsearch/data - containers: - - name: '{{KUBERO_APP_NAME}}-es' - image: docker.elastic.co/elasticsearch/elasticsearch:9.1.3 - imagePullPolicy: Always - ports: - - name: http - containerPort: 9200 - env: - - name: discovery.type - value: single-node - - name: xpack.security.enabled - value: 'false' - - name: cluster.name - value: contextElasticSearch - - name: ES_JAVA_OPTS - value: -Xms512m -Xmx512m - - name: bootstrap.memory_lock - value: 'false' - volumeMounts: - - name: data - mountPath: /usr/share/elasticsearch/data - readinessProbe: - httpGet: - path: /_cluster/health - port: 9200 - initialDelaySeconds: 30 - periodSeconds: 10 - failureThreshold: 12 - resources: - requests: - cpu: 250m - memory: 1Gi - limits: - cpu: '1' - memory: 1536Mi - volumes: - - name: data - persistentVolumeClaim: - claimName: unomi-es-data - unomiEsData: - apiVersion: v1 - kind: PersistentVolumeClaim - metadata: - name: '{{KUBERO_APP_NAME}}-es-data' - spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 2Gi - storageClassName: fast - unomiEsService: - apiVersion: v1 - kind: Service - metadata: - name: '{{KUBERO_APP_NAME}}-es' - spec: - type: ClusterIP - selector: - app: unomi-es - ports: - - name: http - port: 9200 - targetPort: 9200 + # No add-ons: the former "Elasticsearch" entry was a Valkey add-on (which + # Unomi does not use) carrying an Elasticsearch Deployment, PVC and Service + # in its resourceDefinitions, plus a privileged sysctl init container. The + # server refuses both (#136); Elasticsearch is now the companion app below. + addons: [] envVars: + # The Elasticsearch companion app below. Sibling apps of a catalog group + # are reached as --kuberoapp on port 80. - name: UNOMI_ELASTICSEARCH_ADDRESSES - value: '{{KUBERO_APP_NAME}}-es:9200' + value: unomi-elasticsearch-{{KUBERO_NAME_SUFFIX}}-kuberoapp:80 - name: UNOMI_ELASTICSEARCH_CLUSTERNAME value: contextElasticSearch - name: UNOMI_CLUSTER_PUBLIC_ADDRESS @@ -219,3 +95,47 @@ spec: run: securityContext: readOnlyRootFilesystem: false + # Single-node Elasticsearch 9 for Unomi, as its own app. No privileged + # sysctl init container (not allowed): with discovery.type=single-node the + # bootstrap checks (vm.max_map_count among them) are not enforced, and + # mmap is turned off so the node's default max_map_count is enough. The + # chown init container is not needed either: app pods run with fsGroup + # 1000, the image's user. Settings use the image's ES_SETTING_* env form + # (a double underscore is a literal underscore). Heap is kept small for the + # default service size; raise ES_JAVA_OPTS together with the service size. + templateServices: + - id: elasticsearch + nameHint: unomi-elasticsearch + serviceType: web + exposeInternet: false + image: + repository: docker.io/library/elasticsearch + tag: 9.1.3 + containerPort: '9200' + envVars: + - name: ES_SETTING_DISCOVERY_TYPE + value: single-node + - name: ES_SETTING_XPACK_SECURITY_ENABLED + value: 'false' + - name: ES_SETTING_CLUSTER_NAME + value: contextElasticSearch + - name: ES_SETTING_NODE_STORE_ALLOW__MMAP + value: 'false' + - name: ES_SETTING_BOOTSTRAP_MEMORY__LOCK + value: 'false' + - name: ES_JAVA_OPTS + value: -Xms256m -Xmx256m + extraVolumes: + - accessModes: + - ReadWriteMany + emptyDir: false + mountPath: /usr/share/elasticsearch/data + name: '{{KUBERO_APP_NAME}}-es-data' + size: 2Gi + storageClass: shared + healthcheck: + enabled: true + path: /_cluster/health + startupSeconds: 600 + timeoutSeconds: 5 + periodSeconds: 10