Welcome to the Linux Foundation Forum!

Lab 6.3

Hello,

It's Ok for 6.3.1 to 6.3.4.

As for 6.3.5, I've got a problem after changing the file job.yaml

alexey@master:~/LFS258/SOLUTIONS/s_06$ cat job.yaml
apiVersion: batch/v1
kind: Job
metadata:
name: sleepy
spec:
completions: 5
template:
spec:
containers:
- name: resting
image: busybox
command: ["/bin/sleep"]
args: ["3"]

restartPolicy: Never

create -f job.yaml
error: error validating "job.yaml": error validating data: [ValidationError(Job.spec): unknown field "spec" in io.k8s.api.batch.v1.JobSpec, ValidationError(Job.spec): missing required field "template" in io.k8s.api.batch.v1.JobSpec]; if you choose to ignore these errors, turn validation off with --validate=false

alexey@master:~/LFS258/SOLUTIONS/s_06$ kubectl create -f job.yaml --validate=false
The Job "sleepy" is invalid:

  • spec.template.spec.containers: Required value
  • spec.template.spec.restartPolicy: Required value: valid values: "OnFailure", "Never"

Thank you.

Comments

  • Hi @AlexeyBY,

    The error is typical for improper YAML formatting. However, it is impossible to tell what exactly caused the error based on how the YAML code was provided above. I would recommend using the Code formatting tags to preserve the original YAML indentation when sharing YAML code, to help with the troubleshooting process.

    Regards,
    -Chris

  • hi,
    yes, i missed the space and got the error.

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training