Workaround for k8s dashboard URL with k8s client proxy #12866
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The change to route CLI requests for k8s via a local client proxy broke the
juju dashboard
command since the CLI considers the API address it connects to aslocalhost
and that's what's printed as the dashboard URL.This PR is a workaround for the majority of cases where the controller API address is reachable (the dashboard is served from the controller). If the API address is
localhost
, the dashboard command looks up the actual controller IP address and prints that instead. This won't work for minikube or kind where the client proxy is needed, but fixes the regression on microk8s and most other k8s clouds.QA steps
bootstrap microk8s
Also tested on LXD for completeness.
Bug reference
https://bugs.launchpad.net/juju/+bug/1923141