# services/logging/data-prepper-helmrelease.yaml
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
  name: data-prepper
  namespace: logging
spec:
  interval: 15m
  timeout: 10m
  install:
    disableWait: true
  upgrade:
    disableWait: true
  postRenderers:
    - kustomize:
        patches:
          - target:
              kind: Deployment
              name: data-prepper
            patch: |
              - op: add
                path: /spec/template/spec/containers/0/startupProbe
                value:
                  httpGet:
                    path: /list
                    port: server
                  periodSeconds: 10
                  timeoutSeconds: 2
                  failureThreshold: 30
              - op: replace
                path: /spec/template/spec/containers/0/livenessProbe/initialDelaySeconds
                value: 60
              - op: replace
                path: /spec/template/spec/containers/0/livenessProbe/timeoutSeconds
                value: 2
              - op: replace
                path: /spec/template/spec/containers/0/livenessProbe/failureThreshold
                value: 6
              - op: replace
                path: /spec/template/spec/containers/0/readinessProbe/initialDelaySeconds
                value: 10
              - op: replace
                path: /spec/template/spec/containers/0/readinessProbe/timeoutSeconds
                value: 2
              - op: replace
                path: /spec/template/spec/containers/0/readinessProbe/failureThreshold
                value: 12
  chart:
    spec:
      chart: data-prepper
      version: "~0.3.1"
      sourceRef:
        kind: HelmRepository
        name: opensearch
        namespace: flux-system
  values:
    fullnameOverride: data-prepper
    replicaCount: 1
    image:
      repository: registry.bstein.dev/streaming/data-prepper
      tag: "2.8.0-bc"
    imagePullSecrets:
      - name: harbor-regcred
    config:
      data-prepper-config.yaml: |
        ssl: false
    pipelineConfig:
      demoPipeline: false
      enabled: false
      existingSecret: data-prepper-pipeline
    resources:
      requests:
        cpu: "200m"
        memory: "512Mi"
      limits:
        memory: "1Gi"
    affinity:
      nodeAffinity:
        requiredDuringSchedulingIgnoredDuringExecution:
          nodeSelectorTerms:
            - matchExpressions:
                - key: jetson
                  operator: In
                  values:
                    - "true"
            - matchExpressions:
                - key: hardware
                  operator: In
                  values:
                    - rpi5
        preferredDuringSchedulingIgnoredDuringExecution:
          - weight: 100
            preference:
              matchExpressions:
                - key: jetson
                  operator: In
                  values:
                    - "true"
