Kubernetes pod failing because of incorrect container command

7/13/2021

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.<br/>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 <br/> 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

-- solveit
kubernetes
kubernetes-deployment
kubernetes-operator
kubernetes-pod
makefile

2 Answers

7/13/2021
  • In Dockerfile , the Entrypoint you have mentioned is ENTRYPOINT ["/manager"] but shouldnt it be ENTRYPOINT ["./manager"]

  • regarding "starting container process caused: exec: "/bin/bash": stat /bin/bash: " , it seems base image does not have /bin/bash it might have just /bin/sh

-- confused genius
Source: StackOverflow

7/14/2021

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

-- PapEr
Source: StackOverflow