domino_admin_toolkit.checks.test_coredns_clusterrole module
- pydantic model domino_admin_toolkit.checks.test_coredns_clusterrole.CoreDNSClusterRoleAnalyzer
Bases:
AnalyzerBaseValidates 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(k8s_client)
Retrieves the ClusterRole bound to the running DNS pods’ ServiceAccount
- domino_admin_toolkit.checks.test_coredns_clusterrole.test_coredns_clusterrole(coredns_clusterrole)
- Description:
Verifies that the ClusterRole bound to the running DNS pods’ ServiceAccount has expected resources and verbs. The role is resolved via pod ServiceAccount -> ClusterRoleBinding (not by name), so it works on RKE2, GKE, EKS, AKS and OpenShift (openshift-dns).
- Failure Conditions:
DNS pods, binding or ClusterRole cannot be resolved (reported as data unavailable)
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
- See also:
test_service_dns.py — DNS resolution from the cluster (resolution, not permissions)
test_kubernetes.py::test_kube_dns_health — DNS Service and pod health, same DNS pod discovery