英文:
Quarkus native application on AWS EKS - "exec format error"
问题
我正在尝试将一个Quarkus-Camel本地应用程序部署到AWS EKS,但遇到了日志错误:
exec ./application: exec format error
在我的本地minikube环境中,该应用程序正常运行,我确保镜像的操作系统/架构是linux/arm64
。我还有另一个应用程序,我正在以完全相同的方式构建和部署,它可以正常工作。
Pod状态(kubectl describe pod
)如下:
名称: integration-order-6dbccccb7d-qm9sb
命名空间: development
优先级: 0
服务帐号: integration-order
节点: ip-192-168-31-231.ap-southeast-2.compute.internal/192.168.31.231
启动时间: 2023年3月12日,周日,+1100 21:49:05
标签: app.kubernetes.io/name=integration-order
app.kubernetes.io/version=1.0.0
pod-template-hash=6dbccccb7d
注释: app.quarkus.io/build-timestamp: 2023年3月12日 - 09:59:34 +0000
app.quarkus.io/commit-id: b888f2e29a05851b20d400386d70f3b269c3ed7a
状态: 运行中
IP: 192.168.6.84
IPs:
IP: 192.168.6.84
受控于: ReplicaSet/integration-order-6dbccccb7d
容器:
integration-order:
容器ID: containerd://6cd1d5c2459d00ea17e28528a06e73846cdad78cb2f4d03696427f88f2107bd2
镜像: fluentintegrations/integration-order:1.0.0
镜像ID: docker.io/fluentintegrations/integration-order@sha256:eb42f2faf67cd61b0eb8e805aa6a46d5649db1b4aafd448319cf50bec6f476f2
端口: 8087/TCP
主机端口: 0/TCP
状态: 已终止
原因: 错误
退出码: 1
启动时间: 2023年3月12日,周日,+1100 21:49:22
完成时间: 2023年3月12日,周日,+1100 21:49:22
上一个状态: 已终止
原因: 错误
退出码: 1
启动时间: 2023年3月12日,周日,+1100 21:49:06
完成时间: 2023年3月12日,周日,+1100 21:49:06
准备就绪: False
重启计数: 2
存活探针: http-get http://:8087/q/health/live 延迟=30秒 超时=10秒 周期=30秒 #成功=1 #失败=3
可用性探针: http-get http://:8087/q/health/ready 延迟=45秒 超时=10秒 周期=45秒 #成功=1 #失败=3
环境:
KUBERNETES_NAMESPACE: development (v1:metadata.namespace)
挂载点:
/var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-rmczh (只读)
条件:
类型 状态
初始化完成 True
准备就绪 False
容器就绪 False
Pod已计划 True
卷:
kube-api-access-rmczh:
类型: Projected(包含来自多个来源的注入数据的卷)
令牌过期时间(秒): 3607
ConfigMap名称: kube-root-ca.crt
ConfigMap可选项: <nil>
DownwardAPI: true
QoS类: 最佳努力
节点选择器: <none>
容忍性: node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
事件:
类型 原因 年龄 来自 消息
---- ------ ---- ---- -------
正常 计划 20秒 默认调度程序 成功分配到development/integration-order-6dbccccb7d-qm9sb的ip-192-168-31-231.ap-southeast-2.compute.internal
正常 拉取 3秒 (x3 over 20秒) kubelet 容器镜像“fluentintegrations/integration-order:1.0.0”已经存在于机器上
正常 创建 3秒 (x3 over 20秒) kubelet 创建容器integration-order
正常 启动 3秒 (x3 over 20秒) kubelet 启动容器integration-order
警告 后退 2秒 (x3 over 18秒) kubelet 重试失败的容器时出现后退
Maven命令:
```plaintext
mvn clean package -Pnative -e \
-Dmaven.test.skip=true \
-Dquarkus.native.remote-container-build=true \
-Dquarkus.kubernetes.deploy=true \
-Dquarkus.container-image.push=true
application.properties:
quarkus.http.port=8087
# quarkus kubernetes extension
quarkus.container-image.group=fluentintegrations
quarkus.container-image.name=integration-order
quarkus.kubernetes.namespace=development
quarkus.kubernetes.readiness-probe.initial-delay=45s
quarkus.kubernetes.readiness-probe.period=45s
quarkus.kubernetes.liveness-probe.initial-delay=30s
quarkus.kubernetes.liveness-probe.period=30s
quarkus.kubernetes.image-pull-policy=ifNotPresent
quarkus.kubernetes
<details>
<summary>英文:</summary>
I am trying to deploy a Quarkus-Camel native app to AWS EKS but getting the log error:
`exec ./application: exec format error`
The app works fine in my local minikube environment and I've ensure that the os/arch of the image is `linux/arm64`. I have another app which I am building & deploying the exact same way which works without any issues.
The pod state (`kubectl describe pod`) is:
Name: integration-order-6dbccccb7d-qm9sb
Namespace: development
Priority: 0
Service Account: integration-order
Node: ip-192-168-31-231.ap-southeast-2.compute.internal/192.168.31.231
Start Time: Sun, 12 Mar 2023 21:49:05 +1100
Labels: app.kubernetes.io/name=integration-order
app.kubernetes.io/version=1.0.0
pod-template-hash=6dbccccb7d
Annotations: app.quarkus.io/build-timestamp: 2023-03-12 - 09:59:34 +0000
app.quarkus.io/commit-id: b888f2e29a05851b20d400386d70f3b269c3ed7a
Status: Running
IP: 192.168.6.84
IPs:
IP: 192.168.6.84
Controlled By: ReplicaSet/integration-order-6dbccccb7d
Containers:
integration-order:
Container ID: containerd://6cd1d5c2459d00ea17e28528a06e73846cdad78cb2f4d03696427f88f2107bd2
Image: fluentintegrations/integration-order:1.0.0
Image ID: docker.io/fluentintegrations/integration-order@sha256:eb42f2faf67cd61b0eb8e805aa6a46d5649db1b4aafd448319cf50bec6f476f2
Port: 8087/TCP
Host Port: 0/TCP
State: Terminated
Reason: Error
Exit Code: 1
Started: Sun, 12 Mar 2023 21:49:22 +1100
Finished: Sun, 12 Mar 2023 21:49:22 +1100
Last State: Terminated
Reason: Error
Exit Code: 1
Started: Sun, 12 Mar 2023 21:49:06 +1100
Finished: Sun, 12 Mar 2023 21:49:06 +1100
Ready: False
Restart Count: 2
Liveness: http-get http://:8087/q/health/live delay=30s timeout=10s period=30s #success=1 #failure=3
Readiness: http-get http://:8087/q/health/ready delay=45s timeout=10s period=45s #success=1 #failure=3
Environment:
KUBERNETES_NAMESPACE: development (v1:metadata.namespace)
Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-rmczh (ro)
Conditions:
Type Status
Initialized True
Ready False
ContainersReady False
PodScheduled True
Volumes:
kube-api-access-rmczh:
Type: Projected (a volume that contains injected data from multiple sources)
TokenExpirationSeconds: 3607
ConfigMapName: kube-root-ca.crt
ConfigMapOptional: <nil>
DownwardAPI: true
QoS Class: BestEffort
Node-Selectors: <none>
Tolerations: node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
Type Reason Age From Message
Normal Scheduled 20s default-scheduler Successfully assigned development/integration-order-6dbccccb7d-qm9sb to ip-192-168-31-231.ap-southeast-2.compute.internal
Normal Pulled 3s (x3 over 20s) kubelet Container image "fluentintegrations/integration-order:1.0.0" already present on machine
Normal Created 3s (x3 over 20s) kubelet Created container integration-order
Normal Started 3s (x3 over 20s) kubelet Started container integration-order
Warning BackOff 2s (x3 over 18s) kubelet Back-off restarting failed container
Maven command:
mvn clean package -Pnative -e
-Dmaven.test.skip=true
-Dquarkus.native.remote-container-build=true
-Dquarkus.kubernetes.deploy=true
-Dquarkus.container-image.push=true
application.properties:
quarkus.http.port=8087
quarkus kubernetes extension
quarkus.container-image.group=fluentintegrations
quarkus.container-image.name=integration-order
quarkus.kubernetes.namespace=development
quarkus.kubernetes.readiness-probe.initial-delay=45s
quarkus.kubernetes.readiness-probe.period=45s
quarkus.kubernetes.liveness-probe.initial-delay=30s
quarkus.kubernetes.liveness-probe.period=30s
quarkus.kubernetes.image-pull-policy=ifNotPresent
quarkus.kubernetes.service-type=LoadBalancer
I am running this on a Mac M1. Any help or suggestions on what could go wrong / how to investigate further would be much appreciated.
I've checked & compared most of the configurations but am unable to identify why one works the other doesn't. I have tried all the suggested steps here:https://aws.amazon.com/premiumsupport/knowledge-center/eks-pod-status-troubleshooting/
</details>
# 答案1
**得分**: 0
感谢@Jeremy Cowan和@gumelaragum!
使用参数`--node-type=m6g.large`创建集群解决了我的问题,我能够在EKS上运行镜像。
问题:
在Mac M1上是否有一种方法来构建x86_64架构的构件?我找到了一些帖子,其中提到`-Dquarkus.native.container-build=true`或使用一个单独的构建器镜像(https://stackoverflow.com/questions/67337504/issue-compiling-quarkus-native-image-on-apple-sillicon/71368601#71368601)可以解决这个问题,但对我来说都不起作用,文件类型总是显示为`ARM aarch64`。
Maven是否在这里起作用?
<details>
<summary>英文:</summary>
Thank you @Jeremy Cowan & @gumelaragum!
Creating the cluster with the parameter `--node-type=m6g.large` resolved my issue and I'm able to run the images on EKS.
Question:
Is there a way to build the artifacts for a x86_64 architecture on a Mac M1? I found a few threads stating that `-Dquarkus.native.container-build=true` or using a separate builder image (https://stackoverflow.com/questions/67337504/issue-compiling-quarkus-native-image-on-apple-sillicon/71368601#71368601)resolved the issue, but none of them worked for me and the file type would always state `ARM aarch64`.
Would Maven play a role here?
</details>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论