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

Can not access Juju Dashboard k8s #1824

Open
aataibi opened this issue Dec 9, 2024 · 2 comments
Open

Can not access Juju Dashboard k8s #1824

aataibi opened this issue Dec 9, 2024 · 2 comments

Comments

@aataibi
Copy link

aataibi commented Dec 9, 2024

Describe the bug
Following this guide, juju dashboard command returns an error and fails to proxy the dashboard.
I think the issue is because it's trying to access the apiserver using the Cluster IP.
I tried to change the svc type from ClusterIP to LoadBalancer but that didn't help as the external IP is not picked up by juju.

juju dashboard --debug
11:58:27 INFO  juju.cmd supercommand.go:56 running juju [3.6.0 6dec77a01480916689430d38ef3e032cb1e06b78 gc go1.23.3]
11:58:27 DEBUG juju.cmd supercommand.go:57   args: []string{"/snap/juju/29130/bin/juju", "dashboard", "--debug"}
11:58:27 INFO  juju.juju api.go:86 connecting to API addresses: [10.152.183.225:17070]
11:58:27 INFO  juju.kubernetes.klog klog.go:113 Use tokens from the TokenRequest API or manually created secret-based tokens instead of auto-generated secret-based tokens.%!(EXTRA []interface {}=[])
11:58:27 DEBUG juju.api apiclient.go:509 starting proxier for connection
11:58:27 DEBUG juju.api apiclient.go:513 tunnel proxy in use at localhost on port 38855
11:58:27 DEBUG juju.api apiclient.go:1036 successfully dialed "wss://localhost:38855/api"
11:58:27 INFO  juju.api apiclient.go:938 cannot resolve "localhost": lookup localhost: operation was canceled
11:58:27 INFO  juju.api apiclient.go:571 connection established to "wss://localhost:38855/api"
11:58:57 DEBUG juju.api monitor.go:35 RPC connection died
ERROR running connection runner: starting tunnel proxy: connecting k8s proxy: Get "https://10.152.183.1:443/api/v1/namespaces/controller-microk8s-controller/services/dashboard": dial tcp 10.152.183.1:443: i/o timeout
11:58:57 DEBUG cmd supercommand.go:549 error stack: 
Get "https://10.152.183.1:443/api/v1/namespaces/controller-microk8s-controller/services/dashboard": dial tcp 10.152.183.1:443: i/o timeout
github.com/juju/juju/caas/kubernetes/provider/proxy.(*Proxier).Start.func1:117: connecting k8s proxy
github.com/juju/juju/cmd/juju/dashboard.(*dashboardCommand).Run.tunnelProxyRunner.func4:261: starting tunnel proxy
github.com/juju/juju/cmd/juju/dashboard.(*dashboardCommand).Run.func3:177: running connection runner
github.com/juju/juju/cmd/juju/dashboard.(*dashboardCommand).Run:194: 
kubectl get svc 
NAME         TYPE           CLUSTER-IP     EXTERNAL-IP      PORT(S)         AGE
kubernetes   LoadBalancer   10.152.183.1   10.124.203.244   443:31265/TCP   6d18h

To Reproduce

juju add-model microk8s
juju deploy -m microk8s microk8s --channel 1.28/stable
juju exec --unit microk8s/leader -- microk8s config > ~/.kube/config
juju add-k8s microk8s-cloud
juju bootstrap microk8s-cloud microk8s-controller
juju switch microk8s-controller:admin/controller
juju deploy juju-dashboard-k8s dashboard
juju integrate dashboard controller
juju config dashboard juju-external-hostname=k8s-dashboard
juju expose dashboard
juju dashboard

Expected behavior
The juju dashboard command should open a connection to the dashboard and provides the dashboard address and credentials.

Workaround

  • run the command in the microk8s unit.
 juju ssh microk8s/leader
 juju dashboard
 Dashboard for controller "microk8s-controller" is enabled at:
  http://localhost:39869
Your login credential is:
  username: admin
  password: e18c93d04bdf0e39f0eb2f5f32f2e4e8
  • The service is bound to 127.0.0.1, so will need an ssh tunnel to access it.
    LISTEN 0 4096 127.0.0.1:39869 0.0.0.0:* users:(("juju",pid=457853,fd=13))
    Screenshot From 2024-12-09 12-26-09
@tlm
Copy link

tlm commented Dec 9, 2024

FYI this isn't a "bug" on the dashboard project. This is should be a bug on the Juju projector Launchpad. Have responded to @aataibi in Ubuntu Matrix about this as I think this is just a networking issue at the moment due to the complex nature of the testing steps.

@huwshimi
Copy link
Contributor

huwshimi commented Dec 9, 2024

Thanks for investigating @tlm. Let me know if there are any issues on this side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants