<p>I am new to kubernetes I am writing a yml file to create a deployment. I am crating deployment by running this command &quot;kubectl create -f backend-deployment.yml&quot; but I keep getting this error:
&quot;error: error parsing backend-deployment.yml: error converting YAML to JSON: yaml: line 16: did not find expected '-' indicator&quot;</p>
<p>line 16 is - name: django-react-ecommerce-master_backend_1</p>
<p>following is my backend-deployment.yml file:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name : backend-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      component: backend
  template:
    metadata:
      labels:
        component: backend
    spec:
      containers:
        - name: django-react-ecommerce-master_backend_1
        ports:
          - containerPort: 8000

</code></pre>

Usama Hameed
<p>The problem comes from the line below, you have an indentation problem there. <code>ports</code> should be at the same level than <code>name</code>.</p>
<pre class="lang-yaml prettyprint-override"><code># indent the port bloc   
    spec:
      containers:
        - name: django-react-ecommerce-master_backend_1
          ports:
          - containerPort: 8000
</code></pre>
