Is there a way to delete existing role in kubernetes? I have made a mistake while creating roles for the users and now I want to update or delete the role. Please let me know a way
How can we delete existing role in kubernetes?
Asked Answered
Delete a Role:
kubectl delete role NAME_OF_ROLE -n NAMESPACE
Delete RoleBinding:
kubectl delete rolebinding NAME_OF_ROLEBINDING -n NAMESPACE
Update Role:
kubectl apply -f NEW_YAML_FILE_FOR_ROLE
Update RoleBInding:
kubectl apply -f NEW_YAML_FILE_FOR_ROLEBINDING
kubectl get clusterroles
kubectl get clusterrolebindings
find your role name and then delete
kubectl delete clusterrolebinding name
kubectl delete clusterrole name
© 2022 - 2024 — McMap. All rights reserved.