How do I get Kubernetes to work when I get an error the server could not find the requested resource?

HOW TO -️ October 18, 2021

I cannot create a kubernetes pod. I just deployed Kubernetes to Ubuntu 16.04.

I have this as a.yml:

ERROR Rendering Code Block

I run this: kubectl create -f a.yml

I get this:

Error from server (NotFound): the server could not find the requested resource

I expected the above command to create a pod.

I ran this: kubectl cluster-info dump

I got this:

ERROR Rendering Code Block

What am I doing wrong?

Update 12/26/17

The command kubectl get ns produces

the server doesn't have a resource type "namespaces"

$ kubectl version

Client Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.0", GitCommit:"925c127ec6b946659ad0fd596fa959be43f0cc05", GitTreeState:"clean", BuildDate:"2017-12-15T21:07:38Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"0", GitVersion:"v1.0.3", GitCommit:"61c6ac5f350253a4dc002aee97b7db7ff01ee4ca", GitTreeState:"clean", BuildDate:"", GoVersion:"", Compiler:"", Platform:""}

Update 1/15/18 How do I get some namespaces to be returned?

Answer

What happens if kubectl get ns is run? What version of Kubernetes are you using? Images: null and you're asking for an image named 'nginx', that doesn't looks like a registry image name, as such I guess k8s have no idea what to do

Initializing...