0

I am very new with working on OCP . I have a task to schedule a curl statement via crontab but I'm unable to figure out where to pass the curl statement.

Not sure how to even start. I looked up some examples but do not see anything that matches my requirement

1 Answers1

0

OCP is based on Kubernetes. In Kubernetes you have the CronJob resource, which seems to be what you're looking for for your resource and allows you to run a job on a specific schedule.

As you need to use curl, you can use the curlimage/curl image, which has the curl binary included:

apiVersion: batch/v1
kind: CronJob
metadata:
  name: my-curl-job
spec:
  schedule: "* * * * *"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: curl-job
            image: curlimages/curl
            imagePullPolicy: IfNotPresent
            args:
            - "http://your.url.you.want.to.curl"
          restartPolicy: Never
chresse
  • 5,486
  • 3
  • 30
  • 47