health

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetKubernetesClient

func GetKubernetesClient() (kubernetes.Interface, error)

GetKubernetesClient creates a Kubernetes client from kubeconfig

Types

type Decision

type Decision string

Decision represents the overall decision for proceeding with update

const (
	DecisionProceed Decision = "PROCEED"
	DecisionWarn    Decision = "WARN"
	DecisionBlock   Decision = "BLOCK"
)

type HealthChecker

type HealthChecker struct {
	// contains filtered or unexported fields
}

HealthChecker performs various health checks on the EKS cluster

func NewChecker

func NewChecker(eksClient *eks.Client, k8sClient kubernetes.Interface, cwClient *cloudwatch.Client, asgClient *autoscaling.Client) *HealthChecker

NewChecker creates a new health checker instance

func (*HealthChecker) CheckClusterCapacity

func (hc *HealthChecker) CheckClusterCapacity(ctx context.Context, clusterName string) HealthResult

CheckClusterCapacity validates that the cluster has sufficient capacity for rolling updates

func (*HealthChecker) CheckCriticalWorkloads

func (hc *HealthChecker) CheckCriticalWorkloads(ctx context.Context) HealthResult

CheckCriticalWorkloads validates that critical system workloads are running

func (*HealthChecker) CheckNodeHealth

func (hc *HealthChecker) CheckNodeHealth(ctx context.Context, clusterName string) HealthResult

CheckNodeHealth validates that all nodes in the cluster are ready

func (*HealthChecker) CheckPodDisruptionBudgets

func (hc *HealthChecker) CheckPodDisruptionBudgets(ctx context.Context) HealthResult

CheckPodDisruptionBudgets validates PDB configuration for user workloads

func (*HealthChecker) CheckResourceBalance

func (hc *HealthChecker) CheckResourceBalance(ctx context.Context, clusterName string) HealthResult

CheckResourceBalance validates resource distribution and utilization patterns

func (*HealthChecker) RunAllChecks

func (hc *HealthChecker) RunAllChecks(ctx context.Context, clusterName string) HealthSummary

RunAllChecks executes all health checks and returns a summary

type HealthResult

type HealthResult struct {
	Name       string
	Status     HealthStatus
	Score      int // 0-100
	Message    string
	Details    []string
	IsBlocking bool
}

HealthResult represents the result of a single health check

type HealthStatus

type HealthStatus string

HealthStatus represents the status of a health check

const (
	StatusPass HealthStatus = "PASS"
	StatusWarn HealthStatus = "WARN"
	StatusFail HealthStatus = "FAIL"
)

type HealthSummary

type HealthSummary struct {
	Results      []HealthResult
	OverallScore int
	Decision     Decision
	Warnings     []string
	Errors       []string
}

HealthSummary represents the overall health check results

type InstanceData

type InstanceData struct {
	InstanceID string
	NodeName   string
}

InstanceData represents an EC2 instance with its associated node name

type NodeMetrics

type NodeMetrics struct {
	NodeName      string
	CPUPercent    float64
	MemoryPercent float64
}

NodeMetrics represents resource metrics for a single node

type ResourceAnalysis

type ResourceAnalysis struct {
	CPUVariance    float64
	MemoryVariance float64
	MaxCPU         float64
	MaxMemory      float64
	MinCPU         float64
	MinMemory      float64
}

ResourceAnalysis contains analysis of resource distribution

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL