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

/bin/sh not found when using this image in kubernetes job #133

Closed
ykfq opened this issue Jan 18, 2019 · 4 comments
Closed

/bin/sh not found when using this image in kubernetes job #133

ykfq opened this issue Jan 18, 2019 · 4 comments

Comments

@ykfq
Copy link

ykfq commented Jan 18, 2019

The descheduler will be run as a job in kube-system namespace, and the command is

    Command:
      /bin/sh
      -ec
      /bin/descheduler --policy-config-file /policy-dir/policy.yaml

So, there should be a /bin/sh binary in the container, but the image was build from sratch and didn't include it. We can find this from Dockerfile:

FROM scratch

MAINTAINER Avesh Agarwal <avagarwa@redhat.com>

COPY --from=0 /go/src/github.com/kubernetes-incubator/descheduler/_output/bin/descheduler /bin/descheduler

CMD ["/bin/descheduler", "--help"]

And we got the Error:

Error: failed to start container "descheduler": Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "exec: "/bin/sh": stat /bin/sh: no such file or directory"

This makes the pod runs into ContainerCannotRun state and the job create a new pod immediatly,
several minutes later I got hundreds of pods and my small cluster finally went down for no responding.
image

image

@zegl
Copy link

zegl commented Jan 21, 2019

Remove the /bin/sh -ec part of the command, and it should start correctly.

You should also set startingDeadlineSeconds and concurrencyPolicy on your CronJob, to avoid a failing job from consuming all of the resources in your cluster.

@ykfq
Copy link
Author

ykfq commented Jan 21, 2019

Remove the /bin/sh -ec part of the command, and it should start correctly.

You should also set startingDeadlineSeconds and concurrencyPolicy on your CronJob, to avoid a failing job from consuming all of the resources in your cluster.

Thanks @zegl
So we should make some updates of the README document.

@ravisantoshgudimetla
Copy link
Contributor

@ykfq - Do you mind creating a PR to address this issue?

@aveshagarwal
Copy link
Contributor

Fixed in: #137

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

4 participants