Cluster Health
The health of the platform’s Kubernetes cluster, as its cloud provider reports it.
Kubernetes itself reports the health of pods and nodes. The cloud provider that runs the cluster reports
what Kubernetes cannot see: whether the control plane is healthy, whether each node group can launch its
instances, whether each add-on (e.g. coredns or vpc-cni) is healthy and has a newer version, and
the provider’s recommendations, e.g. EKS’s insights about the cluster’s readiness for the next
Kubernetes version.
get_kubernetes_cluster_health() returns a
ClusterHealth, built from these models, whichever cloud runs the cluster. For AWS, the EKS
helper, get_cluster_health(), fills it.
Each part is read on its own: a part that cannot be read, e.g. because the platform’s cloud credentials
may not list insights, is named in ClusterHealth.errors, and the other parts are still returned.
The Smarter Operations MCP server’s eks_status tool
(EksStatusTool) reports it.
- class smarter.apps.infrastructure.cluster_health.AddonHealth(**data)[source]
Bases:
BaseModelOne add-on of the cluster: a component that the cloud provider installs and updates, e.g.
coredns.It records the add-on’s version, and the newest version that the provider offers for the cluster’s Kubernetes version, so that an outdated add-on can be reported.
- issues: tuple[HealthIssue, ...]
The add-on’s health issues, or none.
- latest_version: str | None
The newest version for the cluster’s Kubernetes version, or None if it could not be read.
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- property update_available: bool
Whether a newer version of the add-on is available for the cluster’s Kubernetes version.
- Returns:
True if
latest_versionis known and newer thanversion, compared by their numbers (seeversion_key()).
- class smarter.apps.infrastructure.cluster_health.ClusterHealth(**data)[source]
Bases:
BaseModelThe health of the platform’s Kubernetes cluster: its control plane, node groups, add-ons and insights.
Every list is empty when its part has nothing in it, or could not be read.
errorstells the two apart.- addons: list[AddonHealth]
The cluster’s add-ons.
- insights: list[ClusterInsight]
The provider’s insights about the cluster.
- issues: tuple[HealthIssue, ...]
The control plane’s health issues, or none.
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- nodegroups: list[NodeGroupHealth]
The cluster’s node groups.
- class smarter.apps.infrastructure.cluster_health.ClusterInsight(**data)[source]
Bases:
BaseModelOne recommendation of the cloud provider about the cluster, e.g. an EKS insight.
EKS checks the cluster regularly, e.g. for apis that the next Kubernetes version removes, and reports each check as passing, or as a warning or error, with a reason.
- kubernetes_version: str
The Kubernetes version that the insight is about, e.g. the next one, or empty if it is about none.
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class smarter.apps.infrastructure.cluster_health.HealthIssue(**data)[source]
Bases:
BaseModelA health issue that the cloud provider reports for the cluster, a node group or an add-on.
e.g. EKS reports
Ec2LaunchTemplateNotFoundfor a node group whose launch template was deleted, orInsufficientNumberOfReplicasfor an add-on whose pods are not running.- model_config = {'frozen': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class smarter.apps.infrastructure.cluster_health.NodeGroupHealth(**data)[source]
Bases:
BaseModelOne node group of the cluster: a set of identical nodes that the cloud provider launches and replaces.
Its size is kept between its minimum and maximum by the cluster autoscaler, and its status says whether the provider can manage it, e.g.
DEGRADEDwhen it cannot launch instances.- capacity_type: str
ON_DEMAND, orSPOT, which AWS can take back at short notice.- Type:
How the instances are bought
- issues: tuple[HealthIssue, ...]
The node group’s health issues, or none.
- max_size: int | None
The most nodes that the group may run.
A group at its maximum cannot add room for more pods.
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].