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

+2 votes

I'm getting an error when i try to create a pod

kubectl create -f app-deployment.yaml

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

my yaml file

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: app1
spec:
  replicas: 2
  template:
    metadata:
      labels:
        app: app1
    spec:
      containers:
      - name: app1
        image: dockersamples/static-site
        env:
        - name: AUTHOR
          value: app1
        ports:
        - containerPort: 80
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: app2
spec:
  replicas: 2
  template:
    metadata:
     labels:
        app: app2
   spec:
     containers:
      - name: app2
        image: dockersamples/static-site
        env:
        - name: AUTHOR
          value: app2
        ports:
        - containerPort: 80o

I have no idea what the issue is?

Sep 20, 2018 in Kubernetes by Hannah
• 14,080 points

edited Sep 20, 2018 by Hannah 235 views
Can you please update the question and add your app-deploymnet.yaml file!
This error usually occurs when there is a mistake in the yaml file most of the times tying mistake.

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes
This error usually occurs when there's a mistake in your yaml file, either spelling or tying error.

And that's exactly whats happened in your case, Check the last line of your yaml file

 - containerPort: 80o

it should be

 - containerPort: 80
answered Sep 20, 2018 by Kalgi
• 35,800 points

Related Questions In Kubernetes

0 votes
4 answers

Error saying "Unable to connect to the server: x509: certificate signed by unknown authority"

Append kubectl get all command with --insecure-skip-tls-verify=true This did ...READ MORE

answered Apr 23 in Kubernetes by Joshua
1,897 views
0 votes
1 answer
0 votes
3 answers

Error while joining cluster with node

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

answered Jan 17 in Others by anonymous
491 views
+3 votes
1 answer
0 votes
1 answer

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.