I setup local environment with Vagrant by following this CoreOS's way and currently a version of k8s is 1.4.0.
Now I want to try ScheduledJob which is introduced from 1.4.0 as an alpha resource. I first added a flag - --runtime-config=batch/v2alpha1=true
in a kube-apiserver.yaml
, then api-server is restarted.
Then I called kubectl run hello --schedule="0/1 * * * ?" --restart=OnFailure --image=busybox -- /bin/sh -c "date; echo Hello from the Kubernetes cluster"
by following the example here.
The scheduled job was successfully created.
kubectl get scheduledjob
NAME SCHEDULE SUSPEND ACTIVE LAST-SCHEDULE
hello 0/1 * * * ? False 0 <none>
But after that, no jobs are created no matter how long I'd waited.
kubectl get jobs --watch
NAME DESIRED SUCCESSFUL AGE
Is there something I have to add in my configuration?
kubectl describe scheduledjobs
returns a following info:
Name: hello
Namespace: default
Schedule: 0/1 * * * ?
Concurrency Policy: Allow
Suspend: False
Starting Deadline Seconds: <unset>
Image(s): busybox
Selector: <unset>
Parallelism: <unset>
Completions: <unset>
No volumes.
Labels: run=hello
Last Schedule Time: <unset>
Active Jobs: <none>
No events.%
I noticed the same problem with Kubernetes version: 1.4.3 FYI: I have raised on their github issues: https://github.com/kubernetes/kubernetes/issues/35508
However scheduledjob working fine for me with kubernetes version: 1.4.4