簡體   English   中英

Kubernetes CrashLoopBackOff

[英]Kubernetes CrashLoopBackOff

創建部署時出現錯誤。 這是我在本地運行和測試的 Dockerfile,我還將它推送到 DockerHub

FROM node:14.15.4
WORKDIR /usr/src/app
COPY package*.json ./

RUN npm install
RUN npm install pm2 -g
COPY . .
EXPOSE 3001
CMD [ "pm2-runtime", "server.js" ]

In my raspberry pi 3 model B, i have install k3s using curl -sfL https://get.k3s.io | sh - curl -sfL https://get.k3s.io | sh -這是我的控制器部署。yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: controller-deployment
  labels:
    app: controller
spec:
  replicas: 1
  selector:
    matchLabels:
      app: controller
  template:
    metadata:
      labels:
        app: controller
    spec:
      containers:
      - name: controller
        image: akirayorunoe/node-controller-server
        ports:
        - containerPort: 3001

運行此文件后,pod 出現錯誤

當我登錄吊艙時,它說

standard_init_linux.go:219: exec user process caused: exec format error

這是描述 pod 的回復

Name:         controller-deployment-8669c9c864-sw8kh
Namespace:    default
Priority:     0
Node:         raspberrypi/192.168.0.30
Start Time:   Fri, 21 May 2021 11:21:05 +0700
Labels:       app=controller
              pod-template-hash=8669c9c864
Annotations:  <none>
Status:       Running
IP:           10.42.0.43
IPs:
  IP:           10.42.0.43
Controlled By:  ReplicaSet/controller-deployment-8669c9c864
Containers:
  controller:
    Container ID:   containerd://439edcfdbf49df998e3cabe2c82206b24819a9ae13500b0                                                                                        13b9bac1df6e56231
    Image:          akirayorunoe/node-controller-server
    Image ID:       docker.io/akirayorunoe/node-controller-server@sha256:e1c5115                                                                                        2f9d596856952d590b1ef9a486e136661076a9d259a9259d4df314226
    Port:           3001/TCP
    Host Port:      0/TCP
    State:          Waiting
      Reason:       CrashLoopBackOff
    Last State:     Terminated
      Reason:       Error
      Exit Code:    1
      Started:      Fri, 21 May 2021 11:24:29 +0700
      Finished:     Fri, 21 May 2021 11:24:29 +0700
    Ready:          False
    Restart Count:  5
    Environment:    <none>
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-txm85 (ro                                                                                        )
Conditions:
  Type              Status
  Initialized       True
  Ready             False
  ContainersReady   False
  PodScheduled      True
Volumes:
  default-token-txm85:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-txm85
    Optional:    false
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  5m33s                  default-scheduler  Successfully ass                                                                                        igned default/controller-deployment-8669c9c864-sw8kh to raspberrypi
  Normal   Pulled     5m29s                  kubelet            Successfully pul                                                                                        led image "akirayorunoe/node-controller-server" in 3.072053213s
  Normal   Pulled     5m24s                  kubelet            Successfully pul                                                                                        led image "akirayorunoe/node-controller-server" in 3.018192177s
  Normal   Pulled     5m6s                   kubelet            Successfully pul                                                                                        led image "akirayorunoe/node-controller-server" in 3.015959209s
  Normal   Pulled     4m34s                  kubelet            Successfully pul                                                                                        led image "akirayorunoe/node-controller-server" in 2.921116157s
  Normal   Created    4m34s (x4 over 5m29s)  kubelet            Created containe                                                                                        r controller
  Normal   Started    4m33s (x4 over 5m28s)  kubelet            Started containe                                                                                        r controller
  Normal   Pulling    3m40s (x5 over 5m32s)  kubelet            Pulling image "a                                                                                        kirayorunoe/node-controller-server"
  Warning  BackOff    30s (x23 over 5m22s)   kubelet            Back-off restart                                                                                        ing failed container

這是錯誤圖像

您正在嘗試在 ARM 機器上啟動為 x86(或 x86_64,相同差異)構建的容器。 這不起作用。 ARM 的容器必須專門為 ARM 構建並包含 ARM 可執行文件。 雖然主要項目正在緩慢地將 ARM 支持添加到他們的構建中,但您在 Docker 集線器上找到的大多數隨機圖像或在 ARM 上都不起作用。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM