<p>I am doing a lab about kubernetes in google cloud.<br>
I have create the YAML file, but when I am trying to deploy it a shell shows me this error:  </p>

<pre><code>error converting YAML to JSON: yaml: line 34: did not find expected key
</code></pre>

<p>YAML file:</p>

<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx
  labels:
    app: nginx
spec:
  replicas: 2
  selector:
    matchLabels:
      app: nginx
    spec:
      volumes:
      - name: nginx-config
        configMap:
          name: nginx-config
      - name: php-config
        configMap:
          name: php-config
      containers:
      - image: php-fpm:7.2
        name: php
        ports:
        - containerPort: 9000
        volumeMounts:
        - name: persistent-storage
          mountPath: /var/www/data
        - name: php-config
          mountPath: /usr/local/etc/php-fpm.d/www.conf
          subPath: www.conf
      - image: nginx:latest
        name: nginx
        - containerPort: 80
        volumeMounts:
        - name: persistent-storage
          mountPath: /var/www/data
        - name: nginx-config
          mountPath: /etc/nginx/nginx.conf
          subPath: nginx.conf
      volumes:
        - name: persistent-storage
          persistentVolumeClaim:
            claimName: nfs-pvc
</code></pre>

<p>yamllint package is useful to debug and find this kind of errors, just do <code>yamllint filename</code> and it will list the possible problems it finds. Install via your distro package manager (usually recommended if available) or via the below npm install command (it will install globally)</p>

<p><code>npm install -g yaml-lint</code></p>

<p>Thanks to Kyle VG for the npm command</p>
