在Kubernetes部署中暴露多个端口
嗨,我目前正在尝试使用Amazon EKS设置应用程序。 我有一个使用两个端口2237和2238的应用程序。
当我在本地计算机上使用以下命令在本地计算机上运行它时,两个端口似乎都可以正常工作。
docker run -p 2237:2237 -p 2238:2238
我已经将图像推到了亚马逊ECR,目前正在尝试使用部署来创建POD。
我用来创建POD的YAML文件如下。
apiVersion: apps/v1
kind: Deployment
metadata:
name: evcloud-vertx
namespace: evcloud
spec:
replicas: 2
selector:
matchLabels:
app: evcloud-tcp
template:
metadata:
labels:
app: evcloud-tcp
spec:
containers:
- name: evcloud-tcp
image: ecr directory
ports:
- containerPort: 2238
- containerPort: 2237
结果似乎是一个和另一个的“ crashloopbackoff”。
我的猜测是,暴露两个端口时出了问题,如果有人能给我一些反馈,这将不胜感激。
我对AWS和Kubernetes都是新手,因此,任何类型的帮助都将是真诚地赞赏的。
先感谢您!
Hi I am currently trying to set up an application using Amazon EKS.
I have an application that uses two ports 2237 and 2238.
When I run it on a local machine using the following command on a local machine both ports seems to be working fine.
docker run -p 2237:2237 -p 2238:2238
I have pushed the image to Amazon ECR and am currently trying to create pods using deployment.
The yaml file that I used to create the pods are as follows.
apiVersion: apps/v1
kind: Deployment
metadata:
name: evcloud-vertx
namespace: evcloud
spec:
replicas: 2
selector:
matchLabels:
app: evcloud-tcp
template:
metadata:
labels:
app: evcloud-tcp
spec:
containers:
- name: evcloud-tcp
image: ecr directory
ports:
- containerPort: 2238
- containerPort: 2237
The result seems to be "Error" for one and "CrashLoopBackOff" for the other.
My guess is that something went wrong when exposing the two ports, and it would be appreciated if anyone could give me some feedback on this.
I am really new to both AWS and Kubernetes, so help of any sort would be sincerely appreciated.
Thank you in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这似乎是ARM架构的问题。
我目前正在使用M1 Mac,并且在创建Docker Image时指定平台后解决了问题
This seems to have been a problem with the arm architecture.
I am currently using an m1 Mac and the issue was resolved after specifying the platform when creating docker image