I am a student and new to minikube as well as linux. My Teacher did the same and his pod created but i am getting error. I don't know what is the problem. Should i ignore validation error?
kubectl create -f myfirstpod.yaml
error: error validating "myfirstpod.yaml": error validating data: apiVersion not set; if you choose to ignore these errors, turn validation off with --validate=false
cat myfirstpod.yaml
kind: Pod
apiversion: v1
metadata:
name: myfirstpod
spec:
containers:
name: container1
image: aamirpinger/helloworld:latest
ports:
containerPort: 80
I am using these versions:
Seems like you have typo. It should be apiVersion
instead of apiversion
. Also, the indentation in the PodSpec seems incorrect.
You can use this:
kind: Pod
apiVersion: v1
metadata:
name: myfirstpod
spec:
containers:
- name: container1
image: aamirpinger/helloworld:latest
ports:
- containerPort: 80