How to fix the error in YAML file converting yaml to JSON? mapping values are not allowed in this context" How to fix the error in YAML file converting yaml to JSON? mapping values are not allowed in this context" kubernetes kubernetes

How to fix the error in YAML file converting yaml to JSON? mapping values are not allowed in this context"


This was a weird one. Turns out your hyphens were the wrong type :) all your instances of - were actually – (see the difference? one's longer).

Here's a working file:

apiVersion: v1kind: Servicemetadata:  name: feedback  labels:    run: feedbackspec:  ports:    - port: 80      targetPort: 3000      protocol: TCP  type: NodePort  selector:    run: feedback---apiVersion: extensions/v1beta1kind: Deploymentmetadata:  name: feedbackspec:  replicas: 1  template:    metadata:      labels:        run: feedback  spec:    containers:      - name: feedback        image: username/feedback        ports:           containerPort: 8888---apiVersion: v1kind: Servicemetadata:  name: mongo  labels:    run: mongospec:  ports:    - port: 27017      targetPort: 27017      protocol: TCP  selector:    run: mongo---apiVersion: extensions/v1beta1kind: Deploymentmetadata:  name: mongospec:  template:    metadata:      labels:        run: mongo    spec:      containers:        - name: mongo          image: mongo          ports:            - containerPort: 27017

Side note: this is definitely not node.js – please tag as kubernetes