Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

184
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda