Kubernetes - Why does selector field fail to validate for Deployment? : <p>Using Kubernetes 1.2.4, why does my below <a href="http://kubernetes.io/docs/user-guide/deployments/" rel="noreferrer">Deployment</a> definition (redis.yaml) cause the following error?</p>

<pre><code>$ kubectl apply -f redis.yaml
error validating "redis.yaml": error validating data: found invalid field name for v1beta1.LabelSelector; if you choose to ignore these errors, turn validation off with --validate=false
</code></pre>

<p><strong>redis.yaml:</strong></p>

<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: redis
spec:
  replicas: 3
  selector:
    name: redis
  template:
    metadata:
      labels:
        name: redis
    spec:
      containers:
      - name: redis
        image: kubernetes/redis:v1
        ports:
        - containerPort: 6379
        resources:
          limits:
            cpu: "0.1"
        volumeMounts:
        - mountPath: /redis-master-data
          name: data
      volumes:
        - name: data
          emptyDir: {}
</code></pre>
