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

none: minikube service/dashboard should show URL instead of opening browser when run with sudo #3558

Closed
Pacheco95 opened this issue Jan 19, 2019 · 5 comments
Labels
co/none-driver good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature. priority/backlog Higher priority than priority/awaiting-more-evidence. r/2019q2 Issue was last reviewed 2019q2

Comments

@Pacheco95
Copy link

Pacheco95 commented Jan 19, 2019

Is this a BUG REPORT or FEATURE REQUEST? (choose one): BUG REPORT

Please provide the following details:

Environment:

System:    Host: MICHAEL-PC Kernel: 4.15.0-43-generic x86_64 bits: 64 compiler: gcc v: 7.3.0 
           Desktop: Cinnamon 4.0.9 wm: muffin dm: LightDM Distro: Linux Mint 19.1 Tessa 
           base: Ubuntu 18.04 bionic 
Machine:   Type: Desktop Mobo: ASUSTeK model: PRIME H370M-PLUS v: Rev 1.xx serial: <filter> 
           UEFI: American Megatrends v: 0904 date: 09/14/2018 
CPU:       Topology: 6-Core model: Intel Core i5-8600K bits: 64 type: MCP arch: Kaby Lake rev: A 
           L2 cache: 9216 KiB 
           flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 43200 
           Speed: 800 MHz min/max: 800/4300 MHz Core speeds (MHz): 1: 800 2: 800 3: 800 4: 800 
           5: 800 6: 800 
Graphics:  Device-1: NVIDIA GP104 vendor: ASUSTeK driver: nvidia v: 390.77 bus ID: 01:00.0 
           chip ID: 10de:1b82 
           Display: x11 server: X.Org 1.19.6 driver: nvidia 
           unloaded: fbdev,modesetting,nouveau,vesa resolution: 1360x768~60Hz 
           OpenGL: renderer: GeForce GTX 1070 Ti/PCIe/SSE2 v: 4.6.0 NVIDIA 390.77 
           direct render: Yes 
Audio:     Device-1: Intel vendor: ASUSTeK driver: snd_hda_intel v: kernel bus ID: 00:1f.3 
           chip ID: 8086:a348 
           Device-2: NVIDIA GP104 High Definition Audio vendor: ASUSTeK driver: snd_hda_intel 
           v: kernel bus ID: 01:00.1 chip ID: 10de:10f0 
           Device-3: C-Media CM108 Audio Controller type: USB 
           driver: hid-generic,snd-usb-audio,usbhid bus ID: 1-10:5 chip ID: 0d8c:013c 
           Sound Server: ALSA v: k4.15.0-43-generic 
Network:   Device-1: Intel Ethernet I219-V vendor: ASUSTeK driver: e1000e v: 3.2.6-k port: efa0 
           bus ID: 00:1f.6 chip ID: 8086:15bc 
           IF: eno1 state: up speed: 100 Mbps duplex: full mac: <filter> 
           IF-ID-1: docker0 state: up speed: N/A duplex: N/A mac: <filter> 
           IF-ID-2: veth055496a state: up speed: 10000 Mbps duplex: full mac: <filter> 
           IF-ID-3: veth7b6e9d3 state: up speed: 10000 Mbps duplex: full mac: <filter> 
           IF-ID-4: veth7cdd50d state: up speed: 10000 Mbps duplex: full mac: <filter> 
           IF-ID-5: vetha85a82a state: up speed: 10000 Mbps duplex: full mac: <filter> 
Drives:    Local Storage: total: 931.51 GiB used: 29.07 GiB (3.1%) 
           ID-1: /dev/sda vendor: Seagate model: ST1000DX002-2DV162 size: 931.51 GiB 
           speed: 6.0 Gb/s serial: <filter> 
Partition: ID-1: / size: 93.37 GiB used: 11.53 GiB (12.4%) fs: ext4 dev: /dev/sda7 
           ID-2: /home size: 125.40 GiB used: 17.51 GiB (14.0%) fs: ext4 dev: /dev/sda8 
Sensors:   System Temperatures: cpu: 27.8 C mobo: N/A gpu: nvidia temp: 40 C 
           Fan Speeds (RPM): cpu: 0 gpu: nvidia fan: 0% 
