domino_admin_toolkit.checks.test_cni module
- domino_admin_toolkit.checks.test_cni.check_calico_services()
- domino_admin_toolkit.checks.test_cni.get_age(creation_timestamp)
Calculates the age of an object from its creation timestamp until the current time.
- Args:
creation_timestamp (str): The creation timestamp of the object in ISO 8601 format.
- Returns:
str: A formatted string representing the age in days, hours, minutes (e.g., “3d5h12m”).
- domino_admin_toolkit.checks.test_cni.is_tigera_operator_managed()
Checks if Calico is managed by Tigera operator by listing the Tigera installations in the cluster using the custom objects client.
- Returns:
bool: True if Calico is managed by Tigera operator, False otherwise.
- domino_admin_toolkit.checks.test_cni.test_calico_info()
- Description:
Tests the health status and version information of Calico components and Tigera operator (if managed by Tigera) by querying Kubernetes resources and displaying the results in tabulated format.
- Result:
Test passes if all the Calico components are healthy and version information is retrieved. For Tigera managed Calico, it also checks the status of Tigera operator and its version.
- domino_admin_toolkit.checks.test_cni.test_calico_pods_health()
- Description:
Tests the health status of Calico and Tigera pods by querying Kubernetes pods and checking their status.
If you encounter error messages such as “Interface in cleanup grace period” or “Syncing routes: found unexpected route”, check that aws-node does have ANNOTATE_POD_IP specified as “true”, as pod networking may be affected, without that.
To check aws-node configuration, run:
kubectl -n kube-system get ds aws-node -oyaml | grep -A5 ANNOTATE
Expected output should show:
- name: ANNOTATE_POD_IP value: "true" - name: AWS_VPC_CNI_NODE_PORT_SUPPORT value: "true" - name: AWS_VPC_ENI_MTU value: "9001"
See https://github.com/aws/amazon-vpc-cni-k8s#annotate_pod_ip-v193 for more information.
- Result:
Test passes if all the pods are in a healthy state and contain no error logs.