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

Example 5-3 in Kubernetes Patterns, 2nd Edition #2

Open
bmuschko opened this issue May 12, 2023 · 6 comments
Open

Example 5-3 in Kubernetes Patterns, 2nd Edition #2

bmuschko opened this issue May 12, 2023 · 6 comments

Comments

@bmuschko
Copy link

I tried create a Pod directly from the manifest in example 5-3.

apiVersion: v1
kind: Pod
metadata:
  name: simple-random-generator
spec:
  containers:
  - image: k8spatterns/random-generator:1.0
    name: random-generator
    command:
    - "random-generator-runner"
    args:
    - "--seed"
    - "42"

It looks like the executable doesn't come with the container image.

Warning  Failed     2s (x3 over 18s)  kubelet            Error: failed to create containerd task: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "random-generator-runner": executable file not found in $PATH: unknown

Is this meant to work as-is or is it a hypothetical example where the user has to assume that the executable does exist?

@rhuss
Copy link
Contributor

rhuss commented May 16, 2023

Thanks for the heads up!

Normally examples are mean to be directly executable, but in this case this is indeed not finished yet. I will fix this ASAP and keep you posted. Actually the image itself contains a batch runner for this kind of task (see e.g. Ex. 7.1), but in this case it's still fictive. I will upadte the imate to contain a wrapper script for this.

However, the full example about entrypoint rewriting is meant educational, the example itself is not very useful. It could be that not all examples in the book are runnable, but we take care that the example in the example repository https://github.com/k8spatterns/examples are fully working (if not, please open an issue). Unfortunately for the entrypoint rewriting it has not yet been included.

@rhuss rhuss closed this as completed May 16, 2023
@rhuss
Copy link
Contributor

rhuss commented May 16, 2023

oops, closed by accident.

@rhuss rhuss reopened this May 16, 2023
@bmuschko
Copy link
Author

Thanks for the info!

@rhuss
Copy link
Contributor

rhuss commented May 17, 2023

I pushed a working image now, so that particular example works. Unfortunately the Pod declaration misses restartPolicy: OnFailure (it's a batch job anyways), but I added this to the errata at https://www.oreilly.com/catalog/errata.csp?isbn=0636920710967 and also fixed it in the book.

In the next step I will work on the image k8spatterns/supervisor which also does not exist (actually the example is also illustrative). Thanks again for the heads up, we totally overlooked that the example was not functional.

I will let you know, when done, so that the example in chapter 5 should be fully functional.

@bmuschko
Copy link
Author

bmuschko commented Jul 6, 2023

@rhuss It looks like the newly-pushed container image tag 1.0 doesn't support linux/amd64 anymore. Can we get that fixed? All other tags support linux/amd64 and linux/arm64.

image

@rhuss
Copy link
Contributor

rhuss commented Jul 11, 2023

Sorry, I probably just forgot to push 🤦

Everything should be up now.

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