I am new to openshift and i am having issues/errors when creating a Cron job that will run a stored procedure.
I thought the easiest way for me to run this would be to use the OpenShift CLI in a cron job which would just navigate to the pod, connect to the Database and then run the stored procedure. I am not sure if this is even the best\correct approach.
My code for testing CLI:
apiVersion: batch/v1
kind: CronJob
metadata:
name: pgschedulertest
spec:
schedule: "*/20 * * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: ps-container
image: openshift4/ose-cli
command: ["oc", "exec", "postgresql-2-bl4gr", "psql --help"]
restartPolicy: Never
It errors and states "Image Pull Back-off". I had a brief read online and I can't figure out how to use the open shift UI to access this open shift CLI/Find out if the image or what images even exist. Alternatively, if there is a better way to schedule PostgresSql stored procedures in Openshift i would love to know?