繁体   English   中英

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

[英]Unable to deploy the image in the kubernetes (AWS)

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

图像位于 docker hub 中,来自 aws,我使用了 docker login,也提供了凭据。

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

码头工人登录:

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

您可以使用以下方法检查哪些 apis 支持当前 Kubernetes 对象

$ kubectl api-resources | grep deployment
deployments                       deploy       apps                           true         Deployment

这意味着只有带有应用程序的 apiVersion 才适用于 kubernetes 1.16 版的部署(扩展不支持部署)。

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM