Welcome to the Linux Foundation Forum!

Lab 6 error, when trying to add Capabilities

Getting error when I updated the yaml.
[email protected]:~/app2$ vim second.yaml

  • sleep
  • "3600"
    securityContext:
    runAsUser: 2000
    allowPrivilegeEscalation: false
    Capabilities: #Add this and the following line
    add: ["NET_ADMIN", "SYS_TIME"]
    Name: busy

ckad-1:~/app2$ kubectl create -f second.yaml
error: error validating "second.yaml": error validating data: [ValidationError(Pod.spec.containers[0]): unknown field "Name" in io.k8s.api.core.v1.Container, ValidationError(Pod.spec.containers[0].securityContext): unknown field "Capabilities" in io.k8s.api.core.v1.SecurityContext]; if you choose to ignore these errors, turn validation off with --validate=false

Comments

  • aah, I figured out the Course Lab material has lot of lowercase,uppercase and also indentation issues. In this case it was upper case, needs to be 'capabilities'.

  • Thank you for letting us know. I will pass along your find and ask the material to be updated.

    Regards,

  • I'm in the process of double-checking the material and moving from a word-processor to LaTeX, where we can force the indents and capitalization, and avoid having auto-correction cause issues. Thank you again bringing it to our attention.

Categories

Upcoming Training