I am using kubectl 1.6.4:
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.4", GitCommit:"d6f433224538d4f9ca2f7ae19b252e6fcb66a3ae", GitTreeState:"clean", BuildDate:"2017-05-19T18:44:27Z", GoVersion:"go1.7.5", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.4", GitCommit:"d6f433224538d4f9ca2f7ae19b252e6fcb66a3ae", GitTreeState:"clean", BuildDate:"2017-05-19T18:33:17Z", GoVersion:"go1.7.5", Compiler:"gc", Platform:"linux/amd64"}
I am trying to follow along with Connect a Front End to a Back End Using a Service, and am attempting to create this deployment (deployment.yml):
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: frontend
spec:
replicas: 1
template:
metadata:
labels:
app: hello
tier: frontend
track: stable
spec:
containers:
- name: nginx
image: "gcr.io/google-samples/hello-frontend:1.0"
lifecycle:
preStop:
exec:
command: ["/usr/sbin/nginx","-s","quit"]
Upon kubectl create -f deployment.yml, I get the following error:
error: error validating "/path/to/deployment.yml": error validating data: unexpected end of JSON input; if you choose to ignore these errors, turn validation off with --validate=false
However, this file is valid.
I noticed in Deployments documentation that Deployments before 1.6.0 used apiVersion: extensions/v1beta1 instead of apiVersion: app/v1beta1. So just for kicks I replaced apiVersion: app/v1beta1 with apiVersion: extensions/v1beta1, even though I am running 1.6.4. To my surprise, it worked.
What's wrong? Why do I need to use the old, pre-1.6.0 apiVersion line even though I am on 1.6.4?