|
| 1 | +# Copyright The Linux Foundation and each contributor to LFX. |
| 2 | +# SPDX-License-Identifier: MIT |
| 3 | +--- |
| 4 | +apiVersion: batch/v1 |
| 5 | +kind: Job |
| 6 | +metadata: |
| 7 | + name: meltano-el-postgres |
| 8 | + namespace: v1-sync-helper |
| 9 | + labels: |
| 10 | + app.kubernetes.io/name: lfx-v1-sync-helper |
| 11 | + app.kubernetes.io/component: meltano |
| 12 | +spec: |
| 13 | + ttlSecondsAfterFinished: 3600 # Clean up job after 1 hour |
| 14 | + backoffLimit: 3 |
| 15 | + template: |
| 16 | + metadata: |
| 17 | + labels: |
| 18 | + app.kubernetes.io/name: lfx-v1-sync-helper |
| 19 | + app.kubernetes.io/component: meltano |
| 20 | + spec: |
| 21 | + restartPolicy: Never |
| 22 | + containers: |
| 23 | + - name: meltano |
| 24 | + image: ghcr.io/linuxfoundation/lfx-v1-sync-helper/meltano:v0.4.0 |
| 25 | + imagePullPolicy: Always |
| 26 | + workingDir: /app/meltano |
| 27 | + args: |
| 28 | + - el |
| 29 | + # Catalog from mounted ConfigMap |
| 30 | + - "--catalog" |
| 31 | + - "/catalogs/tap-postgres/catalog.json" |
| 32 | + # State ID for this el job |
| 33 | + - "--state-id" |
| 34 | + - platform-db-incremental |
| 35 | + # Source |
| 36 | + - tap-postgres |
| 37 | + # Target |
| 38 | + - target-nats-kv |
| 39 | + env: |
| 40 | + # Environment (prod/staging/dev per meltano.yml "environments" list) |
| 41 | + - name: MELTANO_ENVIRONMENT |
| 42 | + value: "prod" |
| 43 | + # S3 state backend (prod/staging/dev suffix from OpenTofu workspace names) |
| 44 | + - name: MELTANO_STATE_BACKEND_URI |
| 45 | + value: "s3://lfx-v2-meltano-state-prod" |
| 46 | + # AWS configuration for DynamoDB access |
| 47 | + - name: AWS_DEFAULT_REGION |
| 48 | + value: "us-west-2" |
| 49 | + - name: AWS_REGION |
| 50 | + value: "us-west-2" |
| 51 | + # Postgres configuration |
| 52 | + - name: TAP_POSTGRES_HOST |
| 53 | + valueFrom: |
| 54 | + secretKeyRef: |
| 55 | + name: postgres-credentials-ad-hoc |
| 56 | + key: host |
| 57 | + optional: true |
| 58 | + - name: TAP_POSTGRES_PORT |
| 59 | + value: "5432" |
| 60 | + - name: TAP_POSTGRES_DATABASE |
| 61 | + value: "sfdc" |
| 62 | + - name: TAP_POSTGRES_USER |
| 63 | + valueFrom: |
| 64 | + secretKeyRef: |
| 65 | + name: postgres-credentials-ad-hoc |
| 66 | + key: username |
| 67 | + optional: true |
| 68 | + - name: TAP_POSTGRES_PASSWORD |
| 69 | + valueFrom: |
| 70 | + secretKeyRef: |
| 71 | + name: postgres-credentials-ad-hoc |
| 72 | + key: password |
| 73 | + optional: true |
| 74 | + # Target NATS KV configuration |
| 75 | + - name: TARGET_NATS_KV_URL |
| 76 | + value: "nats://lfx-platform-nats.lfx.svc.cluster.local:4222" |
| 77 | + - name: TARGET_NATS_KV_BUCKET |
| 78 | + value: "v1-objects" |
| 79 | + - name: TARGET_NATS_KV_REFRESH_MODE |
| 80 | + value: "newer" |
| 81 | + - name: TARGET_NATS_KV_VALIDATE_RECORDS |
| 82 | + # (true for PostgreSQL; false for DynamoDB) |
| 83 | + value: "true" |
| 84 | + - name: TARGET_NATS_KV_MSGPACK |
| 85 | + value: "true" |
| 86 | + resources: |
| 87 | + requests: |
| 88 | + memory: "512Mi" |
| 89 | + cpu: "250m" |
| 90 | + limits: |
| 91 | + memory: "2Gi" |
| 92 | + cpu: "1000m" |
| 93 | + # Health check - Meltano jobs don't typically have health endpoints |
| 94 | + # but we can check if the process is running |
| 95 | + livenessProbe: |
| 96 | + exec: |
| 97 | + command: ["pgrep", "-f", "meltano"] |
| 98 | + initialDelaySeconds: 30 |
| 99 | + periodSeconds: 60 |
| 100 | + failureThreshold: 3 |
| 101 | + volumeMounts: |
| 102 | + - name: tap-postgres-catalog |
| 103 | + mountPath: /catalogs/tap-postgres |
| 104 | + readOnly: true |
| 105 | + volumes: |
| 106 | + - name: tap-postgres-catalog |
| 107 | + configMap: |
| 108 | + name: tap-postgres-catalog |
| 109 | + # Use service account with appropriate permissions for AWS |
| 110 | + serviceAccountName: v1-sync-helper-sa |
0 commit comments