no matches for kind "Deployment" in version "extensions/v1beta1"

Posted nnylee

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了no matches for kind "Deployment" in version "extensions/v1beta1"相关的知识,希望对你有一定的参考价值。

0x00 Problem

[root@k8sm90 demo]# kubectl create -f tomcat-deployment.yaml
error: unable to recognize "tomcat-deployment.yaml": no matches for kind "Deployment" in version "extensions/v1beta1"

0x01 Solution

修改 apiVersion 选项: apps/v1

[root@k8sm90 demo]# cat tomcat-deployment.yaml
apiVersion: apps/v1
kind: Deployment
...

因为我的 k8s 版本是 1.16.2,在这个版本中 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.

参考:https://github.com/Azure/AKS/issues/1205

以上是关于no matches for kind "Deployment" in version "extensions/v1beta1"的主要内容,如果未能解决你的问题,请参考以下文章

k8s v1.22版本中Ingress配置:no matches for kind “Ingress“ in version “networking.k8s.io/v1beta1“

Boost::Variant "Error: no match for call to [...]" 访问者操作符重载

C++ string.replace 生成“No matching function for call”错误

error: no matching function for call to 'QTime::toString(const char [13]) 利用LCDNumber显示时间

大神指点: No matching bean of type [****.UserInfoService] found for dependency:

[Python] 安装pyperclip报错: No matching distribution found for pyperclip