domino_admin_toolkit.checks.test_coredns_clusterrole module
- pydantic model domino_admin_toolkit.checks.test_coredns_clusterrole.CoreDNSClusterRoleAnalyzer
Bases:
AnalyzerBase
Validates the CoreDNS ClusterRole meets required resources and verbs
- analyze(data)
Core analysis logic
- Return type:
- name: ClassVar[str] = 'CoreDNSClusterRoleAnalyzer'
- domino_admin_toolkit.checks.test_coredns_clusterrole.coredns_clusterrole()
Retrieves the CoreDNS ClusterRole from Kubernetes
- domino_admin_toolkit.checks.test_coredns_clusterrole.test_coredns_clusterrole(coredns_clusterrole)
- Description:
Verifies that CoreDNS cluster roles have expected resources and verbs defined.
- Failure Conditions:
Missing resources in the CoreDNS cluster role definition
Missing verbs in the CoreDNS cluster role definition
- Troubleshooting Steps:
- Verify that all required resources (services, namespaces, endpoints, pods)
are correctly defined in the CoreDNS policy - Check kubectl get clusterroles –output - Look for policies with apiGroups: [“”] and ensure they include expected resources
- Confirm verbs (list, watch) are present in each resource definition within the CoreDNS cluster role
Inspect specific resource definitions using kubectl get clusterrole <name> –output json
Ensure no unexpected resources or verbs are added to the policy
- Resolution Steps:
Add missing resources to the CoreDNS cluster role definition using kubectl:
Add missing verbs to each resource in the CoreDNS cluster role definition if required
If issues persist, check Kubernetes authentication and authorization logs for discrepancies
- Required Permissions:
Read access to Kubernetes RBAC resources (ClusterRole, ClusterRoleBinding)
Execute kubectl commands to inspect and modify cluster role definitions