apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: url-producer
  labels:
    app: url-producer
spec:
  concurrencyPolicy: Forbid
  schedule: "0 1 1 * *"
  jobTemplate:
    metadata:
      labels:
        app: url-producer
    spec:
      template:
        spec:
          restartPolicy: OnFailure
          imagePullSecrets:
            - name: ghcr
          containers:
            - name: url-producer
              image: busybox
              command:
                - /app/servicebin
              livenessProbe:
                httpGet:
                  path: /healthz
                  port: 80
              readinessProbe:
                httpGet:
                  path: /healthz
                  port: 80
              resources:
                requests:
                  cpu: 100m
                  memory: 1400Mi
                limits:
                  cpu: "1"
                  memory: 2Gi
              env:
                - name: STAN_CLUSTERID
                  valueFrom:
                    configMapKeyRef:
                      key: clusterid
                      name: stan
                - name: NATS_URL
                  valueFrom:
                    configMapKeyRef:
                      key: url
                      name: nats
                - name: MONGODB_URL
                  valueFrom:
                    configMapKeyRef:
                      key: url
                      name: mongodb
                - name: DOMAINSFILE_URL
                  valueFrom:
                    configMapKeyRef:
                      key: url
                      name: domainsfile
                - name: DOMAINSFILE_URLSU
                  valueFrom:
                    configMapKeyRef:
                      key: urlsu
                      name: domainsfile
                - name: DOMAINSFILE_URLRF
                  valueFrom:
                    configMapKeyRef:
                      key: urlrf
                      name: domainsfile
                - name: LOGLEVEL
                  value: error
