<p>Hi got a YAML that seems valid to me but it does not work when applying it and I can't figure out what is wrong with it</p>
<p>error:</p>
<pre><code>unknown field &quot;spec.template.spec.volumes[0].PersistentVolumeClaim&quot;
</code></pre>
<p>kubeval deployment.yaml passes with no errors</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-app-service
  namespace: app-1-0
  labels:
    app: app-service
spec:
  replicas: 1
  selector:
    matchLabels:
      app: my-service
  template:
    metadata:
      labels:
        app: my-service
    spec:
      containers:
        - name: my-service
          image: registry.azurecr.io/app/app-service:1.0
          env:
          - name: AzureAd__Instance
            value: ...
          - name: AzureAd__ClientId
            value: ...
          - name: AzureAd__TenantId
            value: ...
          imagePullPolicy: Always
          ports:
            - containerPort: 8080
              name: http
          volumeMounts:
            - mountPath: &quot;/mnt/data&quot;
              name: cache
      dnsPolicy: ClusterFirst
      volumes:
      - name: cache
        PersistentVolumeClaim:
          claimName: app-pvc
</code></pre>

Jester
<p>Note that <code>persistentVolumeClaim</code> should be lowercased and specified as a nested object under volumes.</p>
<pre><code>volumes:
  - name: cache 
    persistentVolumeClaim:
      claimName: app-pvc
</code></pre>
