簡體   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