Kubernetes(GKE) cronjob not working

0 votes

I'm trying to run a simple cron job

This is my yaml file

apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: node-timer-analytics-parser-cronjob
spec:
  schedule: "0 * * * *"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: node-timer-analytics-parser-cronjob
            image: round0.azurecr.io/node-timer-analytics-parser:latest
            args:
            - /bin/sh
            - -c
            - date; npm start
          restartPolicy: OnFailure
          imagePullSecrets:
            - name: regsecret
$ kubectl get cronjob
NAME                                     KIND
node-timer-analytics-parser-controller   CronJob.v1beta1.batch

NAME                                     KIND
node-timer-analytics-parser-controller   CronJob.v1beta1.batch

What's the issue here?

Sep 19, 2018 in Kubernetes by lina
• 8,100 points

edited Sep 19, 2018 by lina 435 views

2 answers to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

Hello @lina, 

I think the problem is with your version. You can check your version using kubectl version 

If you are running < 1.8 then you will need to enable cron jobs

gcloud alpha container clusters create my-cluster --enable-kubernetes-alpha
answered Sep 19, 2018 by Kalgi
• 36,920 points
0 votes
Adding to @Kalgi's answer I think you might have to upgrade your version.

And i've noticed that you're working with azure, you might wanna start with something simple.
answered Sep 19, 2018 by Nilesh
• 6,900 points

Related Questions In Kubernetes

+1 vote
1 answer

--image-pull-policy not working in kubernetes

Kubernetes does not automatically update the pods ...READ MORE

answered Dec 6, 2018 in Kubernetes by DareDev
• 6,710 points
454 views
0 votes
1 answer

External IP not working with Minikube Kubernetes

You can use an ingress controller on ...READ MORE

answered Jan 24 in Kubernetes by DareDev
• 6,710 points
204 views
0 votes
1 answer

Pod not sharing directory - Kubernetes volume Hostpath

he issue was on the volume definition, ...READ MORE

answered Aug 28, 2018 in Kubernetes by Kalgi
• 36,920 points
167 views
0 votes
1 answer

Not able to access kubernetes api from a pod in azure

Follow these steps Add --bind-address=0.0.0.0 option to the line https://github.com/kubernetes/kubernetes/blob/v1.2.0/docs/getting-started-guides/coreos/azure/cloud_config_templates/kubernetes-cluster-main-nodes-template.yml#L218  Created ...READ MORE

answered Aug 30, 2018 in Kubernetes by Kalgi
• 36,920 points
33 views
0 votes
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17 in Others by anonymous
820 views
+3 votes
1 answer
0 votes
2 answers

kubernetes: AWS ELB not working

Set your service to loadbalancer apiVersion: v1 kind: Service metadata: ...READ MORE

answered Oct 9, 2018 in Kubernetes by Nilesh
• 6,900 points
121 views
0 votes
1 answer

Traefik: Forward Authentication not working

Look at the 7th line of your ...READ MORE

answered Aug 27, 2018 in Kubernetes by Kalgi
• 36,920 points
894 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.