monzo / egress-operator

A Kubernetes operator to produce egress gateway Envoy pods and control access to them with network policies
MIT License
249 stars 24 forks source link

caused: exec: "/manager": stat /manager error in egress-operator-controller-manager pod description #20

Closed shreya-bhatnagar closed 3 years ago

shreya-bhatnagar commented 3 years ago

https://github.com/monzo/egress-operator/blob/2bb1a423cc8d6c556d5a746dabf401fa59754573/config/manager/manager.yaml#L51

my coredns and egress-operator-deployment pods are running fine. But egress-operator-controller-manager pod (created after make deploy IMG=my_azure_repo/egress-operator:v0.1 ) is giving error in pod description as:

 Failed   m2s (x4 over 4m35s)   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

my make run and make deploy IMG=my_azure_repo/egress-operator:v0.1 also worked fine without any error.

some path /manager not able to be recognized by makefile or might be a typo in manager.yaml it seems?
Can this be caused because of this line ? Please suggest.

shreya-bhatnagar commented 3 years ago

@boffbowsh @samstarling @chrisfarms @suhailpatel : I suspect that in manager.yaml, command: /manager is executed. Can someone let me know whether /manager is valid under command: in deployment.yaml as I am getting error:

 Failed   m2s (x4 over 4m35s)   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

My coredns pod is working fine, make deploy IMG=... also worked fine without any error.

shreya-bhatnagar commented 3 years ago

Resolution: Golang uses glibc by default. I debugged build process and found that the Dockerfile is using: distroless/static image for packaging the manager binary. As per distroless, I found that distroless/static is not supporting glibc package. So I replaced distroless/static with distroless/base image that supports glibc. After fixing this in dockerfile the build happened successfully and this error got resolved.