error error parsing pod pvc yml error converting YAML to JSON yaml line 11 could not find expected

0 votes

Hi Guys,

I am new in kubernetes. I am trying to create one pod. But it shows me the below error.

apiVersion: v1
kind: Pod
metadata:
  name: httpd
  labels:
    name: httpd
spec:
  containers:
  - name: httpd-con
    image=apache-webser-php
    volumeMounts:
    - name: pvc-vol
      mountPath: /var/www/html
  volumes:
  - name: pvc-vol
    persistentVolumeClaim:
      claimName: pvc-volume
$ kubectl apply -f pod_pvc.yml
error: error parsing pod_pvc.yml: error converting YAML to JSON: yaml: line 11: could not find expected ':'
May 22, 2020 in Kubernetes by akhtar
• 38,260 points
9,215 views

1 answer to this question.

0 votes

Hi@akhtar,

In yml code, you can't use equals to sign. To assign key value pair you can use colon. In above code you have written  image=apache-webser-php. Here you have to use colon instead of equals to.

apiVersion: v1
kind: Pod
metadata:
  name: httpd
  labels:
    name: httpd
spec:
  containers:
  - name: httpd-con
    image: apache-webser-php
    volumeMounts:
    - name: pvc-vol
      mountPath: /var/www/html
  volumes:
  - name: pvc-vol
    persistentVolumeClaim:
      claimName: pvc-volume
answered May 22, 2020 by MD
• 95,460 points

Related Questions In Kubernetes

+2 votes
1 answer

Error saying "Error: error parsing app-deployment.yaml: error converting YAML to JSON"

This error usually occurs when there's a ...READ MORE

answered Sep 20, 2018 in Kubernetes by Kalgi
• 52,360 points
10,210 views
0 votes
2 answers

Error saying “Error from server (NotFound): the server could not find the requested resource”

official Documentation says: A client should be skewed ...READ MORE

answered Sep 19, 2018 in Kubernetes by Nilesh
• 7,060 points
4,359 views
0 votes
1 answer

Could not find default credentials

Use gcloud auth application-default login to login for application ...READ MORE

answered Aug 30, 2018 in Kubernetes by Kalgi
• 52,360 points
3,376 views
+1 vote
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17, 2019 in Others by anonymous
15,331 views
+4 votes
1 answer

Installing Web UI (Dashboard):kubernetes-dashboard on main Ubuntu 16.04.6 LTS (Xenial Xerus) server

Follow these steps: $ kubeadm reset $ kubeadm init ...READ MORE

answered Apr 12, 2019 in Kubernetes by Kalgi
• 52,360 points

reshown Apr 12, 2019 by Kalgi 6,946 views
0 votes
1 answer
0 votes
1 answer

Error from server (NotFound): the server could not find the requested resource

Hi@akhatr, The following error might indicate that something ...READ MORE

answered Jul 16, 2020 in Kubernetes by MD
• 95,460 points
3,964 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP