Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define property for skipping cluster autodetect mode and go straight to the Kubernetes offline mode #548

Closed
nightswimmings opened this issue Jan 26, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@nightswimmings
Copy link

It would be nice if we could tell JKube to work offline on resources and push goals at least,
so it skips the cluster autodetect mode, which can fail with ugly stacktraces if the environment has a cluster but semiconfigured (for instant the aws credentials), and go straight to Kubernetes mode like the regular fallback does.
This prevents any unwanted interaction with the local cluster

Thanks mates!

@manusa manusa added the enhancement New feature or request label Jan 26, 2021
@manusa manusa added this to the 1.2.0 milestone Jan 26, 2021
@manusa manusa modified the milestones: 1.2.0, 1.3.0 Mar 23, 2021
@manusa manusa modified the milestones: 1.3.0, 1.4.0 May 5, 2021
@rohanKanojia
Copy link
Member

Are you referring to this stacktrace:

[WARNING] k8s: Cannot access cluster for detecting mode: Unknown host kubernetes.default.svc: Name or service not known

This seems to be coming from here
https://github.com/eclipse/jkube/blob/b7335940a71fe16581773da51f3d1b08f2050793/jkube-kit/config/service/src/main/java/org/eclipse/jkube/kit/config/service/JKubeServiceHub.java#L96-L100

If we wrap this client initialization in an if-else block we should be able to get rid of these warnings

if (shallConnectToK8sCluster) { 
  this.client = clusterAccess.createDefaultClient(); 
}

rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Jun 16, 2021
…t/offline mode

+ Add a property `jkube.offline` which which jkube would skip
  cluster auto detection and go straight to offline mode.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Jun 16, 2021
…t/offline mode

+ Add a property `jkube.offline` which which jkube would skip
  cluster auto detection and go straight to offline mode.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Jun 21, 2021
…t/offline mode

+ Add a property `jkube.offline` which which jkube would skip
  cluster auto detection and go straight to offline mode.
+ Update integration tests to use jkube.offline flag to reduce build time

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
@manusa manusa closed this as completed in 0af0925 Jun 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants