Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

183
Vistas
Issues creating a cron job that runs a PostgreSQL stored procedure on a schedule in Openshift

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?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

The problem you face at the moment has to do with trying to pull the container image from Docker Hub. This has to be changed to pulling from Openshift Registry:

apiVersion: batch/v1
kind: Job
metadata:
  name: pgschedulertest
spec:
  template:
    spec:
      containers:
        - name: ps-container
          image: registry.redhat.io/openshift4/ose-cli
          command: ["oc",  "exec", "postgresql-2-bl4gr", "psql --help"]
      restartPolicy: Never

Once fixed, you will run into RBAC issues, which will have to get rectified by giving more permissions to the Service Account this job runs under.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda