balchua / microk8s-actions

Bootstrap MicroK8s with Github Actions
34 stars 9 forks source link

Github Actions user not added to microk8s group #6

Closed knkski closed 3 years ago

knkski commented 3 years ago

I have a Github Action that looks like this:

    - uses: balchua/microk8s-actions@v0.2.1
      with:
        channel: 'latest/stable'

    - name: Test user added
      run: id

That results in this output for the Test user added step:

uid=1001(runner) gid=116(docker) groups=116(docker),4(adm),101(systemd-journal)

I would expect to see the microk8s group listed in there. This might be related to #5, but it's hard to tell without the set('-v'); option set.

balchua commented 3 years ago

The user is added to the group, but it needs to "relogin" to take effect. Im still trying to figure out how to relogin the use with shelljs.

For the meantime, i use sg microk8s -c 'microk8s enable kubeflow' when enabling an addon which requires non root.

balchua commented 3 years ago

In order to execute microk8s command which cannot be run with sudo, use the sg command instead.
The runner user is added to the microk8s group, although it doesnt show up when you do id, since one needs to relogin in the terminal.