-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request juju#14615 from ycliuhw/fix/lp-1989160
juju#14615 Currently, only model super users can SSH/SCP for k8s models because the current implementation uses the model credential to call the exec API. This PR ensures the model operator creates a set of RBAC resources for exec purposes and changes the SSH/SCP command to use the new service account token. This allows any users having a model admin role to use SSH/SCP for k8s models. - [x] Code style: imports ordered, good names, simple structure, etc - [x] Comments saying why design decisions were made - [x] Go unit tests, with comments saying what you're testing - [ ] ~[Integration tests](https://github.com/juju/juju/tree/develop/tests), with comments saying what you're testing~ - [ ] ~[doc.go](https://discourse.charmhub.io/t/readme-in-packages/451) added or updated in changed packages~ ## QA steps ```console $ juju bootstrap microk8s k1 $ juju add-model t1 $ mkubectl -ncontroller-k1 get sa/model-exec NAME SECRETS AGE model-exec 1 3m55s $ mkubectl -nt1 get sa/model-exec NAME SECRETS AGE model-exec 1 3m51s $ juju deploy snappass-test $ juju ssh -m k1:controller 0 # env | grep HOSTNAME HOSTNAME=controller-0 $ juju ssh -m k1:t1 snappass-test/0 # env | grep HOSTNAME HOSTNAME=snappass-test-0 $ juju add-user u-read $ juju add-user u-write $ juju add-user u-admin $ juju grant u-write write t1 $ juju grant u-read read t1 $ juju grant u-admin admin t1 $ juju logout --force Logged out. You are no longer logged into any controllers. $ juju login -u u-read -c k1 please enter password for u-read on k1: Welcome, u-read. You are now logged into "k1". Current model set to "admin/t1". $ juju ssh -m k1:admin/t1 snappass-test/0 ERROR permission denied (unauthorized access) $ juju logout --force Logged out. You are no longer logged into any controllers. $ juju login -u u-write -c k1 please enter password for u-write on k1: Welcome, u-write. You are now logged into "k1". Current model set to "admin/t1". $ juju ssh -m k1:admin/t1 snappass-test/0 ERROR permission denied (unauthorized access) $ juju logout --force Logged out. You are no longer logged into any controllers. $ juju login -u u-admin -c k1 please enter password for u-admin on k1: Welcome, u-admin. You are now logged into "k1". Current model set to "admin/t1". $ juju ssh -m k1:admin/t1 snappass-test/0 # env | grep HOSTNAME HOSTNAME=snappass-test-0 ``` ## Documentation changes No ## Bug reference https://bugs.launchpad.net/juju/+bug/1989160
- Loading branch information
Showing
27 changed files
with
1,581 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.