Hello All, I am practicing CKA labs... Reg: Quiz No: 8 (Practice Test Role Ba . . .

Raja g:
Hello All,

I am practicing CKA labs…

Reg: Quiz No: 8 (Practice Test Role Based Access Control)

As per question:
A user dev-user is created. User’s details have been added to the kubeconfig file. Inspect the permissions granted to the user. Check if the user can list pods in the default namespace.

Here I checked in the kubeconfig file (i.e. .kube/config) there was no dev-user added(I could not find the dev-user added)…

Could you correct/help me, if I am looking into wrong place/file…

Where exactly the dev-user added…

Thanks in advance…

Tej_Singh_Rana:
You can find the definition of user in k8s from this page.
https://kubernetes.io/docs/reference/access-authn-authz/authentication/#users-in-kubernetes
Discussion: https://community.kodekloud.com/t/trying-to-understand-the-roles-and-role-and-binding-concept-user-we-are-bind/15367/5

Raja g:
Hello Tej,

Thanks for quick response…

I got it… that users will added into kubeconfig file(i.e. .kube/config) under “Users” section – True…

Still did not clear my question here: probably I did not present my question in correct wat…

As per question: A user dev-user is created. User’s details have been added to the kubeconfig file

But, when I checked into kubeconfig file(.kube/config)… “dev-user” was not added under “Users” section…
So where it was added then…

please see the screen print for the same…
correct me if I am looking into wrong place
image.png

Tej_Singh_Rana:
Hello, @Raja g
I understood your issue. We will update this one.
https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#-em-set-credentials-em-

Tej_Singh_Rana:
As of now, if you wanna see dev-user in the kubeconfig file, run the below command.

kubectl config set-credentials dev-user --client-certificate=/etc/kubernetes/pki/users/dev-user/dev-user.crt --client-key=/etc/kubernetes/pki/users/dev-user/dev-user.key --embed-certs=true

Raja g:
Thanks Tej… it worked…

Still im in doubt… as there was no dev-user in kubeconfig file… How it was worked…