Linux Foundation CKS Exam - Topic 1 Question 56 Discussion
Create a User named john, create the CSR Request, fetch the certificate of the user after approving it.Create a Role name john-role to list secrets, pods in namespace johnFinally, Create a RoleBinding named john-role-binding to attach the newly created role john-role to the user john in the namespace john.
To Verify:Use the kubectl auth CLI command to verify the permissions.
A) Explanation:
se kubectl to create a CSR and approve it.
Get the list of CSRs:
kubectl get csr
Approve the CSR:
kubectl certificate approve myuser
Get the certificate
Retrieve the certificate from the CSR:
kubectl get csr/myuser -o yaml
here are the role and role-binding to give john permission to create NEW_CRD resource:
kubectl apply -f roleBindingJohn.yaml --as=john
rolebinding.rbac.authorization.k8s.io/john_external-rosource-rb created
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: john_crd
namespace: development-john
subjects:
- kind: User
name: john
apiGroup: rbac.authorization.k8s.io
roleRef:
kind: ClusterRole
name: crd-creation
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: crd-creation
rules:
- apiGroups: ['kubernetes-client.io/v1']
resources: ['NEW_CRD']
verbs: ['create, list, get']
Kenneth
10 months agoDenise
10 months agoAnastacia
10 months agoTommy
10 months agoRomana
11 months agoWillard
11 months agoMee
11 months agoRosalyn
11 months agoUlysses
11 months agoTheola
11 months agoKimbery
11 months agoCory
11 months agoDiego
11 months agoNan
12 months agoVeronika
12 months agoCarman
12 months agoRosalia
1 year agoHaydee
1 year agoAvery
1 year agoGilbert
1 year agoKiley
1 year agoPearly
1 year agoLayla
1 year agoSamira
1 year agoFlorinda
1 year agoMicah
1 year agoClay
1 year agoMelodie
1 year agoHelene
1 year agoMelodie
1 year ago