I’m back using Docker after several years away. So I followed the nice documentation “Orientation and setup” up to starting Kubernetes which is up and running fine on my Mac Pro.
Then, in order to test that part, I have cut and pasted the test pod.yaml from the docimentation and got into infinite parsing errors…
Did some research and I went to yamlint and YAML Validator to clean it up. But even with this flagged cleaned code, I still get parsing errors. I have modified the file with vi to ensure only spaces no tabs are in the test yaml file.
Original copy and pasted code from “Orientation and setup” and validated by Code Beautify:
apiVersion: v1
kind: Pod
metadata:
name: demo
spec:
containers:
- name: testpod
image: alpine:3.5
command: ["ping", "8.8.8.8"]
→ kubectl apply -f pod.yaml
error: error parsing pod.yaml: error converting YAML to JSON: yaml: line 2: mapping values are not allowed in this context
Then a clean one with no indent validated with yamlint
apiVersion: v1
kind: Pod
metadata:
name: demo
spec:
containers:
- name: testpod
image: alpine:3.5
command: [“ping”, “8.8.8.8”]
->kubectl apply -f pod.yaml
error: error validating “pod.yaml”: error validating data: [ValidationError(Pod): unknown field “command” in io.k8s.api.core.v1.Pod, ValidationError(Pod): unknown field “containers” in io.k8s.api.core.v1.Pod, ValidationError(Pod): unknown field “image” in io.k8s.api.core.v1.Pod, ValidationError(Pod): unknown field “name” in io.k8s.api.core.v1.Pod]; if you choose to ignore these errors, turn validation off with --validate=false
Seems I am lost already just a the beginning of setting things up, any idea what is wrong?
Mac OS : Mojave 10.14.2
Docker Desktop : 2.1.0.4 (39773) - stable
Kuvernetes : v1.14.7
Thanks.