The How Kubernetes works under the hood with Docker Desktop | Docker blog post is informative; however, the examples are broken because the code snippets mix tabs and spaces and that’s not valid YAML.
For example, if you copy the following Kubernetes Service YAML snippet from the 2. Deploying and accessing applications section and paste into yq command then you get get the following error.
# Gotcha: This is broken because mixes tabs and spaces—see _2. Deploying and accessing applications_ section of https://www.docker.com/blog/how-kubernetes-works-under-the-hood-with-docker-desktop/.
---
apiVersion: v1
kind: Service
metadata:
name: tutorial
spec:
ports:
- name: 80-tcp
port: 80
protocol: TCP
targetPort: 80
selector:
com.docker.project: tutorial
type: LoadBalancer
status:
loadBalancer: {}
Then you get the following error.
$ pbpaste | yq
Error: bad file '-': yaml: line 7: found a tab character that violates indentation
If you look at the YAML document in a text editor like Sublime Text, then you can notice the mixed tabs and spaces—see screenshot.
Request: Please coordinate with Anca Iordache or someone else and fix those YAML snippets, since the article is very helpful; however, the broken YAML does affect the correctness of the examples.