apiVersion: apps/v1
kind: Deployment
metadata:
  name: extractor-worker
  namespace: stonks-oracle
  labels:
    app: extractor-worker
    app.kubernetes.io/part-of: stonks-oracle
    stonks-oracle/tier: processing
spec:
  replicas: 1
  selector:
    matchLabels:
      app: extractor-worker
  template:
    metadata:
      labels:
        app: extractor-worker
        stonks-oracle/tier: processing
    spec:
      automountServiceAccountToken: false
      securityContext:
        runAsNonRoot: true
        runAsUser: 1000
        runAsGroup: 1000
        fsGroup: 1000
        seccompProfile:
          type: RuntimeDefault
      containers:
        - name: extractor-worker
          image: ghcr.io/celesrenata/stonks-oracle/extractor:latest
          imagePullPolicy: Always
          securityContext:
            allowPrivilegeEscalation: false
            readOnlyRootFilesystem: true
            capabilities:
              drop: ["ALL"]
          envFrom:
            - configMapRef:
                name: stonks-config
            - secretRef:
                name: stonks-core-secrets
          resources:
            requests:
              cpu: 200m
              memory: 256Mi
            limits:
              cpu: "1"
              memory: 512Mi
          volumeMounts:
            - name: tmp
              mountPath: /tmp
      volumes:
        - name: tmp
          emptyDir:
            sizeLimit: 10Mi
