简体   繁体   English

在创建 Kubernetes pod 时在 EC2 实例上获取 ImagePullBackOff

[英]Getting ImagePullBackOff on EC2 instance while creating Kubernetes pods

I have deployed simple react app on kubernetes through docker-desktop successfully.我已经通过 docker-desktop 在 kubernetes 上成功部署了简单的反应应用程序。 It was having only one master there.那里只有一位主人。 Now I am doing the same thing on AWS Ubuntu EC2 Instance, its having one master and two slave nodes, all are connected properly.现在我在 AWS Ubuntu EC2 实例上做同样的事情,它有一个主节点和两个从节点,都连接正确。 Also a demo Nginx server is already deployed successfully on my master EC2 instance.此外,演示 Nginx 服务器已经成功部署在我的主 EC2 实例上。

I am getting ImagePullBackOff status on React deployment/service.我在 React 部署/服务上获得 ImagePullBackOff 状态。 Is there any configuration I have to make in EC2 to make it work.我必须在 EC2 中进行任何配置才能使其工作。 How can I debug the things and what could be the reasons for same.我该如何调试这些东西,以及可能是什么原因。

I have followed these guides and you can assume my deployment and service.yml file to be same as provided in these links.我已遵循这些指南,您可以假设我的部署和 service.yml 文件与这些链接中提供的相同。

https://dev.to/rieckpil/deploy-a-react-application-to-kubernetes-in-5-easy-steps-516j https://dev.to/rieckpil/deploy-a-react-application-to-kubernetes-in-5-easy-steps-516j

https://stackoverflow.com/a/37306838/9465933 https://stackoverflow.com/a/37306838/9465933

I am pushing the pods to local docker registry.我正在将 pod 推送到本地 docker 注册表。 Is there any docker secret config's are required for this?是否需要任何 docker 秘密配置? Any help will be highly appreciated.任何帮助将不胜感激。

If you expand on the logs with kubectl describe , you will probably notice that the error is that Kubernetes cannot fetch the image from the registry.如果您使用kubectl describe扩展日志,您可能会注意到错误是 Kubernetes 无法从注册表中获取图像。

This is due to two things:这是由于两件事:

  1. You need to create a secret to access your registry.您需要创建一个秘密来访问您的注册表。 https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/

  2. You said to have a local registry.你说有一个本地注册表。 Is it publicly reachable?是否可以公开访问? Notice that the EC2 instances need to be able to access it.请注意,EC2 实例需要能够访问它。 So check port-forwarding, firewall configuration, etc in your LAN.因此,请检查 LAN 中的端口转发、防火墙配置等。

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

相关问题 无法与使用 kubernetes 在 AWS EC2 实例中本地创建的 Pod 通信 - Not able to communicate with Pods locally created in AWS EC2 instance with kubernetes EC2 实例上的资源标记,在创建堆栈时收到错误“在标签属性中找不到密钥” - Resource Tagging on EC2 instance, getting an error "Key not found in Tags properties" while creating stack 为什么我在使用 Ansible playbook 创建 EC2 实例时收到“当前不支持请求的配置”? - Why am I getting "The requested configuration is currently not supported" while creating EC2 instance using Ansible playbook? 创建时未向 EC2 实例分配公有 IP 时,EC2 实例未向 ECS 注册 - EC2 instance not registering with ECS when no public IP is assigned to the EC2 instance while creating 创建EC2实例时是否可以设置标签? - Is there a way to set a tag on an EC2 instance while creating it? 在创建AWS EC2实例时获取提供的高级详细信息 - Get Advance Details provided while creating AWS EC2 instance Terraform 在创建 EC2 实例时显示“InvalidGroup.NotFound” - Terraform shows `InvalidGroup.NotFound` while creating an EC2 instance 使用 Ansible 创建 Aws ec2 实例时出错 - Error while creating Aws ec2 instance using Ansible 创建boto3 ec2实例错误时附加角色 - Attaching role while creating boto3 ec2 Instance Error 创建 Ec2 实例时没有响应启动 SSH 客户端 - NO response launch SSH client while creating Ec2 instance
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM