<p>I'm trying to add ciao to my Kubernetes single node cluster and every time I run the kubectl apply -f command, I keep running into the error &quot; error converting YAML to JSON: YAML: line 12: did not find expected key &quot;. I looked at the other solutions but they were no help. Any help will be appreciated.</p>
<pre><code>kind: Namespace
metadata:
  name: monitoring
---
apiVersion: v1
kind: Secret
metadata:
  name: ciao
  namespace: monitoring
data:
  BASIC_AUTH_USERNAME: YWRtaW4=
  BASIC_AUTH_PASSWORD: cGFzc3dvcmQ=
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: ciao
  namespace: monitoring
spec:
  replicas: 1
  template:
  metadata:
  selector:
      labels:
        app: ciao
    spec:
      containers:
      - image: brotandgames/ciao:latest
        imagePullPolicy: IfNotPresent
        name: ciao
        volumeMounts: # Emit if you do not have persistent volumes
        - mountPath: /app/db/sqlite/
          name: persistent-volume
          subPath: ciao
        ports:
        - containerPort: 3000
        resources:
          requests:
            memory: 256Mi
            cpu: 200m
          limits:
            memory: 512Mi
            cpu: 400m
        envFrom:
        - secretRef:
            name: ciao
---
apiVersion: v1
kind: Service
metadata:
  name: ciao
  namespace: monitoring
spec:
  ports:
    - port: 80
      targetPort: 3000
      protocol: TCP
  type: NodePort
  selector:
    app: ciao
</code></pre>

Jimmy Crane
<p>Looks there's an indentation in your Deployment definition. This should work:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: ciao
  namespace: monitoring
  labels:
    app: ciao
spec:
  replicas: 1
  selector:
    matchLabels:
      app: ciao
  template:
    metadata:
      labels:
        app: ciao
    spec:
      containers:
      - image: brotandgames/ciao:latest
        imagePullPolicy: IfNotPresent
        name: ciao
        volumeMounts: # Emit if you do not have persistent volumes
        - mountPath: /app/db/sqlite/
          name: persistent-volume
          subPath: ciao
        ports:
        - containerPort: 3000
        resources:
          requests:
            memory: 256Mi
            cpu: 200m
          limits:
            memory: 512Mi
            cpu: 400m
        envFrom:
        - secretRef:
            name: ciao
</code></pre>
<p>Keep in mind that in this definition the PV <code>persistent-volume</code> needs to exist in your cluster/namespace.</p>
