I have a Kubernetes cluster with following versions:
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.1", GitCommit:"632ed300f2c34f6d6d15ca4cef3d3c7073412212", GitTreeState:"clean", BuildDate:"2021-08-19T15:38:26Z", GoVersion:"go1.16.6", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.13", GitCommit:"aac5f64a5218b0b1d0138a57d273a12db99390c9", GitTreeState:"clean", BuildDate:"2021-01-18T07:43:30Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}
WARNING: version difference between client (1.22) and server (1.16) exceeds the supported minor version skew of +/-1
I have a CronJob in my Kubernetes cluster.
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: abc-cronjob
namespace: abc-namespace
...
The Kubernetes cluster recognizes the api resource for the cron job.
$ kubectl -n abc-namespace api-resources
NAME SHORTNAMES APIVERSION NAMESPACED KIND
...
cronjobs cj batch/v1beta1 true CronJob
...
I am trying to create a manual job for this, but I am facing this error:
$ kubectl -n abc-namespace create job abc-job --from=cronjob/abc-cronjob
error: unknown object type *v1beta1.CronJob
Can anyone help in this?