<p>I am following Cloud Guru K8S course and have issues with the template they provided. I can't see what’s wrong.</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: blue-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      app: bluegreen-test
      color: blue
  template:
    metadata:
      labels:
        app: bluegreen-test
        color: blue
    spec:
      containers:
      - name: nginx
        image: linuxacademycontent/ckad-nginx:blue
        ports:
        - containerPort: 80
</code></pre>
<p>When I run</p>
<pre><code>kubectl apply -f my-deployment.yml
</code></pre>
<p>I get</p>
<pre><code>error: error parsing blue-deployment.yml: error converting YAML to JSON: yaml: line 4: found character that cannot start any token
</code></pre>
<p>What's wrong with this template? It's nearly identical to the official example deployment definition <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#creating-a-deployment" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#creating-a-deployment</a></p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  labels:
    app: nginx
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.14.2
        ports:
        - containerPort: 80
</code></pre>

jedi
<p>Your template is correct, it's just YAML that's complaining. YAML doesn't accept tabs, only 2 spaces. If you copied + pasted, it could have caused a discrepancy. If you want to stay on terminal, <code>vim my-deployment.yml</code> and make sure each &quot;tab&quot; is 2 spaces. This is quite time-consuming especially in vim so the alternative is to use a text editor like Sublime Text to update it.</p>
