Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initpod (nigelpoulton/web-app:1.0) CrashLoopBackOff #46

Open
mahmud2011 opened this issue Apr 4, 2024 · 3 comments
Open

initpod (nigelpoulton/web-app:1.0) CrashLoopBackOff #46

mahmud2011 opened this issue Apr 4, 2024 · 3 comments

Comments

@mahmud2011
Copy link

mahmud2011 commented Apr 4, 2024

kubectl apply -f initpod.yml
kubectl apply -f initsvc.yml
kubectl get pods -w

Output:

initpod     0/1     Init:0/1   0          8s
initpod     0/1     PodInitializing   0          32s
initpod     0/1     Error             0          33s
kubectl logs initpod 

Output:

Defaulted container "web-ctr" out of: web-ctr, init-ctr (init)
exec /bin/sh: exec format error
kubectl describe pod initpod

Output:

Events:
  Type     Reason     Age                 From               Message
  ----     ------     ----                ----               -------
  Normal   Scheduled  24m                 default-scheduler  Successfully assigned default/initpod to minikube
  Normal   Pulled     24m                 kubelet            Container image "busybox:1.28.4" already present on machine
  Normal   Created    24m                 kubelet            Created container init-ctr
  Normal   Started    24m                 kubelet            Started container init-ctr
  Normal   Pulled     22m (x5 over 23m)   kubelet            Container image "nigelpoulton/web-app:1.0" already present on machine
  Normal   Created    22m (x5 over 23m)   kubelet            Created container web-ctr
  Normal   Started    22m (x5 over 23m)   kubelet            Started container web-ctr
  Warning  BackOff    14m (x46 over 23m)  kubelet            Back-off restarting failed container web-ctr in pod initpod_default(6a940216-af2e-43a6-a73c-257fe3d46ecf)

Works:
Changing the image to nigelpoulton/k8sbook:1.0.

@mahmud2011 mahmud2011 changed the title initpod CrashLoopBackOff initpod (nigelpoulton/web-app:1.0) CrashLoopBackOff Apr 4, 2024
@jlyons210
Copy link

Thank you for sharing this @mahmud2011.

I think this issue would only impact those not running on amd64 architectures. I'm running microk8s on a Raspberry Pi 5, and the nigelpoulton/k8sbook:1.0 image comes in both amd64 and arm64 architectures.

@jlyons210
Copy link

@nigelpoulton - not sure if the best course of action to resolve the issue for arm64 folks would be to update the initpod.yml to reference k8sbook:1.0, or to re-publish the web-app:1.0 image as multiarch?

@jlyons210
Copy link

I ran into a similar issue on a Pi 5 with k8s.gcr.io/git-sync:v3.1.6 - updating to k8s.gcr.io/git-sync/git-sync:v3.6.5 resolved the issue.

Logs from v3.1.6:

$ microk8s kubectl logs -f git-sync --container ctr-sync
INFO: detected pid 1, running init handler
I0914 21:11:27.223483      12 main.go:321]  "level"=0 "msg"="starting up"  "args"=["/git-sync"] "pid"=12
I0914 21:11:27.223556      12 main.go:574]  "level"=0 "msg"="cloning repo"  "origin"="https://github.com/jlyons210/ps-sidecar.git" "path"="/tmp/git"
E0914 21:11:27.226792      12 main.go:347]  "msg"="failed to sync repo, aborting" "error"="error running command: fork/exec /usr/bin/git: exec format error: { stdout: \"\", stderr: \"\" }"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants