Wednesday, November 18, 2020

ERROR: Can't construct a java object for tag:yaml - Kubernetes Jenkins Deployment issue

ERROR: Can't construct a java object for tag:yaml.org,2002:io.kubernetes.client.openapi.models.V1Deployment; exception=Class not found: io.kubernetes.client.openapi.models.V1Deployment

 in 'reader', line 1, column 1:
    apiVersion: apps/v1
 

Caused by: hudson.remoting.ProxyException: org.yaml.snakeyaml.error.YAMLException: Class not found: io.kubernetes.client.openapi.models.V1Deployment at org.yaml.snakeyaml.constructor.Constructor.getClassForNode(Constructor.java:664) at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.getConstructor(Constructor.java:322) at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.construct(Constructor.java:331) ... 30 more

Fix/Workaround:
Try the deployment in Jenkins slave node instead of deploying from Jenkins Master.

2 comments:

  1. I have found the solution to this problem. I have tried many times and it's working perfectly. Kubernetes CD plugin should be Version 1.0. No need to downgrade other plugins.

    Kindly hit this [link|https://updates.jenkins.io/download/plugins/kubernetes-cd/1.0.0/kubernetes-cd.hpi] to download the version 1.0.0 .hpi file of the Kubernetes cd plugin from the official Jenkins plugin site.

    Reference - https://plugins.jenkins.io/kubernetes-cd/#releases

    ReplyDelete

How to Setup Self-Hosted Linux Docker Build Agent in Azure DevOps | How to configure Self-Hosted Linux Docker Agents in Azure Pipelines | Create Custom Build Agents in Azure DevOps

  Let us learn how to configure a self-hosted agent using Docker in Azure DevOps pipelines. What is an Agent? An agent is computing infrastr...