Kubernetes Deep Dive Room

Sign Up Free or Log In to participate!

error: error parsing gke-volpod.yml: error converting YAML to JSON: yaml

Within the Kubernetes Deep Dive storage lesson I am getting a gke-volpod.yml parsing error?

error: error parsing gke-volpod.yml: error converting YAML to JSON: yaml: line 8: mapping values are not allowed in this context

1 Answers

I figured out the YAML validation and parsing errors and refactored gke-volpod.yml to this (remember to indent appropriately and modify bullets to dashes):

apiVersion: v1

kind: Pod

metadata:

name: volpod

spec:

containers:

  • name: ubuntu-ctr

image: ubuntu:latest

command:

  • /bin/bash

  • "-c"

  • "sleep 60m"

imagePullPolicy: IfNotPresent

volumeMounts:

  • mountPath: /data

name: data

volumes:

  • name: data

persistentVolumeClaim:

claimName: pvc1

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?