apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: agent-opera
spec:
  schedule: "*/5 * * * *"
  concurrencyPolicy: Forbid
  jobTemplate:
    spec:
      activeDeadlineSeconds: 600
      backoffLimit: 1
      template:
        spec:
          restartPolicy: Never
          imagePullSecrets:
          - name: pipeline-docker-registry
          containers:
          - name: agent-opera
            image: ${CICD_IMAGE}:${CICD_EXECUTION_SEQUENCE}-${CICD_GIT_COMMIT}
            env:
              - name: API_URL
                valueFrom:
                  secretKeyRef:
                    name: agent-opera
                    key: API_URL
              - name: API_KEY
                valueFrom:
                  secretKeyRef:
                    name: agent-opera
                    key: API_KEY
              - name: SSH_HOST
                valueFrom:
                  secretKeyRef:
                    name: agent-opera
                    key: SSH_HOST
              - name: SSH_USER
                valueFrom:
                  secretKeyRef:
                    name: agent-opera
                    key: SSH_USER
              - name: SSH_PASSWORD
                valueFrom:
                  secretKeyRef:
                    name: agent-opera
                    key: SSH_PASSWORD
              - name: ENABLED
                valueFrom:
                  secretKeyRef:
                    name: agent-opera
                    key: ENABLED
              - name: AINO_API_KEY
                valueFrom:
                  secretKeyRef:
                    name: agent-opera
                    key: AINO_API_KEY
