Open javajon opened 4 years ago
That was a lifesaver! Thank you.
Leaving it to readers:
If you want instead use the .yaml, the updated version is:
apiVersion: batch/v1
kind: Job
metadata:
name: oneshot
spec:
parallelism: 5
completions: 10
template:
spec:
containers:
- name: kuard
image: gcr.io/kuar-demo/kuard-amd64:blue
imagePullPolicy: Always
args:
- "/kuard"
- "--keygen-enable"
- "--keygen-exit-on-complete"
- "--keygen-num-to-gen=10"
restartPolicy: OnFailure
Wouldn't it be easier to use:
kubectl create job oneshot --image=gcr.io/kuar-demo/kuard-amd64:blue -- \
--keygen-enable --keygen-exit-on-complete --keygen-num-to-gen 10
Yes, it's easier, but the syntax would be, according to the changes:
kubectl create job oneshot --image=gcr.io/kuar-demo/kuard-amd64:blue -- \
/kuard --keygen-enable --keygen-exit-on-complete --keygen-num-to-gen 10
Chapter 12 says to start a Job like this:
With K8s 1.18, there is a deprecation.
So instead this command creates a Pod instead of a Job. OK, software evolves and printed copies do not. We can deal with this. However, there is another issue. The Pod will fail with:
Something about "blue" version of Kuard container changed. To work around it one has to change the command to
Notice the addition of
/kuard \
@surfer190 also documented their findings in these extensive notes found here. In the document search for "That said the error:" to see the same finding.
The issue is noted and worked around in this Katacoda scenario. I'm the author of this scenario.
This issue is more of an errata note for the Jobs chapter.