apiVersion: flink.apache.org/v1beta1
kind: FlinkDeployment
metadata:
  name: trading-flink
  namespace: default
  labels:
    app: flink
spec:
  podTemplate:
    metadata:
      annotations:
        prometheus.io/scrape: "true"
        prometheus.io/port: "9249"
        prometheus.io/path: "/metrics"
  image: dexorder/ai-flink:latest
  imagePullPolicy: Always
  flinkVersion: v1_19
  flinkConfiguration:
    taskmanager.numberOfTaskSlots: "2"
    state.backend: filesystem
    state.checkpoints.dir: file:///flink-data/checkpoints
    state.savepoints.dir: file:///flink-data/savepoints
    execution.checkpointing.interval: 60s
    metrics.reporter.prom.factory.class: org.apache.flink.metrics.prometheus.PrometheusReporterFactory
    metrics.reporter.prom.port: "9249"
  serviceAccount: flink
  jobManager:
    resource:
      memory: "1024Mi"
      cpu: 0.5
    replicas: 1
  taskManager:
    resource:
      memory: "1024Mi"
      cpu: 0.5
    replicas: 1
  job:
    jarURI: local:///opt/flink/usrlib/trading-flink.jar
    entryClass: com.dexorder.flink.TradingFlinkApp
    parallelism: 1
    upgradeMode: stateless
    state: running
