k8s创建Deployment报错:no matches for kind “Deployment“ in version “extensions/v1beta1“

报错类型:

[root@master ~]# kubectl create -f lzb-test.yaml 
error: unable to recognize "lzb-test.yaml": no matches for kind "Deployment" in version "extensions/v1beta1"

解决:

修改yaml文件:

---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:

修改如下:

---
apiVersion: apps/v1
kind: Deployment

这个主要是由于版本升级的原因

我的 k8s 版本是 1.18.5

在这个版本中 Deployment 已经启用extensions/v1beta1 

DaemonSet, Deployment, StatefulSet, and ReplicaSet resources will no longer be served from extensions/v1beta1, apps/v1beta1, or apps/v1beta2 by default in v1.16.

 

你可能感兴趣的:(KubeSphere)