<p>I am using Docker Desktop to run the voting app, I am following the <a href="https://birthday.play-with-docker.com/kubernetes-docker-desktop/" rel="nofollow noreferrer">tutorial</a>  the link in the command line is deprecated  :</p>
<pre><code>kubectl apply -f https://raw.githubusercontent.com/docker/docker-birthday/master/resources/kubernetes-docker-desktop/vote.yaml
</code></pre>
<p>So I tried to use the link from this repo :</p>
<pre><code>kubectl apply -f https://github.com/dockersamples/docker-fifth-birthday/blob/master/kubernetes-desktop/kube-deployment.yml
</code></pre>
<p>But this error keeps on popping :</p>
<pre><code>error: error parsing https://github.com/dockersamples/docker-fifth-birthday/blob/master/kubernetes-desktop/kube-deployment.yml: error converting YAML to JSON: YAML: line 92: mapping values are not allowed in this context
</code></pre>
<pre class="lang-yaml prettyprint-override"><code>
---
apiVersion: v1
kind: Service
metadata:
  name: result
  labels:
    app: result
spec:
  type: LoadBalancer
  ports:

</code></pre>
<p>what am I doing wrong?</p>

Jinja_dude
<p>I tried to do a get the file to my local to execute but got the same error as 92 line using wget <a href="https://github.com/dockersamples/docker-fifth-birthday/blob/master/kubernetes-desktop/kube-deployment.yml" rel="nofollow noreferrer">https://github.com/dockersamples/docker-fifth-birthday/blob/master/kubernetes-desktop/kube-deployment.yml</a>. However, I tried just did a copy/paste of the content and it creates services fine but there are 2 issues with the project.</p>
<ol>
<li>the apiversion in deployment is apps/v1beta it needs to be apps/v1 as per documentation. <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/workloads/controllers/deployment/</a></li>
<li>There are places where the selectors have not been mentioned in the deployments which is why the deployments are not getting created, you might need to fix it. To elaborate, the selectors in the deployments(spec section) have to match the labels of the service (metadata). Below is a working version of service/deployment from the project mentioned.</li>
</ol>
<p>On why you would do that? every deployment will run a set of pods,it will Maintain a set of identical pods, ensuring that they have the correct config and that the right number and to access these you will expose a service. these services will look up the deployment based on these labels.</p>
<p>If you are looking for learning material, you can check the official documentation below.
<a href="https://kubernetes.io/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive/" rel="nofollow noreferrer">https://kubernetes.io/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive/</a></p>
<pre><code>--- 
apiVersion: v1
kind: Service
metadata: 
  labels: 
    app: redis
  name: redis
spec: 
  clusterIP: None
  ports:
    - name: redis
      port: 6379
      targetPort: 6379
  selector: 
    app: redis
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
  name: redis
  labels:
    app: redis
spec:
  selector:
    matchLabels:
      app: redis
  replicas: 1
  template:
    metadata:
      labels:
        app: redis
    spec:
      containers:
      - name: redis
        image: redis:alpine
        ports:
        - containerPort: 6379
          name: redis

</code></pre>
