apiVersion: batch/v1
kind: CronJob
metadata:
  name: billing-cronjob
  namespace: pchub
spec:
  successfulJobsHistoryLimit: 1
  failedJobsHistoryLimit: 1
  schedule: "0 */2 * * *"
  concurrencyPolicy: Forbid
  jobTemplate:
    spec:
      template:
        spec:
          containers:
            - name: billing-container
              image: alpine:latest
              command: [ "/bin/sh", "-c" ]
              args:
                - apk update && apk add curl && curl -X POST -s http://pchub-service.pchub.svc.cluster.local:8867/v1/cron/billing
              resources:
                requests:
                  cpu: 50m
                  memory: 50Mi
                limits:
                  cpu: 100m
                  memory: 100Mi
          restartPolicy: OnFailure
---

apiVersion: batch/v1
kind: CronJob
metadata:
  name: dept-cronjob
  namespace: pchub
spec:
  successfulJobsHistoryLimit: 1
  failedJobsHistoryLimit: 1
  schedule: "0 */6 * * *"
  concurrencyPolicy: Forbid
  jobTemplate:
    spec:
      template:
        spec:
          containers:
            - name: dept-container
              image: alpine:latest
              command: [ "/bin/sh", "-c" ]
              args:
                - apk update && apk add curl && curl -X POST -s http://pchub-service.pchub.svc.cluster.local:8867/v1/cron/dept
              resources:
                requests:
                  cpu: 50m
                  memory: 50Mi
                limits:
                  cpu: 100m
                  memory: 100Mi
          restartPolicy: OnFailure
---
apiVersion: batch/v1
kind: CronJob
metadata:
  name: user-cronjob
  namespace: pchub
spec:
  successfulJobsHistoryLimit: 1
  failedJobsHistoryLimit: 1
  schedule: "0 */12 * * *"
  concurrencyPolicy: Forbid
  jobTemplate:
    spec:
      template:
        spec:
          containers:
            - name: user-container
              image: alpine:latest
              command: [ "/bin/sh", "-c" ]
              args:
                - apk update && apk add curl && curl -X POST -s http://pchub-service.pchub.svc.cluster.local:8867/v1/cron/user
              resources:
                requests:
                  cpu: 50m
                  memory: 50Mi
                limits:
                  cpu: 100m
                  memory: 100Mi
          restartPolicy: OnFailure
---
apiVersion: batch/v1
kind: CronJob
metadata:
  name: cm-cronjob
  namespace: pchub
spec:
  successfulJobsHistoryLimit: 1
  failedJobsHistoryLimit: 1
  schedule: "0 */12 * * *"
  concurrencyPolicy: Forbid
  jobTemplate:
    spec:
      template:
        spec:
          containers:
            - name: cm-container
              image: alpine:latest
              command: [ "/bin/sh", "-c" ]
              args:
                - apk update && apk add curl && curl -X POST -s http://pchub-service.pchub.svc.cluster.local:8867/v1/cron/cm
              resources:
                requests:
                  cpu: 50m
                  memory: 50Mi
                limits:
                  cpu: 100m
                  memory: 100Mi
          restartPolicy: OnFailure
---
apiVersion: batch/v1
kind: CronJob
metadata:
  name: larkchat-cronjob
  namespace: pchub
spec:
  successfulJobsHistoryLimit: 1
  failedJobsHistoryLimit: 1
  schedule: "0 */1 * * *"
  concurrencyPolicy: Forbid
  jobTemplate:
    spec:
      template:
        spec:
          containers:
            - name: larkchat-container
              image: alpine:latest
              command: [ "/bin/sh", "-c" ]
              args:
                - apk update && apk add curl && curl -X POST -s http://pchub-service.pchub.svc.cluster.local:8867/v1/cron/chat
              resources:
                requests:
                  cpu: 50m
                  memory: 50Mi
                limits:
                  cpu: 100m
                  memory: 100Mi
          restartPolicy: OnFailure
