Last active
October 24, 2017 07:21
-
-
Save looztra/d88052abbff09d88dd86b30977fda304 to your computer and use it in GitHub Desktop.
cronjobs and api batch/v2alpha1 and minikube
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
apiVersion: batch/v2alpha1 | |
kind: CronJob | |
metadata: | |
name: hello | |
spec: | |
schedule: "*/1 * * * *" | |
jobTemplate: | |
spec: | |
template: | |
spec: | |
containers: | |
- name: hello | |
image: busybox | |
args: | |
- /bin/sh | |
- -c | |
- date; echo Hello from the Kubernetes cluster | |
restartPolicy: OnFailure |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> kubectl apply -f cron--hello-from-k8s-cluster.yml | |
error: error validating "cron--hello-from-k8s-cluster": error validating data: unknown object type schema.GroupVersionKind{Group:"batch", Version:"v2alpha1", Kind:"CronJob"}; if you choose to ignore these errors, turn validation off with --validate=false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> kubectl api-versions | |
admissionregistration.k8s.io/v1alpha1 | |
apiextensions.k8s.io/v1beta1 | |
apiregistration.k8s.io/v1beta1 | |
apps/v1beta1 | |
authentication.k8s.io/v1 | |
authentication.k8s.io/v1beta1 | |
authorization.k8s.io/v1 | |
authorization.k8s.io/v1beta1 | |
autoscaling/v1 | |
autoscaling/v2alpha1 | |
batch/v1 | |
batch/v2alpha1 | |
certificates.k8s.io/v1beta1 | |
extensions/v1beta1 | |
networking.k8s.io/v1 | |
policy/v1beta1 | |
rbac.authorization.k8s.io/v1alpha1 | |
rbac.authorization.k8s.io/v1beta1 | |
settings.k8s.io/v1alpha1 | |
storage.k8s.io/v1 | |
storage.k8s.io/v1beta1 | |
v1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
└> kubectl apply -f cron--hello-from-k8s-cluster.yml --validate=false | |
cronjob "hello" created | |
┌cfurmaniak@fedolooz ~/w/Z/f/Exercices | |
└> kubectl get cronjob | |
NAME SCHEDULE SUSPEND ACTIVE LAST SCHEDULE AGE | |
hello */1 * * * * False 0 <none> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
└> minikube version | |
minikube version: v0.22.3 | |
┌cfurmaniak@fedolooz ~/w/Z/f/Exercices | |
└> kubectl version | |
Client Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.0", GitCommit:"6e937839ac04a38cac63e6a7a306c5d035fe7b0a", GitTreeState:"clean", BuildDate:"2017-09-28T22:57:57Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"} | |
Server Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.5", GitCommit:"17d7182a7ccbb167074be7a87f0a68bd00d58d97", GitTreeState:"clean", BuildDate:"2017-10-06T20:53:14Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@looztra oh, thank you so much for this --validate=false switch.