I can't link to the code directly because it's a private project, but I'm simply trying to add a CustomResource to a Helm chart. Under src/main/jkube/virtual-service-cr.yml I have the following:
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: project-vs
spec:
gateways:
- istio-system/gateway-example-com
hosts:
- project.example.com
http:
- route:
- destination:
host: project
port:
number: 8080
And I have added the helm goal to my executions. The k8s:resource goal works well, until it gets to k8s:helm:
Failed to execute goal org.eclipse.jkube:kubernetes-maven-plugin:1.2.0:helm (default-cli) on project project: Failed to load kubernetes YAML /<project>/target/classes/META-INF/jkube/kubernetes.yml. com.fasterxml.jackson.databind.JsonMappingException: No resource type found for:networking.istio.io/v1alpha3#VirtualService
[ERROR] at [Source: UNKNOWN; line: -1, column: -1] (through reference chain: io.fabric8.kubernetes.api.model.KubernetesList["items"]->java.util.ArrayList[2])
I don't need any enricher support or anything fancy as in #427 . I just need the CustomResource to be added to the Helm chart .tgz.
1.2.0mvn -v) : Apache Maven 3.6.3
Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.2", GitCommit:"52c56ce7a8272c798dbc29846288d7cd9fbae032", GitTreeState:"clean", BuildDate:"2020-04-16T11:56:40Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.14", GitCommit:"4d62230f10af41cec2851b5b113874f6d2098297", GitTreeState:"clean", BuildDate:"2021-03-22T23:01:55Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}
This issue might have been fixed in #690 #688 #689
Could you try to reproduce by using the latest snapshot:
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</pluginRepository>
</pluginRepositories>
<!-- ... -->
<plugin>
<groupId>com.github.eclipse.jkube</groupId>
<artifactId>kubernetes-maven-plugin</artifactId>
<version>master-SNAPSHOT</version>
</plugin>
Hi @manusa , thanks for your answer.
I added the jitpack repo to my pom and changed the version of the artifact, but now I'm getting an error due to a class being missing:
[ERROR] Failed to execute goal com.github.eclipse.jkube:kubernetes-maven-plugin:master-f5069b21b0-1:resource (default-cli) on project <project>: Execution default-cli of goal com.github.eclipse.jkube:kubernetes-maven-plugin:master-f5069b21b0-1:resource failed: A required class was missing while executing com.github.eclipse.jkube:kubernetes-maven-plugin:master-f5069b21b0-1:resource: org/eclipse/jkube/kit/common/KitLogger
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>com.github.eclipse.jkube:kubernetes-maven-plugin:master-SNAPSHOT
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:<repository>/com/github/eclipse/jkube/kubernetes-maven-plugin/master-f5069b21b0-1/kubernetes-maven-plugin-master-f5069b21b0-1.jar
[ERROR] urls[1] = file:<repository>/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
I can tell that the missing class is in the original artifact group, which is org.eclipse.jkube, whereas the snapshot is on com.github.eclipse.jkube. I tried adding some jkube-kit 1.2.0 dependencies into my pom, but the error persists.
I will try again, but I think I managed to make the JitPack releases work (are you sure you included both repository entries?).
In the meantime, we just released 1.3.0. Could you confirm if the issue was fixed for you?
I just updated to 1.3.0 and the helm issue went away. The istio VirtualService is passed through to the helm chart .tgz directly without any issues. Thanks!
Most helpful comment
I just updated to 1.3.0 and the helm issue went away. The istio VirtualService is passed through to the helm chart .tgz directly without any issues. Thanks!