gpt4 book ai didi

azure - AKS 中状态为 CrashLoopBackOff 的容器

转载 作者:行者123 更新时间:2023-12-03 01:59:45 26 4
gpt4 key购买 nike

我正在尝试将容器部署到 AKS,但 Pod 始终处于 CrashLoopBackOff 状态并重新启动。我尝试了不同的 Pod,但显然与这方面无关。

该 Pod 具有非常简单的功能行为,可以在本地正常工作。这是一个简单的 Express 服务器,监听端口 9002 并在路径“/”中发送消息“HELLO”。

部署的容器具有以下yaml文件:

apiVersion: apps/v1
kind: Deployment
metadata:
name: be-simply-depl
spec:
replicas: 1
selector:
matchLabels:
app: be-simply
template:
metadata:
labels:
app: be-simply
spec:
containers:
- name: be-simply
image: dockeraccount/be-simply
---
apiVersion: v1
kind: Service
metadata:
name: be-simply-srv
spec:
selector:
app: be-simply
type: ClusterIP
ports:
- name: be-simply
protocol: TCP
port: 9002
targetPort: 9002

运行时:

kubectl describe pod be-simply-depl-79f49b58d7-wksms

Name:             be-simply-depl-79f49b58d7-wksms 
Namespace: default
Priority: 0
Service Account: default
Node: aks-agentpool-24486413-vmss000000/10.224.0.4
Start Time: Tue, 25 Jul 2023 05:17:17 +0000
Labels:
app=be-simply
pod-template-hash=79f49b58d7
Annotations: <none>
Status:
Running IP: 10.244.0.42
IPs:
IP: 10.244.0.42
Controlled By: ReplicaSet/be-simply-depl-79f49b58d7
Containers: be-simply:
Container ID: containerd://eddf0b34eaeaa8a0223631976d175b1e86d24129300d669a79c217cab4ef5531
Image: manelcastro/be-simply
Image ID: docker.io/manelcastro/be-simply@sha256:c933ed74ed2d1281e793beb9d4555b8951a5dba3ed21bc8dd27c65e0896e13ea
Port: <none>
Host Port: <none>
State: Waiting
Reason: CrashLoopBackOff
Last State: Terminated
Reason: Error
Exit Code: 1
Started: Tue, 25 Jul 2023 05:18:06 +0000
Finished: Tue, 25 Jul 2023 05:18:06 +0000 Ready: False Restart Count: 3
Environment: <none>
Mounts: /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-pnhv2 (ro)
Conditions:
Type Status
Initialized True
Ready False
ContainersReady False
PodScheduled True
Volumes:
kube-api-access-pnhv2:
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 101s default-scheduler Successfully assigned default/be-simply-depl-79f49b58d7-wksms to aks-agentpool-24486413-vmss000000
Normal Pulled 101s kubelet Successfully pulled image "manelcastro/be-simply" in 749.891764ms (749.897064ms including waiting)
Normal Pulled 99s kubelet Successfully pulled image "manelcastro/be-simply" in 735.883614ms (735.889814ms including waiting)
Normal Pulled 82s kubelet Successfully pulled image "manelcastro/be-simply" in 728.026859ms (728.037459ms including waiting)
Normal Created 53s (x4 over 101s) kubelet Created container be-simply
Normal Started 53s (x4 over 101s) kubelet Started container be-simply
Normal Pulled 53s kubelet Successfully pulled image "manelcastro/be-simply" in 733.54339ms (733.55049ms including waiting)
Warning BackOff 15s (x8 over 99s) kubelet Back-off restarting failed container

kubectl logs be-simply-depl-79f49b58d7-wksms

exec /usr/local/bin/docker-entrypoint.sh: exec format error

有人可以阐明这个主题吗?谢谢

最佳答案

终于解决了这个问题,这是由于我构建 Docker 镜像和部署它的 CPU 架构不匹配。我在 Mac 上构建并部署到 x86_64 云服务器

关于azure - AKS 中状态为 CrashLoopBackOff 的容器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/76757602/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com