[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

相关文章:

  • 2021-11-22
  • 2021-12-09
  • 2022-12-23
  • 2022-12-23
  • 2021-07-22
  • 2018-04-09
  • 2018-04-13
  • 2021-06-15
猜你喜欢
  • 2022-12-23
  • 2021-07-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案