kubernetes-up-and-running / kuard

Demo app for Kubernetes Up and Running book
Apache License 2.0
1.61k stars 541 forks source link

kubectl create -f 5-1-kuard-pod.yaml #8

Closed jamesbuckett closed 7 years ago

jamesbuckett commented 7 years ago

Trying to execute kubectl create -f 5-1-kuard-pod.yaml

Error on minikube

error: error validating "5-1-kuard-pod.yaml": error validating data: ValidationError(Pod.metadata): unknown field "spec" in io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta; if you choose to ignore these errors, turn validation off with --validate=false`

Error on kubeadm

error: error validating "5-1-kuard-pod.yaml": error validating data: ValidationError(Pod.metadata): unknown field "spec" in io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta; if you choose to ignore these errors, turn validation off with --validate=false

kubectl version

Client Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.1", GitCommit:"f38e43b221d08850172a9a4ea785a86a3ffa3b3a", GitTreeState:"clean", BuildDate:"2017-10-11T23:27:35Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.5", GitCommit:"17d7182a7ccbb167074be7a87f0a68bd00d58d97", GitTreeState:"clean", BuildDate:"2017-10-06T20:53:14Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
jamesbuckett commented 7 years ago

Updated the manifest files as follows.

Incorrect indentation.

apiVersion: v1
kind: Pod
metadata:
  name: kuard
spec:
  containers:
  - image: gcr.io/kuar-demo/kuard-amd64:1
    name: kuard
    ports:
    - containerPort: 8080
      name: http
      protocol: TCP

Manifest now load correctly. pod "kuard" created

kuard Pods
NAME      READY     STATUS    RESTARTS   AGE       IP           NODE
kuard     1/1       Running   0          4m        172.17.0.4   minikube