Welcome to the Linux Foundation Forum!

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

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

  • 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"

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