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,230 points
8,797 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,440 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
9,744 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,050 points
4,078 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,037 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
14,624 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,116 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,440 points
3,595 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