apiVersion: apps/v1
kind: Deployment
metadata:
  name: postiz-temporal-worker
  annotations:
  labels:
    app.kubernetes.io/component: worker
    app.kubernetes.io/name: temporal
    helm.sh/chart: temporal-1.2.0
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/instance: postiz
    app.kubernetes.io/version: "1.31.0"
    app.kubernetes.io/part-of: temporal
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: temporal
      app.kubernetes.io/instance: postiz
      app.kubernetes.io/component: worker
  template:
    metadata:
      annotations:
        checksum/config: 0c87edbe543cc8ef1a5462ddd0ed99fe918cf9e82248009f1bfd7616d667dc19
        prometheus.io/job: temporal-worker
        prometheus.io/scrape: 'true'
        prometheus.io/scheme: http
        prometheus.io/port: '9090'
      labels:
        app.kubernetes.io/component: worker
        app.kubernetes.io/name: temporal
        helm.sh/chart: temporal-1.2.0
        app.kubernetes.io/managed-by: Helm
        app.kubernetes.io/instance: postiz
        app.kubernetes.io/version: "1.31.0"
        app.kubernetes.io/part-of: temporal
    spec:
      serviceAccountName: default
      securityContext:
        fsGroup: 1000
        runAsUser: 1000
      containers:
        - name: temporal-worker
          image: "temporalio/server:1.31.0@sha256:b021b3b58c3f169634cdbb0451fcc0e69e8190b40454323362c7c52bbd4ff7b9"
          imagePullPolicy: IfNotPresent
          env:
            - name: POD_IP
              valueFrom:
                fieldRef:
                  fieldPath: status.podIP
            - name: SERVICES
              value: worker
            - name: TEMPORAL_SERVICES
              value: worker
            - name: TEMPORAL_SERVER_CONFIG_FILE_PATH
              value: /etc/temporal/config/config_template.yaml
            - name: TEMPORAL_DEFAULT_STORE_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: postiz-postgresql-18-cluster-superuser
                  key: password
            - name: TEMPORAL_VISIBILITY_STORE_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: postiz-postgresql-18-cluster-superuser
                  key: password
          ports:
            - name: membership
              containerPort: 6939
              protocol: TCP
            - name: metrics
              containerPort: 9090
              protocol: TCP
          volumeMounts:
            - name: config
              mountPath: /etc/temporal/config/config_template.yaml
              subPath: config_template.yaml
            - name: dynamic-config
              mountPath: /etc/temporal/dynamic_config
            - name: shims
              mountPath: /usr/local/bin/dockerize
              subPath: dockerize
          resources:
            requests:
              cpu: 10m
              memory: 50Mi
      volumes:
        - name: shims
          configMap:
            name: "postiz-temporal-shims"
            defaultMode: 0555
        - name: config
          configMap:
            name: "postiz-temporal-config"
        - name: dynamic-config
          configMap:
            name: "postiz-temporal-dynamic-config"
            items:
              - key: dynamic_config.yaml
                path: dynamic_config.yaml
      terminationGracePeriodSeconds:
