<p>I get the following error when trying to use the YAML file from my GitRepo to deploy to kube cluster.
<a href="https://i.stack.imgur.com/mCOSR.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/mCOSR.jpg" alt="Console errors" /></a></p>
<p>Here is the content of my .yaml file:</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: ts-service
spec:
  type: NodePort
  selector:
    app: ts
  ports:
  - protocol: TCP
    port: 8080
    nodePort: 8080

---

apiVersion: apps/v1
kind: Deployment
metadata:
  name: ts-deployment
  labels:
    app: ts
spec:
  replicas: 2
  selector:
    matchLabels:
      app: ts
  template:
    metadata:
      labels:
        app: ts
    spec:
      containers:
      - name: ts
        image: $DOCKER_IMAGE_NAME:$BUILD_NUMBER
        ports:
        - containerPort: 8080
</code></pre>
<p>I've already tried changing the ports, the API version to apps/v1, etc.
What seems weird to me is that no matter which line goes foirst in the file, it always shows me the same issue.
What can be causing this?</p>

Abraham
<p>I found the root cause of this behaviour.
Jackson 2 API plugin version 2.11.1 is breaking kube deployments; you can find more info by the link below: <br>
<a href="https://issues.jenkins-ci.org/browse/JENKINS-62995" rel="nofollow noreferrer">https://issues.jenkins-ci.org/browse/JENKINS-62995</a></p>
<p>Downgrading the following plugins worked for me:
Jackson 2 API v2.10.0,<br>
Kubernetes v1.21.3,<br>
Kubernetes Client API v4.6.3-1,<br>
Kubernetes Continuous Deploy v2.1.2,<br>
Kubernetes Credentials v0.5.0<br></p>
<p>As those plugins are default, you would need to find the relevant version source files in <a href="https://plugins.jenkins.io/" rel="nofollow noreferrer">https://plugins.jenkins.io/</a>, and upload them to your Jenkins server by going <br>
Manage Jenkins --&gt; Manage Plugins --&gt; Advanced --&gt; Upload Plugin section</p>
