Welcome to the Linux Foundation Forum!

[LFS260] Exercise 3.6: Leverage Secure Runtimes getting an error

Options

when running the command below:
student@single: ̃$ kubectl create -f gvisor-pod.yaml

I get the following error:
Error from server (BadRequest): error when creating "gvisor-pod.yaml": Pod in version "v1" cannot be handled as a Pod: json: cannot unmarshal object into Go struct field PodSpec.spec.containers of type []v1.Container

The content of the file is the following:

apiVersion: v1
kind: Pod
metadata:
name: simple-gvisor
spec:
runtimeClassName: gvisor
containers:
-name: secure-nginx
image: nginx

Any hints?

Comments

  • roo9330
    roo9330 Posts: 2
    Options

    Solved the issue by re-doing the indentation. Previously I used tabs for indentation, I replaced tabs with single space and got no errors when re-running "kubectl create -f gvisor-pod.yaml"

Categories

Upcoming Training