我正在尝试将 Quarkus-Camel 本机应用程序部署到 AWS EKS,但收到日志错误:
exec ./application: exec format error
该应用程序在我本地的 minikube 环境中运行良好,我确保图像的 os/arch 是
linux/arm64
。我有另一个应用程序,我正在构建和部署完全相同的方式,没有任何问题。
pod状态(
kubectl describe pod
)为:
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命令:
mvn clean package -Pnative -e \
-Dmaven.test.skip=true \
-Dquarkus.native.remote-container-build=true \
-Dquarkus.kubernetes.deploy=true \
-Dquarkus.container-image.push=true
应用程序.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
我在 Mac M1 上运行它。任何关于可能出错的地方/如何进一步调查的帮助或建议将不胜感激。
我已经检查并比较了大部分配置,但无法确定为什么一个有效,另一个无效。我在这里尝试了所有建议的步骤:https://aws.amazon.com/premiumsupport/knowledge-center/eks-pod-status-troubleshooting/
谢谢@Jeremy Cowan 和@gumelaragum!
使用参数
--node-type=m6g.large
创建集群解决了我的问题,我能够在 EKS 上运行图像。
问题: 有没有办法在 Mac M1 上为 x86_64 架构构建工件?我发现一些线程指出
-Dquarkus.native.container-build=true
或使用单独的构建器映像(Issue compiling quarkus native image on Apple Silicon)解决了这个问题,但它们都不适合我,文件类型总是声明 ARM aarch64
。
Maven 会在这里发挥作用吗?