<p>I'm trying to deploy a persistent storage for couch DB and it is failing out with the error</p>
<hr />
<p>kubectl create -f couch_persistant_deploy.yaml</p>
<blockquote>
<p>error: error validating &quot;couch_persistant_deploy.yaml&quot;: error validating data: couldn't find type: v1.Deployment; if you choose to ignore these errors, turn validation off with --validate=false</p>
</blockquote>
<p>###<code>PersistentVolume</code> YAML</p>
<pre><code>apiVersion: v1
kind: PersistentVolume
metadata:
  name: task-pv-volume
  labels:
    type: local
spec:
  storageClassName: manual
  capacity:
    storage: 2Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: /mnt/sda1/data/test
</code></pre>
<p>###<code>PersistentVolumeClaim</code> YAML</p>
<pre><code>apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: task-pv-claim
  labels:
    app: couchdb
spec:
  storageClassName: manual
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
</code></pre>
<p>###<code>Deployment</code> YAML</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: couchdb
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: couchdb
    spec:
      containers:
        - name: couchdb
          image: &quot;couchdb&quot;
          imagePullPolicy: Always
          env:
          - name: COUCHDB_USER
            value: admin
          - name: COUCHDB_PASSWORD
            value: password
          ports:
          - name: couchdb
            containerPort: 5984
          - name: epmd
            containerPort: 4369
            containerPort: 9100
          volumeMounts:
          - mountPath: &quot;/opt/couchdb/data&quot;
            name: task-pv-storage
      imagePullSecrets:
      - name: registrypullsecret2
      volumes:
      - name: task-pv-storage
        persistentVolumeClaim:
        claimName: task-pv-claim
</code></pre>
<p>Any leads are really appreciated.</p>

anish anil
<p>Your error message should be like this:</p>
<blockquote>
<p>error: error validating &quot;couch_persistant_deploy.yaml&quot;: error validating data: ValidationError(Deployment.spec.template.spec.volumes[0]): unknown field &quot;claimName&quot; in io.k8s.api.core.v1.Volume; if you choose to ignore these errors, turn validation off with --validate=false</p>
</blockquote>
<p>See, error message is specific: <code>unknown field &quot;claimName&quot; in io.k8s.api.core.v1.Volume</code></p>
<p>In your <code>Deployment</code> you need to nest <code>claimName</code> value one level deep inside of its <code>persistentVolumeClaim</code> key, because non-list values must be indented inside their keys (only keys starting a list such as <code>name</code> here - which begins with a dash - don't have to be indented):</p>
<pre><code>  volumes:
  - name: task-pv-storage
    persistentVolumeClaim:
      claimName: task-pv-claim  # fix is here
</code></pre>
<p>But you did</p>
<pre><code>  volumes:
  - name: task-pv-storage
    persistentVolumeClaim:
    claimName: task-pv-claim  # invalid
</code></pre>
<p>Which makes your Deployment object invalid</p>
