Documentation
¶
Index ¶
- Constants
- type AddonInfo
- type AddonSkew
- type Cache
- type ClientStat
- type ClusterDetails
- type ClusterSummary
- type DeprecationDetail
- type DescribeOptions
- type EKSAPI
- type EndpointAccessInfo
- type HealthIssue
- type InsightDetail
- type InsightSummary
- type ListOptions
- type NetworkingInfo
- type NodeCountInfo
- type NodegroupSkew
- type NodegroupSummary
- type SecurityInfo
- type ServiceImpl
- func (s *ServiceImpl) Describe(ctx context.Context, name string, options DescribeOptions) (*ClusterDetails, error)
- func (s *ServiceImpl) DescribeInsight(ctx context.Context, clusterName, id string) (*InsightDetail, error)
- func (s *ServiceImpl) List(ctx context.Context, options ListOptions) ([]ClusterSummary, error)
- func (s *ServiceImpl) ListAllRegionsWithMeta(ctx context.Context, options ListOptions) ([]ClusterSummary, int, error)
- func (s *ServiceImpl) ListInsights(ctx context.Context, clusterName string, opts UpgradeCheckOptions) ([]InsightSummary, error)
- func (s *ServiceImpl) ResolveInsightID(ctx context.Context, clusterName, query string) (string, error)
- func (s *ServiceImpl) UpgradeCheck(ctx context.Context, clusterName string, opts UpgradeCheckOptions) (*UpgradeReport, error)
- type SkewReport
- type UpgradeCheckOptions
- type UpgradeReport
Constants ¶
const ( InsightStatusPassing = "PASSING" InsightStatusWarning = "WARNING" InsightStatusError = "ERROR" InsightStatusUnknown = "UNKNOWN" )
Insight status values (the flattened InsightStatus.Status enum).
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddonInfo ¶
type AddonInfo struct {
Name string `json:"name"`
Version string `json:"version"`
Status string `json:"status"`
Health string `json:"health,omitempty"`
}
AddonInfo contains EKS add-on information
type AddonSkew ¶ added in v0.7.0
type AddonSkew struct {
Name string `json:"name" yaml:"name"`
Installed string `json:"installed" yaml:"installed"`
Latest string `json:"latest" yaml:"latest"`
Behind bool `json:"behind" yaml:"behind"`
}
AddonSkew is an installed addon's version vs the latest compatible with the cluster's Kubernetes version.
type Cache ¶
Cache is the cluster service's TTL cache, backed by the shared common.TTLCache implementation.
type ClientStat ¶ added in v0.8.0
type ClientStat struct {
UserAgent string `json:"userAgent,omitempty" yaml:"userAgent,omitempty"`
LastRequestTime *time.Time `json:"lastRequestTime,omitempty" yaml:"lastRequestTime,omitempty"`
NumberOfRequestsLast30Days int32 `json:"numberOfRequestsLast30Days" yaml:"numberOfRequestsLast30Days"`
}
ClientStat identifies one Kubernetes client still calling a deprecated API.
type ClusterDetails ¶
type ClusterDetails struct {
// Basic cluster info
Name string `json:"name"`
Status string `json:"status"`
Version string `json:"version"`
PlatformVersion string `json:"platformVersion"`
Endpoint string `json:"endpoint"`
CreatedAt time.Time `json:"createdAt"`
Region string `json:"region"`
// Support is the EKS version support posture (tier + days remaining),
// resolved via the shared status resolver. Populated by the command layer.
Support *status.SupportPosture `json:"support,omitempty"`
// Health information (integration with existing health framework)
Health *health.HealthSummary `json:"health,omitempty"`
// HealthIssues are AWS-reported control-plane health issues (DescribeCluster's
// Health.Issues) — degraded resources, IAM/permission failures, etc. Distinct
// from the computed Health summary above. Always populated when present, even
// without ShowHealth.
HealthIssues []HealthIssue `json:"healthIssues,omitempty"`
// Networking details
Networking NetworkingInfo `json:"networking"`
// Security configuration
Security SecurityInfo `json:"security"`
// Add-ons and nodegroups
Addons []AddonInfo `json:"addons"`
Nodegroups []NodegroupSummary `json:"nodegroups"`
// Operational metadata
Tags map[string]string `json:"tags"`
}
ClusterDetails contains comprehensive cluster information
type ClusterSummary ¶
type ClusterSummary struct {
Name string `json:"name"`
Status string `json:"status"`
Version string `json:"version"`
Region string `json:"region"`
Health *health.HealthSummary `json:"health,omitempty"`
NodeCount NodeCountInfo `json:"nodeCount"`
CreatedAt time.Time `json:"createdAt"`
Tags map[string]string `json:"tags,omitempty"`
}
ClusterSummary is used for list operations
type DeprecationDetail ¶ added in v0.8.0
type DeprecationDetail struct {
// Usage is the deprecated resource/API path (e.g. policy/v1beta1 PodDisruptionBudget).
Usage string `json:"usage,omitempty" yaml:"usage,omitempty"`
// ReplacedWith is the API to migrate to, if applicable.
ReplacedWith string `json:"replacedWith,omitempty" yaml:"replacedWith,omitempty"`
// StopServingVersion is the Kubernetes version that removes the deprecated API.
StopServingVersion string `json:"stopServingVersion,omitempty" yaml:"stopServingVersion,omitempty"`
// StartServingReplacementVersion is the version where the replacement became available.
StartServingReplacementVersion string `json:"startServingReplacementVersion,omitempty" yaml:"startServingReplacementVersion,omitempty"`
// ClientStats are the callers (most-active first) still hitting the deprecated API.
ClientStats []ClientStat `json:"clientStats,omitempty" yaml:"clientStats,omitempty"`
}
DeprecationDetail describes one deprecated Kubernetes API surfaced by an UPGRADE_READINESS insight, plus the clients still calling it. EKS derives this from the control-plane audit log on a 30-day rolling window.
type DescribeOptions ¶
type DescribeOptions struct {
ShowHealth bool `json:"showHealth"`
ShowSecurity bool `json:"showSecurity"`
IncludeAddons bool `json:"includeAddons"`
Detailed bool `json:"detailed"`
}
DescribeOptions controls what information to include in describe operations
type EKSAPI ¶ added in v0.2.1
type EKSAPI interface {
ListClusters(ctx context.Context, params *eks.ListClustersInput, optFns ...func(*eks.Options)) (*eks.ListClustersOutput, error)
DescribeCluster(ctx context.Context, params *eks.DescribeClusterInput, optFns ...func(*eks.Options)) (*eks.DescribeClusterOutput, error)
ListNodegroups(ctx context.Context, params *eks.ListNodegroupsInput, optFns ...func(*eks.Options)) (*eks.ListNodegroupsOutput, error)
DescribeNodegroup(ctx context.Context, params *eks.DescribeNodegroupInput, optFns ...func(*eks.Options)) (*eks.DescribeNodegroupOutput, error)
ListAddons(ctx context.Context, params *eks.ListAddonsInput, optFns ...func(*eks.Options)) (*eks.ListAddonsOutput, error)
DescribeAddon(ctx context.Context, params *eks.DescribeAddonInput, optFns ...func(*eks.Options)) (*eks.DescribeAddonOutput, error)
DescribeAddonVersions(ctx context.Context, params *eks.DescribeAddonVersionsInput, optFns ...func(*eks.Options)) (*eks.DescribeAddonVersionsOutput, error)
ListInsights(ctx context.Context, params *eks.ListInsightsInput, optFns ...func(*eks.Options)) (*eks.ListInsightsOutput, error)
DescribeInsight(ctx context.Context, params *eks.DescribeInsightInput, optFns ...func(*eks.Options)) (*eks.DescribeInsightOutput, error)
}
EKSAPI abstracts the subset of EKS client methods used by this service for easier testing
type EndpointAccessInfo ¶
type EndpointAccessInfo struct {
PrivateAccess bool `json:"privateAccess"`
PublicAccess bool `json:"publicAccess"`
PublicCidrs []string `json:"publicCidrs,omitempty"`
}
EndpointAccessInfo describes cluster endpoint configuration
type HealthIssue ¶ added in v0.8.0
type HealthIssue struct {
Code string `json:"code"`
Message string `json:"message"`
ResourceIds []string `json:"resourceIds,omitempty"`
}
HealthIssue is one AWS-reported health issue on a cluster/nodegroup/addon — the common shape behind EKS's ClusterIssue / NodegroupIssue / AddonIssue.
type InsightDetail ¶ added in v0.7.0
type InsightDetail struct {
InsightSummary
Recommendation string `json:"recommendation,omitempty" yaml:"recommendation,omitempty"`
Resources []string `json:"resources,omitempty" yaml:"resources,omitempty"`
AdditionalInfo map[string]string `json:"additionalInfo,omitempty" yaml:"additionalInfo,omitempty"`
Deprecations []DeprecationDetail `json:"deprecations,omitempty" yaml:"deprecations,omitempty"`
}
InsightDetail is the DescribeInsight detail view (recommendation + resources).
type InsightSummary ¶ added in v0.7.0
type InsightSummary struct {
ID string `json:"id" yaml:"id"`
Name string `json:"name" yaml:"name"`
Category string `json:"category" yaml:"category"`
Status string `json:"status" yaml:"status"`
StatusReason string `json:"statusReason,omitempty" yaml:"statusReason,omitempty"`
KubernetesVersion string `json:"kubernetesVersion,omitempty" yaml:"kubernetesVersion,omitempty"`
LastRefreshTime *time.Time `json:"lastRefreshTime,omitempty" yaml:"lastRefreshTime,omitempty"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
}
InsightSummary is a flattened EKS Cluster Insight — the nested InsightStatus.Status/.Reason are pulled up into plain fields.
type ListOptions ¶
type ListOptions struct {
Regions []string `json:"regions"`
ShowHealth bool `json:"showHealth"`
Filters map[string]string `json:"filters"`
AllRegions bool `json:"allRegions"`
MaxConcurrency int `json:"maxConcurrency"`
}
ListOptions controls cluster listing behavior
type NetworkingInfo ¶
type NetworkingInfo struct {
VpcId string `json:"vpcId"`
VpcCidr string `json:"vpcCidr,omitempty"`
SubnetIds []string `json:"subnetIds"`
SecurityGroupIds []string `json:"securityGroupIds"`
EndpointAccess EndpointAccessInfo `json:"endpointAccess"`
}
NetworkingInfo contains VPC and networking details
type NodeCountInfo ¶
type NodeCountInfo struct {
Ready int32 `json:"ready"`
Total int32 `json:"total"`
ReadyKnown bool `json:"readyKnown"`
}
NodeCountInfo aggregates node information across nodegroups. Ready is a measured count only when ReadyKnown is true; otherwise only Total (desired capacity) is meaningful. (REF-130)
type NodegroupSkew ¶ added in v0.7.0
type NodegroupSkew struct {
Name string `json:"name" yaml:"name"`
Version string `json:"version" yaml:"version"`
MinorsBehind int `json:"minorsBehind" yaml:"minorsBehind"`
Blocking bool `json:"blocking" yaml:"blocking"`
}
NodegroupSkew is a managed nodegroup's Kubernetes version relative to the control plane.
type NodegroupSummary ¶
type NodegroupSummary struct {
Name string `json:"name"`
Status string `json:"status"`
InstanceType string `json:"instanceType"`
DesiredSize int32 `json:"desiredSize"`
// ReadyNodes is valid only when ReadyKnown is true (a measured Kubernetes
// Ready=True count). Otherwise readiness was not measured. (REF-130)
ReadyNodes int32 `json:"readyNodes"`
ReadyKnown bool `json:"readyKnown"`
}
NodegroupSummary contains basic nodegroup information
type SecurityInfo ¶
type SecurityInfo struct {
EncryptionEnabled bool `json:"encryptionEnabled"`
KmsKeyArn string `json:"kmsKeyArn,omitempty"`
ServiceRoleArn string `json:"serviceRoleArn"`
LoggingEnabled []string `json:"loggingEnabled"`
DeletionProtection bool `json:"deletionProtection"`
}
SecurityInfo contains cluster security configuration
type ServiceImpl ¶
type ServiceImpl struct {
// contains filtered or unexported fields
}
ServiceImpl implements the cluster service
func NewService ¶
func NewService(awsConfig aws.Config, healthChecker *health.HealthChecker, logger *slog.Logger) *ServiceImpl
NewService creates a new cluster service instance
func (*ServiceImpl) Describe ¶
func (s *ServiceImpl) Describe(ctx context.Context, name string, options DescribeOptions) (*ClusterDetails, error)
Describe provides comprehensive cluster information
func (*ServiceImpl) DescribeInsight ¶ added in v0.7.0
func (s *ServiceImpl) DescribeInsight(ctx context.Context, clusterName, id string) (*InsightDetail, error)
DescribeInsight returns the detail view (recommendation, affected resources) for a single insight.
func (*ServiceImpl) List ¶
func (s *ServiceImpl) List(ctx context.Context, options ListOptions) ([]ClusterSummary, error)
List provides fast cluster listing with optional health information
func (*ServiceImpl) ListAllRegionsWithMeta ¶ added in v0.6.0
func (s *ServiceImpl) ListAllRegionsWithMeta(ctx context.Context, options ListOptions) ([]ClusterSummary, int, error)
ListAllRegionsWithMeta is like ListAllRegions but also returns the number of regions that were actually queried, so the caller can display an accurate progress message.
func (*ServiceImpl) ListInsights ¶ added in v0.7.0
func (s *ServiceImpl) ListInsights(ctx context.Context, clusterName string, opts UpgradeCheckOptions) ([]InsightSummary, error)
ListInsights returns the cluster's EKS Cluster Insights filtered per opts. PASSING insights are dropped unless opts.ShowPassing.
func (*ServiceImpl) ResolveInsightID ¶ added in v0.9.0
func (s *ServiceImpl) ResolveInsightID(ctx context.Context, clusterName, query string) (string, error)
ResolveInsightID turns a user-supplied reference — a full insight ID, a short ID prefix (as shown in the upgrade-check table), or a case-insensitive name substring — into a canonical insight ID. It lists all insights (including PASSING) so anything visible in the table can be drilled into. An exact ID wins outright; a single prefix/name match resolves; an ambiguous query errors with the candidates so the user can narrow it down.
func (*ServiceImpl) UpgradeCheck ¶ added in v0.7.0
func (s *ServiceImpl) UpgradeCheck(ctx context.Context, clusterName string, opts UpgradeCheckOptions) (*UpgradeReport, error)
UpgradeCheck assembles the full readiness report: AWS Cluster Insights plus the local control-plane/nodegroup/addon version-skew picture.
type SkewReport ¶ added in v0.7.0
type SkewReport struct {
ControlPlaneVersion string `json:"controlPlaneVersion" yaml:"controlPlaneVersion"`
Nodegroups []NodegroupSkew `json:"nodegroups" yaml:"nodegroups"`
Addons []AddonSkew `json:"addons" yaml:"addons"`
Findings []string `json:"findings,omitempty" yaml:"findings,omitempty"`
}
SkewReport is the local version-skew picture: control plane vs nodegroups vs addons, with ordered, actionable findings.
type UpgradeCheckOptions ¶ added in v0.7.0
type UpgradeCheckOptions struct {
Category string // default UPGRADE_READINESS
Statuses []string // optional status filter (PASSING/WARNING/ERROR/UNKNOWN)
ShowPassing bool // include PASSING insights (hidden by default)
}
UpgradeCheckOptions filters an upgrade-check query.
type UpgradeReport ¶ added in v0.7.0
type UpgradeReport struct {
Cluster string `json:"cluster" yaml:"cluster"`
Support *status.SupportPosture `json:"support,omitempty" yaml:"support,omitempty"`
ControlPlane *health.HealthResult `json:"controlPlane,omitempty" yaml:"controlPlane,omitempty"`
Insights []InsightSummary `json:"insights" yaml:"insights"`
Skew SkewReport `json:"skew" yaml:"skew"`
}
UpgradeReport combines AWS Cluster Insights with the local version-skew view — the full `cluster upgrade-check` result.