我最近从Kubernetes 1.2.0升级到Kubernetes 1.3.0,现在当我尝试开始工作时遇到以下错误:
$ kubectl create -f pijob.yaml
unable to recognize "pijob.yaml": batch/, Kind=Job matches multiple kinds [batch/v1, Kind=Job batch/v2alpha1, Kind=Job]
其中
pijob.yaml
是本教程中的职位定义:apiVersion: batch/v1
kind: Job
metadata:
name: pi
spec:
template:
metadata:
name: pi
spec:
containers:
- name: pi
image: perl
command: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]
restartPolicy: Never
该错误令人困惑,因为它表明
apiVersion: batch/v1, Kind: Job
应该有效。如果我尝试apiVersion: batch/v2alpha1, Kind: Job
,也会出现错误:$ kubectl create -f pijob.yaml
error validating "pijob.yaml": error validating data: couldn't find type: v2alpha1.Job
我究竟做错了什么?
最佳答案
您尝试过apiVersion: extensions/v1beta1
吗?
关于kubernetes - 创建Kubernetes作业的结果为 'batch/, Kind=Job matches multiple kinds',我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/40557173/