Repos:     No active apt repos in: /etc/apt/sources.list 
           Active apt repos in: /etc/apt/sources.list.d/additional-repositories.list 
           1: deb [arch=amd64] https: //download.docker.com/linux/ubuntu bionic stable
           Active apt repos in: /etc/apt/sources.list.d/kubernetes.list 
           1: deb https: //apt.kubernetes.io/ kubernetes-xenial main
           Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list 
           1: deb http: //mirrors.evowise.com/linuxmint/packages tessa main upstream import backport
           2: deb http: //ubuntu-archive.locaweb.com.br/ubuntu bionic main restricted universe multiverse
           3: deb http: //ubuntu-archive.locaweb.com.br/ubuntu bionic-updates main restricted universe multiverse
           4: deb http: //ubuntu-archive.locaweb.com.br/ubuntu bionic-backports main restricted universe multiverse
           5: deb http: //security.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse
           6: deb http: //archive.canonical.com/ubuntu/ bionic partner
           Active apt repos in: /etc/apt/sources.list.d/plushuang-tw-uget-stable-bionic.list 
           1: deb http: //ppa.launchpad.net/plushuang-tw/uget-stable/ubuntu bionic main
           2: deb-src http: //ppa.launchpad.net/plushuang-tw/uget-stable/ubuntu bionic main
Info:      Processes: 280 Uptime: 4h 45m Memory: 7.71 GiB used: 3.00 GiB (38.9%) Init: systemd 
           v: 237 runlevel: 5 Compilers: gcc: 7.3.0 alt: 7 Client: Unknown python3.6 client 
           inxi: 3.0.27 

Minikube version:

michael@MICHAEL-PC:~$ minikube version
minikube version: v0.33.1
  • OS:
michael@MICHAEL-PC:~$ cat /etc/os-release
NAME="Linux Mint"
VERSION="19.1 (Tessa)"
ID=linuxmint
ID_LIKE=ubuntu
PRETTY_NAME="Linux Mint 19.1"
VERSION_ID="19.1"
HOME_URL="https://www.linuxmint.com/"
SUPPORT_URL="https://forums.ubuntu.com/"
BUG_REPORT_URL="http://linuxmint-troubleshooting-guide.readthedocs.io/en/latest/"
PRIVACY_POLICY_URL="https://www.linuxmint.com/"
VERSION_CODENAME=tessa
UBUNTU_CODENAME=bioni
  • VM Driver:
michael@MICHAEL-PC:~$ sudo cat ~/.minikube/machines/minikube/config.json | grep DriverName
    "DriverName": "none",

  • ISO version:
michael@MICHAEL-PC:~$ sudo cat ~/.minikube/machines/minikube/config.json | grep -i ISO

no output

  • Install tools:
  • Others:

What happened:
I'm following this tutorial steps, but when I tried to run the command sudo minikube service hello-node it gives me this error:

Opening kubernetes service default/hello-node in default browser...
Running Firefox as root in a regular user's session is not supported.  ($HOME is /home/michael which is owned by michael.)
Running Firefox as root in a regular user's session is not supported.  ($HOME is /home/michael which is owned by michael.)
Running Firefox as root in a regular user's session is not supported.  ($HOME is /home/michael which is owned by michael.)
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: iceweasel: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: seamonkey: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: mozilla: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: epiphany: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: konqueror: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: chromium: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: chromium-browser: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: google-chrome: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: www-browser: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: links2: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: elinks: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: links: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: lynx: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: w3m: not found
xdg-open: no method available for opening 'http://192.168.2.110:32295'

Note: I can't run this command without sudo because permission denied error

What you expected to happen:
I don't know what does this command.

How to reproduce it (as minimally and precisely as possible):
The commands that I typed:

michael@MICHAEL-PC:~$ sudo kubectl create deployment hello-node --image=gcr.io/hello-minikube-zero-install/hello-node
deployment.apps/hello-node created

michael@MICHAEL-PC:~$ sudo kubectl get deployments
NAME         READY   UP-TO-DATE   AVAILABLE   AGE
hello-node   0/1     1            0           13s

michael@MICHAEL-PC:~$ sudo kubectl get pods         
NAME                          READY   STATUS    RESTARTS   AGE
hello-node-64c578bdf8-h4lkb   1/1     Running   0          64m

michael@MICHAEL-PC:~$ sudo kubectl get deployments
NAME         READY   UP-TO-DATE   AVAILABLE   AGE
hello-node   1/1     1            1           65m

