Pregunta 16 - Namespaces y Recursos de la API
Question 16 | Namespaces and Api Resources
Use context: kubectl config use-context k8s-c1-H
Write the names of all namespaced Kubernetes resources (like Pod, Secret, ConfigMap...) into /opt/course/16/resources.txt.
Find the project-* Namespace with the highest number of Roles defined in it and write its name and amount of Roles into /opt/course/16/crowded-namespace.txt.
k api-resources --namespaced=true -o name > /opt/course/16/resources.txt
# Para verificar cuál namespace tiene más roles necesitamos ir en cada uno de ellos y contar
k get ns -o name | grep project-
project-c13
project-c14
project-hamster
project-snake
project-tiger
k -n project-c13 get role --no-headers | wc -l
0
k -n project-c14 get role --no-headers | wc -l
300
k -n project-hamster get role --no-headers | wc -l
0
k -n project-snake get role --no-headers | wc -l
0
k -n project-tiger get role --no-headers | wc -l
0
echo "project-c14 with 300 roles" > /opt/course/16/crowded-namespace.txt