educative.io

Kubectl pods topic run failure

$ kubectl run db --image mongo
error: no matches for kind “Pod” in version “v1”
$ kubectl create -f pod/db.yml
Error from server (NotFound): the server could not find the requested resource

i have to start minikube before creating/running the pod
so the server is present to render pods.

kubectl version
Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.3",        GitCommit:"ca643a4d1f7bfe34773c74f79527be4afd95bf39", GitTreeState:"clean", BuildDate:"2021-07-15T21:04:39Z", GoVersion:"go1.16.6", Compiler:"gc", Platform:"windows/amd64"}
Error from server (NotFound): the server could not find the requested resource

on starting minikube , check kubectl version

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.3", GitCommit:"ca643a4d1f7bfe34773c74f79527be4afd95bf39", GitTreeState:"clean", BuildDate:"2021-07-15T21:04:39Z", GoVersion:"go1.16.6", Compiler:"gc", Platform:"windows/amd64"}
Server Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.2", GitCommit:"092fbfbf53427de67cac1e9fa54aaa09a28371d7", GitTreeState:"clean", BuildDate:"2021-06-16T12:53:14Z", GoVersion:"go1.16.5", Compiler:"gc", Platform:"linux/amd64"}

Now with this setup I was able to

$kubectl create -f pod/db.yml
pod/db created
kubectl get pods -o wide
NAME   READY   STATUS              RESTARTS   AGE   IP       NODE       NOMINATED NODE   READINESS GATES
db     0/1     ContainerCreating   0          59s   <none>   minikube   <none>           <none>

Hence solved…🥲 after 15days…