Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
291 views
in Technique[技术] by (71.8m points)

makefile - Kubernetes pod failing because of incorrect container command

I am creating a egress-operator. I have a pod egress-operator-controller-manager created from makefile by command make deploy IMG=my_azure_repo/egress-operator:v0.1. The pod is failing , its showing error in pod description as:

  State:          Waiting
  Reason:       RunContainerError
  Last State:     Terminated
  Reason:       StartError
  Message:      failed to create containerd task: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "/manager": stat /manager: no such file or directory: unknown
  Failed     44s (x3 over 59s)  kubelet  Error: failed to create containerd task: 
  OCI runtime create failed: container_linux.go:380: starting container process caused: 
  exec: "/manager": stat /manager: no such file or directory: unknown

I suspect that in manager.yaml, under command: /manager is executed.
Can someone let me know what is going wrong in this manager.yaml and whether /manager is valid under command: in deployment.yaml

Debugging UPDATE
Instead of running Dockerfile, now I just build and run image_azure_repo/egress-operator:v0.1 locally (on same ubuntu 18 VM), When I try to login with: docker exec -it <container_id> /bin/bash, I am getting error :

OCI runtime exec failed: exec failed: container_linux.go:380: 
starting container process caused: exec: "/bin/bash": stat /bin/bash: 
no such file or directory: unknown

This is similar error what I see in pod description. Instead of /bin/bash , I also tried docker exec with /bin/sh and only sh ; Its giving same error

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This should be a mismatch for libc.

Golang uses glibc by default while alpine uses musl.

You could try those to fix it:

  1. Use a base image using glibc
  2. Install glibc in your alpine image

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...