Amazon web services 无法在kubernetes(AWS)中部署映像

Amazon web services 无法在kubernetes(AWS)中部署映像,amazon-web-services,kubernetes,Amazon Web Services,Kubernetes,我被困在最后一刻,无法找出错误,一切正常,但在集群上部署映像时出现错误: 该图像位于docker hub中,来自aws,我使用docker登录,并提供了凭证 sudo kops validate cluster --state=s3://kops-storage-54321 -o yaml 输出: Using cluster from kubectl context: tests.k8s.local nodes: - hostname: ip-172-20-40-124.us-east-2.

我被困在最后一刻,无法找出错误,一切正常,但在集群上部署映像时出现错误:

该图像位于docker hub中,来自aws,我使用docker登录,并提供了凭证

sudo kops validate cluster --state=s3://kops-storage-54321 -o yaml
输出:

Using cluster from kubectl context: tests.k8s.local

nodes:
- hostname: ip-172-20-40-124.us-east-2.compute.internal
  name: ip-172-20-40-124.us-east-2.compute.internal
  role: master
  status: "True"
  zone: us-east-2a
- hostname: ip-172-20-112-165.us-east-2.compute.internal
  name: ip-172-20-112-165.us-east-2.compute.internal
  role: node
  status: "True"
  zone: us-east-2c
- hostname: ip-172-20-60-168.us-east-2.compute.internal
  name: ip-172-20-60-168.us-east-2.compute.internal
  role: node
  status: "True"
  zone: us-east-2a
Docker登录:

sudo docker login

Authenticating with existing credentials...
WARNING! Your password will be stored unencrypted in /home/ubuntu/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded
部署映像时出错:

命令:

ubuntu@ip-172-31-30-176:~$  sudo kubectl create deployment magicalnginx --image=amitranjan007/magicalnginx
错误:

error: no matches for extensions/, Kind=Deployment

您可以使用以下命令检查哪些API支持当前Kubernetes对象

$ kubectl api-resources | grep deployment
deployments                       deploy       apps                           true         Deployment
这意味着kubernetes版本1.16中的部署(扩展不支持部署)只有带应用程序的apiVersion是正确的


在部署yaml中将apiVersion更改为apps/v1。

sudo kubectl api resources | grep部署错误:未知命令“api resources”用于“kubectl”kubectl Version客户端版本的输出是什么:Version.Info{Major:“1”,Minor:“9”,GitVersion:“v1.9.0”,GitCommit:“925c127ec6b946659ad0fd596fa959be43f0cc05”,GitRestate:“干净”,构建日期:“2017-12-15T21:07:38Z”,政府版本:“go1.9.2”,编译器:“gc”,平台:“linux/amd64”}服务器版本:Version.Info{Major:“1”,Minor:“16”,GitVersion:“v1.16.7”,GitCommit:“be3d344ed06bff7a4fc60656200a93c74f31f9a4”,GitRestate:“干净”,构建日期:“2020-02-11T19:24:46Z”,政府版本:“go1.13.6”,编译器:“gc”,平台:“linux/amd64”}kubectl客户端太旧。请升级更新:客户端版本:Version.Info{Major:“1”,Minor:“17”,GitVersion:“v1.17.0”,GitCommit:“70132b0f130acc0bed193d9ba59dd186f0e634cf”,GitRestate:“clean”,BuildDate:“2019-12-07T21:20:10Z”,政府版本:“go1.13.4”,编译器:“gc”,平台:“linux/amd64”}