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,302 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,350 points
10,277 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,400 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,350 points
3,412 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,476 views
0 votes
1 answer

permissions related to AWS ECR

if you add allowContainerRegistry: true, kops will add those permissions ...READ MORE

answered Oct 9, 2018 in Kubernetes by Kalgi
• 52,350 points
1,396 views
0 votes
1 answer

Error getting primary cp: could not find master node, minikube is exiting due to an error

Hi@akhtar, You may receive this error when you ...READ MORE

answered May 19, 2020 in Kubernetes by MD
• 95,460 points
1,005 views
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
4,043 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