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

RBAC addon only returns User "system:anonymous" #4765

Closed
yanksyoon opened this issue Dec 2, 2024 · 1 comment
Closed

RBAC addon only returns User "system:anonymous" #4765

yanksyoon opened this issue Dec 2, 2024 · 1 comment

Comments

@yanksyoon
Copy link

yanksyoon commented Dec 2, 2024

Summary

  • Interacting with microk8s using the KubeConfig generated through microk8s config only returns system:anonymous.

What Should Happen Instead?

  • The correct user roles system:masters system:authenticated should be returned.

Reproduction Steps

  1. Install microk8s, install config (microk8s config > ~/.kube/config)
  2. Using the following script, interact with the microk8s control plane. (pip install lightkube)
from lightkube import Client, KubeConfig
import lightkube
import lightkube.resources
import lightkube.resources.authentication_v1
config = KubeConfig.from_file("~/.kube/config")
c = Client(config=config)
list(c.list(lightkube.resources.core_v1.Namespace))

This results in the following API error

lightkube.core.exceptions.ApiError: namespaces is forbidden: User "system:anonymous" cannot list resource "namespaces" in API group "" at the cluster scope

Introspection Report

Can you suggest a fix?

Are you interested in contributing with a fix?

@yanksyoon
Copy link
Author

Probably due to gtsystem/lightkube#78. Closing, thanks @berkayoz for looking into it!

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

1 participant