-
Notifications
You must be signed in to change notification settings - Fork 707
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure user client with service account backup when fetching namespac…
…es. (#5940) <!-- Before you open the request please review the following guidelines and tips to help it be more easily integrated: - Describe the scope of your change - i.e. what the change does. - Describe any known limitations with your change. - Please run any tests or examples that can exercise your modified code. Thank you for contributing! --> ### Description of the change <!-- Describe the scope of your change - i.e. what the change does. --> The main change here is to ensure that the request for namespaces uses the *user* client first, then the service account client. For a detailed analysis of the issue it is fixing, see my [comment on 5755](#5755 (comment)) While there, I have tried to clarify the code a little, so that it is clearer when the user client is being used (it now matches the comments again). I also fixed an RBAC issue in the dev environment (so that `[email protected]` is permitted to access, in addition to `oidc:[email protected]`, since the former is what pinniped uses). ### Benefits <!-- What benefits will be realized by the code change? --> Back to expected behavior when authenticated as a non-privileged user with or without a service account token configured in Kubeapps' clusters configuration. ### Possible drawbacks <!-- Describe any known limitations with your change --> ### Applicable issues <!-- Enter any applicable Issues here (You can reference an issue using #) --> - fixes #5755 ### Additional information <!-- If there's anything else that's important and relevant to your pull request, mention that information here.--> I've tested this pretty thoroughly locally with multiple clusters using both unprivileged and privileged users (with additional log lines showing exactly what token is being used when), but only in the namespaces call-site. --------- Signed-off-by: Michael Nelson <[email protected]>
- Loading branch information
1 parent
89be3e1
commit 90981b5
Showing
6 changed files
with
115 additions
and
63 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,13 @@ subjects: | |
- apiGroup: rbac.authorization.k8s.io | ||
kind: Group | ||
name: oidc:kubeapps-users | ||
# pinniped doesn't use a prefix, unlike the cluster oidc config: | ||
- apiGroup: rbac.authorization.k8s.io | ||
kind: User | ||
name: [email protected] | ||
- apiGroup: rbac.authorization.k8s.io | ||
kind: Group | ||
name: kubeapps-users | ||
--- | ||
kind: RoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
|
@@ -68,6 +75,13 @@ subjects: | |
- apiGroup: rbac.authorization.k8s.io | ||
kind: Group | ||
name: oidc:kubeapps-users | ||
# pinniped doesn't use a prefix, unlike the cluster oidc config: | ||
- apiGroup: rbac.authorization.k8s.io | ||
kind: User | ||
name: [email protected] | ||
- apiGroup: rbac.authorization.k8s.io | ||
kind: Group | ||
name: kubeapps-users | ||
--- | ||
# Currently unnecessary (when kubeapps operators are already cluster-admin) but | ||
# included to be explicit and plan to replace cluster-admin for kubeapps | ||
|