我关注this tutorial。
我的目标是使用自定义容器而不是hello容器创建部署。
我做了my-custom-server-deployment.yaml
:
apiVersion: v1
kind: Deployment
metadata:
name: my-custom-server-deployment
spec:
replicas: 2
template:
metadata:
labels:
app: my-custom
tier: backend
spec:
containers:
- name: my-custom-server
image: my-custom-server
ports:
containerPort: 3000
我尝试使用kubectl create -f my-custom-server-deployment.yaml
构建它并获得:
error: error validating "my-custom-server-deployment.yaml": error validating data: couldn't find type: v1.Deployment; if you choose to ignore these errors, turn validation off with --vali
date=false
当我添加--validate=false
时,我得到:
no matches for /, Kind=Deployment
我觉得这很直接。我究竟做错了什么?
答案 0 :(得分:11)
请尝试使用apiVersion: apps/v1beta1
。我相信Deployments仍然是测试版功能。