Error - "Error from server (BadRequest): error when creating “pod.yaml”: pod in version “v1” cannot be handled as a Pod: no kind “pod” is registered for version “v1” in scheme “k8s.io/kubernetes/pkg/api/legacyscheme/scheme.go:30”
using command- kubectl create -f pod-definition.yaml
Getting below error:
Error from server (BadRequest): error when creating “pod-definition.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
I don’t now if it’s a copy paste issue or not but you need to respect some structure, i spsect that the space just after - on -name create this issue. Try the following syntax :