我有一个具有以下版本的 Kubernetes 集群:
$ 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
我的 Kubernetes 集群中有一个 cron 作业。
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: abc-cronjob
namespace: abc-namespace
...
Kubernetes 集群识别 cron 作业的 api 资源。
$ kubernetes -n abc-namespace api-resources
NAME SHORTNAMES APIVERSION NAMESPACED KIND
...
cronjobs cj batch/v1beta1 true CronJob
...
我正在尝试为此创建手动作业,但面临此错误。
$ kubernetes -n abc-namespace create job abc-job --from=cronjob/abc-cronjob
error: unknown object type *v1beta1.CronJob
有人可以帮忙吗?