Jkube: KubernetesClientException: Namespace mismatch error when specifying namespace in configuration

Created on 3 Mar 2021  路  8Comments  路  Source: eclipse/jkube

Description

Info

  • Eclipse JKube version : 1.1.1
  • Maven version (mvn -v) : Apache Maven 3.6.3

  • Kubernetes : v1.19.3 on Windows 10 with Docker Desktop

  • If it's a bug, how to reproduce : mvn clean package k8s:deploy or k8s:apply

  • If it's a feature request, what is your use case :

  • Sample Reproducer Project : [GitHub Clone URL]

In my pom.xml I put namespace tag under my configuration, like this:

<plugins>
<plugin>
<groupId>org.eclipse.jkube</groupId>
<artifactId>kubernetes-maven-plugin</artifactId>
<version>${jkube.version}</version>
<configuration>
<verbose>true</verbose>
<namespace>mynamespace</namespace>
...

And this is the stacktrace:

There is the stacktrace:
[INFO] k8s: Using Kubernetes at https://kubernetes.docker.internal:6443/ in namespace default with manifest C:UsersD.ZagagnoniWorkspacesmyservicetargetclassesMETA-INFjkubekubernetes.yml
[INFO] k8s: Creating a Service from kubernetes.yml namespace default name myservice
[ERROR] k8s: Failed to create Service from kubernetes.yml. io.fabric8.kubernetes.client.KubernetesClientException: Namespace mismatch. Item namespace:mynamespace. Operation namespace:default.

Thanks for the support to @rohanKanojia

bug

Most helpful comment

Yes, I confirm! Thanks for the support!

All 8 comments

What's strange is that jkube.namespace property seems to work fine but when we specify namespace in configuration like mentioned above, it throws this error

In fact for the moment I solved it by inserting the property as you suggest. Thanks for the support

Before #586 Namespace was read using properties in the service layer (#570 #582).

Are we sure this issue is still present in master?

Looks like this issue is not present in master. I'm not able to reproduce this with 1.2.0-SNAPSHOT

Should we close this then?

To be closed after 1.2.0 release.

Hi @dzagagnoni
Could you please confirm that the issue is no longer present in the newer release (1.2.0)?

Yes, I confirm! Thanks for the support!

Was this page helpful?
0 / 5 - 0 ratings