<p>I'm following this <a href="https://digitalavenue.dev/How-To-Setup-Jenkins-On-Kubernetes/" rel="nofollow noreferrer">Link</a> to setup <code>Jenkins</code> on <code>Kubernetes</code> cluster. When I tried to apply <code>jenkins-svc.yaml</code> it fails with an error.</p>
<p><code>jenkins-svc.yaml</code> file content as follows,</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: Service
metadata:
  name: jenkins-ui-service
  namespace: jenkins
spec:
    type: ClusterIP # NodePort, LoadBalancer 
  ports:
    - protocol: TCP
      port: 8080
      targetPort: 8080
      # nodePort: 30100
      name: ui
  selector:
    app: jenkins
--- 
apiVersion: v1
kind: Service
metadata:
  name: jenkins-jnlp-service
  namespace: jenkins
spec:
    type: ClusterIP # NodePort, LoadBalancer
  ports:
    - port: 50000
      targetPort: 50000
  selector:
    app: jenkins
</code></pre>
<p>The error I get when I tried to apply <code>jenkins-svc.yaml</code>.</p>
<pre><code># kubectl  apply -f jenkins-svc.yaml -n jenkins
error: error parsing jenkins-svc.yaml: error converting YAML to JSON: yaml: line 7: did not find expected key
</code></pre>
<p>Please let me know how do I solve this issue?</p>

user4948798
<p>please check indentation of line 7 &amp; 23. remove 2 extra spaces before &quot;type&quot; in spec section for both svc.</p>
