-
Notifications
You must be signed in to change notification settings - Fork 598
Updated to use default Kubernetes client discovery logic #3432
Updated to use default Kubernetes client discovery logic #3432
Conversation
Hopefully this addresses part of what was asked for in #3259 |
I haven't looked at the code yet, but does this PR relate to the issue listed here? #3259 |
Yes, I tested it in Minikube and was able to spin up a StatefulSet without the |
Ahh yeah I see you mentioned the issue right above where I mentioned the issue. Consider that a palm to forehead moment 😄 . I haven't tested the code, but It sounds like it addresses the issue after the proxy container is taken out. |
@cckellogg If you have some time could you review this? |
@nicknezis It looks like the build is failing because of checkstyle errors. |
I think the test failure might not be related to my changes. I am able to run the tests locally with success. |
//heron/schedulers/tests/java:KubernetesSchedulerTest FAILED in 1.2s Unit tests should be normally stable. Let me trigger another build and see. |
Looks like it failed again. I'll try to figure out why. Thanks! |
Is this PR ok to be accepted? |
@nicknezis LGTM. I'll wait a bit to see if anyone else has feedback. |
* Updated to use default Kubernetes client discovery logic * Removed kubectl-proxy container * Remove kubectl-proxy image property * Syntax cleanup * Added missing kubernetes dependency
* Updated to use default Kubernetes client discovery logic * Removed kubectl-proxy container * Remove kubectl-proxy image property * Syntax cleanup * Added missing kubernetes dependency
The defaultClient() call incorporates the following logic:
If
$KUBECONFIG
is defined, use that config file.If
$HOME/.kube/config
can be found, use that.If the in-cluster service account can be found, assume in cluster config.
Default to
localhost:8080
as a last resort.With this code change, we'd no longer be using the scheduler config item for K8s scheduler URI. But the config item is used to create Job Links. So I couldn't get rid of that config item.
Any thoughts on how I could fully remove the scheduler URI config item?
Do you think the defaultClient() code is good enough? It seemed to work in my Minikube testing and I figured worst case that last option would point to kubectl-proxy if we update it to use port 8080. I assume if someone needs to run the Heron API Server outside of the k8s cluster, then can configure with the
$KUBECONFIG
environment variable.