michael@MICHAEL-PC:~$ sudo kubectl get events
LAST SEEN   TYPE      REASON    KIND   MESSAGE
33m         Normal    Pulled    Pod    Successfully pulled image "gcr.io/hello-minikube-zero-install/hello-node"
33m         Warning   Failed    Pod    Error: cannot find volume "default-token-4jlfh" to mount into container "hello-node"
33m         Normal    Pulled    Pod    Successfully pulled image "gcr.io/hello-minikube-zero-install/hello-node"
33m         Normal    Created   Pod    Created container
33m         Normal    Started   Pod    Started container

michael@MICHAEL-PC:~$ sudo kubectl config view
apiVersion: v1
clusters:
- cluster:
    certificate-authority: /home/michael/.minikube/ca.crt
    server: https://192.168.2.110:8443
  name: minikube
contexts:
- context:
    cluster: minikube
    user: minikube
  name: minikube
current-context: minikube
kind: Config
preferences: {}
users:
- name: minikube
  user:
    client-certificate: /home/michael/.minikube/client.crt
    client-key: /home/michael/.minikube/client.key

michael@MICHAEL-PC:~$ sudo kubectl expose deployment hello-node --type=LoadBalancer --port=8080
service/hello-node exposed

michael@MICHAEL-PC:~$ sudo kubectl get services
NAME         TYPE           CLUSTER-IP     EXTERNAL-IP   PORT(S)          AGE
hello-node   LoadBalancer   10.99.154.58   <pending>     8080:32295/TCP   30s
kubernetes   ClusterIP      10.96.0.1      <none>        443/TCP          3h5

michael@MICHAEL-PC:~$ sudo minikube service hello-node
Opening kubernetes service default/hello-node in default browser...
Running Firefox as root in a regular user's session is not supported.  ($HOME is /home/michael which is owned by michael.)
Running Firefox as root in a regular user's session is not supported.  ($HOME is /home/michael which is owned by michael.)
Running Firefox as root in a regular user's session is not supported.  ($HOME is /home/michael which is owned by michael.)
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: iceweasel: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: seamonkey: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: mozilla: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: epiphany: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: konqueror: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: chromium: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: chromium-browser: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: google-chrome: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: www-browser: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: links2: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: elinks: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: links: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: lynx: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: w3m: not found
xdg-open: no method available for opening 'http://192.168.2.110:32295'

Anything else do we need to know: I'm using the flag --vm-driver=none and i think I read that when this flag is used the command must be executed with sudo

@Pacheco95 Pacheco95 reopened this Jan 19, 2019
@afbjorklund
Copy link
Collaborator

You can use minikube service --url, if you want to use it with the unsupported none driver ?

--url Display the kubernetes service URL in the CLI instead of opening it in the default browser

But as long as you have the proper kube config, there is no need to run kubectl as the root user...

@tstromberg tstromberg changed the title Running Firefox as root in a regular user's session is not supported. ($HOME is /home/michael which is owned by michael.) none: minikube service/dashboard should show URL instead of opening browser when run with sudo Jan 23, 2019
@tstromberg
Copy link
Contributor

tstromberg commented Jan 23, 2019

This is kind of a dupe of #2548 - but there is something we can do to make peoples lives easier here.

The issue is that your X environment isn't configured to allow apps from one user draw in your display environment. This could also be fixed by implementing #3138 - we should be complaining very loudly when people execute minikube as root.

@tstromberg tstromberg added help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. priority/backlog Higher priority than priority/awaiting-more-evidence. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature. labels Jan 23, 2019
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 29, 2019
@tstromberg tstromberg added r/2019q2 Issue was last reviewed 2019q2 and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels May 22, 2019
@tstromberg tstromberg added the needs-solution-message Issues where where offering a solution for an error would be helpful label Jul 3, 2019
@tstromberg
Copy link
Contributor

If anyone feels interest in fixing this issue, my recommendation would be to check if the current user id is 0 and simply display the URL here:

if dashboardURLMode {

https://golang.org/pkg/os/user should help.

@dpandhi-git
Copy link
Contributor

Would like to work on it

@tstromberg tstromberg removed the needs-solution-message Issues where where offering a solution for an error would be helpful label Sep 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
co/none-driver good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature. priority/backlog Higher priority than priority/awaiting-more-evidence. r/2019q2 Issue was last reviewed 2019q2
Projects
None yet
Development

No branches or pull requests

6 participants