Kubernetes CKA sample exam question 58 with answer

Question
Create a new ServiceAccount processor in namespace project-hamster. Create a Role and RoleBinding, both named processor as well.
These should allow a new SA to only create Secrets and ConfigMaps in that namespace

Answer
Create SA:

kubectl -n project-hamster create sa processor
Create Role:
kubectl -n project-hamster create role processor --resource=secrets,configmaps --verb=create
Create RoleBinding:
kubectl -n project-hamster create rolebinding processor --role processor --serviceaccount=project-hamster:processor