How to generate kubeconfig with limited access
Requirement I have full access kubeconfig and I want to provide a limited kubeconfig to another user, which only has access to resources in one specific namespace.
Steps Create the namespace.
1 kubectl create namespace example Create a ServiceAccount in previous namespace.
1 2 3 4 5 apiVersion:v1kind:ServiceAccountmetadata:name:example-usernamespace:example 1 kubectl create -f service_account.yaml Create Role and RoleBinding for the ServiceAccount in previous namespace.