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,220 points

edited Sep 19, 2018 by lina 2,534 views

2 answers to this question.

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
• 52,360 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
• 7,060 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,890 points
5,201 views
0 votes
1 answer

External IP not working with Minikube Kubernetes

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

answered Jan 24, 2019 in Kubernetes by DareDev
• 6,890 points
2,592 views
+2 votes
1 answer
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
• 52,360 points
2,212 views
+1 vote
1 answer
0 votes
3 answers

Error while joining cluster with node

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

answered Jan 17, 2019 in Others by anonymous
15,303 views
+4 votes
1 answer

Installing Web UI (Dashboard):kubernetes-dashboard on main Ubuntu 16.04.6 LTS (Xenial Xerus) server

Follow these steps: $ kubeadm reset $ kubeadm init ...READ MORE

answered Apr 12, 2019 in Kubernetes by Kalgi
• 52,360 points

reshown Apr 12, 2019 by Kalgi 6,926 views
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
• 7,060 points
1,004 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
• 52,360 points
4,036 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP