status

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSCredentialProvider

type AWSCredentialProvider interface {
	Environment(context.Context, string) ([]string, error)
}

type ApplicationAlert

type ApplicationAlert struct {
	Name        string `json:"name"`
	Severity    string `json:"severity"`
	State       string `json:"state"`
	Namespace   string `json:"namespace,omitempty"`
	Workload    string `json:"workload,omitempty"`
	Pod         string `json:"pod,omitempty"`
	Service     string `json:"service,omitempty"`
	Summary     string `json:"summary,omitempty"`
	Description string `json:"description,omitempty"`
	StartedAt   string `json:"started_at,omitempty"`
}

type ApplicationEdge

type ApplicationEdge struct {
	ID             string  `json:"id"`
	Source         string  `json:"source"`
	Target         string  `json:"target"`
	Relation       string  `json:"relation"`
	Protocol       string  `json:"protocol,omitempty"`
	Label          string  `json:"label,omitempty"`
	Evidence       string  `json:"evidence"`
	Verified       bool    `json:"verified"`
	State          string  `json:"state"`
	ReadyEndpoints int     `json:"ready_endpoints,omitempty"`
	TotalEndpoints int     `json:"total_endpoints,omitempty"`
	RequestRate    float64 `json:"request_rate,omitempty"`
}

type ApplicationNode

type ApplicationNode struct {
	ID              string            `json:"id"`
	Name            string            `json:"name"`
	Namespace       string            `json:"namespace"`
	Kind            string            `json:"kind"`
	Layer           string            `json:"layer"`
	State           string            `json:"state"`
	StateReason     string            `json:"state_reason"`
	DesiredReplicas int               `json:"desired_replicas,omitempty"`
	ReadyReplicas   int               `json:"ready_replicas,omitempty"`
	Pods            int               `json:"pods,omitempty"`
	ReadyPods       int               `json:"ready_pods,omitempty"`
	Restarts        int               `json:"restarts,omitempty"`
	CPUCores        float64           `json:"cpu_cores,omitempty"`
	MemoryBytes     float64           `json:"memory_bytes,omitempty"`
	ReadyEndpoints  int               `json:"ready_endpoints,omitempty"`
	TotalEndpoints  int               `json:"total_endpoints,omitempty"`
	Services        []string          `json:"services"`
	Ports           []ServicePort     `json:"ports"`
	Hosts           []string          `json:"hosts"`
	Labels          map[string]string `json:"labels,omitempty"`
}

type ApplicationTopology

type ApplicationTopology struct {
	ObservedAt time.Time          `json:"observed_at"`
	Source     TopologySource     `json:"source"`
	Summary    TopologySummary    `json:"summary"`
	Nodes      []ApplicationNode  `json:"nodes"`
	Edges      []ApplicationEdge  `json:"edges"`
	Alerts     []ApplicationAlert `json:"alerts"`
	Warnings   []string           `json:"warnings"`
}

ApplicationTopology is a read-only, project-scoped view of the workloads already running in Kubernetes. It deliberately contains no Secret data.

type Cache

type Cache interface {
	GetStatus(context.Context, string) ([]byte, bool, error)
	SetStatus(context.Context, string, []byte) error
	DeleteStatus(context.Context, string) error
}

type Cluster

type Cluster struct {
	Name       string `json:"name"`
	Status     string `json:"status"`
	Version    string `json:"version,omitempty"`
	Endpoint   string `json:"endpoint,omitempty"`
	TargetType string `json:"target_type,omitempty"`
	Reachable  bool   `json:"reachable"`
}

type Component

type Component struct {
	Key         string `json:"key"`
	DisplayName string `json:"display_name"`
	Category    string `json:"category"`
	Desired     bool   `json:"desired"`
	Actual      bool   `json:"actual"`
	Status      string `json:"status"`
	Detail      string `json:"detail,omitempty"`
}

type HelmRelease

type HelmRelease struct {
	Name       string `json:"name"`
	Namespace  string `json:"namespace"`
	Status     string `json:"status"`
	Chart      string `json:"chart"`
	AppVersion string `json:"app_version"`
}

type IngressConfigSyncReport

type IngressConfigSyncReport struct {
	UpdatedDomains      int      `json:"updated_domains"`
	ImportedDomains     int      `json:"imported_domains"`
	ImportedRoutes      int      `json:"imported_routes"`
	ConsolidatedDomains int      `json:"consolidated_domains"`
	PreservedDomains    int      `json:"preserved_domains"`
	Skipped             []string `json:"skipped"`
}

func SyncIngressesToDomainConfig

func SyncIngressesToDomainConfig(doc environment.Document, inventory []KubernetesIngress) IngressConfigSyncReport

SyncIngressesToDomainConfig imports only route data that can be mapped back safely to an existing project domain. Routes are grouped by host because one domain is commonly split into several Higress objects. The side with more valid, non-conflicting paths wins; equal counts preserve deployment config.

func SyncIngressesToDomainConfigFromCluster

func SyncIngressesToDomainConfigFromCluster(doc environment.Document, inventory []KubernetesIngress) IngressConfigSyncReport

SyncIngressesToDomainConfigFromCluster treats EKS as authoritative for every registered host and imports new, unambiguous Ingress hosts from namespaces owned by this project environment. It never removes desired routes that have not reached the cluster yet.

type KubernetesIngress

type KubernetesIngress struct {
	Name              string                  `json:"name"`
	Namespace         string                  `json:"namespace"`
	ClassName         string                  `json:"class_name"`
	ResourceVersion   string                  `json:"resource_version"`
	Hosts             []string                `json:"hosts"`
	Paths             []KubernetesIngressPath `json:"paths"`
	TLSSecrets        []string                `json:"tls_secrets"`
	Addresses         []string                `json:"addresses"`
	CreationTimestamp string                  `json:"creation_timestamp,omitempty"`
	ManagedBy         string                  `json:"managed_by,omitempty"`
	BackendProtocol   string                  `json:"backend_protocol,omitempty"`
	SyncStatus        string                  `json:"sync_status"`
	Desired           bool                    `json:"desired"`
	ConfigIndex       *int                    `json:"config_index,omitempty"`
}

func DecodeKubernetesIngressList

func DecodeKubernetesIngressList(payload []byte) ([]KubernetesIngress, error)

DecodeKubernetesIngressList exposes the same safe decoder used by the platform API for maintenance commands that only read cluster inventory.

type KubernetesIngressDocument

type KubernetesIngressDocument struct {
	Ingress KubernetesIngress `json:"ingress"`
	YAML    string            `json:"yaml"`
}

type KubernetesIngressPath

type KubernetesIngressPath struct {
	Host             string `json:"host,omitempty"`
	Path             string `json:"path"`
	PathType         string `json:"path_type,omitempty"`
	ServiceName      string `json:"service_name"`
	ServiceNamespace string `json:"service_namespace,omitempty"`
	ServicePort      string `json:"service_port"`
}

type KubernetesIngressValidation

type KubernetesIngressValidation struct {
	Valid          bool              `json:"valid"`
	Ingress        KubernetesIngress `json:"ingress"`
	NormalizedYAML string            `json:"normalized_yaml"`
	Warnings       []string          `json:"warnings"`
}

type KubernetesService

type KubernetesService struct {
	Name                string        `json:"name"`
	Namespace           string        `json:"namespace"`
	Type                string        `json:"type"`
	Ports               []ServicePort `json:"ports"`
	LoadBalancerHosts   []string      `json:"load_balancer_hosts"`
	EndpointHealthKnown bool          `json:"endpoint_health_known"`
	ReadyEndpoints      int           `json:"ready_endpoints"`
	TotalEndpoints      int           `json:"total_endpoints"`
}

type ManagedStorage

type ManagedStorage struct {
	Component      string `json:"component"`
	Namespace      string `json:"namespace"`
	PVCName        string `json:"pvc_name"`
	Requested      string `json:"requested"`
	Capacity       string `json:"capacity"`
	Phase          string `json:"phase"`
	StorageClass   string `json:"storage_class"`
	AllowExpansion bool   `json:"allow_expansion"`
	WorkloadKind   string `json:"workload_kind"`
	WorkloadName   string `json:"workload_name"`
	VolumeName     string `json:"volume_name"`
	Active         bool   `json:"active"`
	Retained       bool   `json:"retained"`
	Project        string `json:"-"`
	Environment    string `json:"-"`
}

ManagedStorage describes one PVC owned by a platform-managed stateful stack. Kubernetes object names are returned for display only; mutation endpoints rediscover them from trusted labels and never accept them from the browser.

type ManagedStorageReport

type ManagedStorageReport struct {
	ObservedAt time.Time        `json:"observed_at"`
	Items      []ManagedStorage `json:"items"`
}

type Node

type Node struct {
	Name         string `json:"name"`
	Ready        bool   `json:"ready"`
	InstanceType string `json:"instance_type,omitempty"`
	Zone         string `json:"zone,omitempty"`
	Version      string `json:"version,omitempty"`
}

type PodSummary

type PodSummary struct {
	Total     int            `json:"total"`
	Ready     int            `json:"ready"`
	Pending   int            `json:"pending"`
	Failed    int            `json:"failed"`
	Unhealthy []UnhealthyPod `json:"unhealthy"`
}

type Report

type Report struct {
	Project         string              `json:"project,omitempty"`
	Environment     string              `json:"environment"`
	EnvironmentName string              `json:"environment_name,omitempty"`
	TargetName      string              `json:"target_name,omitempty"`
	ObservedAt      time.Time           `json:"observed_at"`
	Cluster         Cluster             `json:"cluster"`
	Nodes           []Node              `json:"nodes"`
	Pods            PodSummary          `json:"pods"`
	Components      []Component         `json:"components"`
	Releases        []HelmRelease       `json:"releases"`
	Services        []KubernetesService `json:"services"`
	Outputs         map[string]any      `json:"outputs"`
	Warnings        []string            `json:"warnings"`
}

type Service

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

func NewService

func NewService(config *appconfig.Config, environments *environment.Repository) *Service

func NewServiceWithCache

func NewServiceWithCache(config *appconfig.Config, environments *environment.Repository, cache Cache) *Service

func (*Service) ApplicationTopology

func (s *Service) ApplicationTopology(ctx context.Context, name string, fresh bool) (*ApplicationTopology, error)

ApplicationTopology returns a short-lived, coalesced observation. A normal page refresh therefore does not fan out into repeated kubectl/Prometheus calls when several operators open the same project environment.

func (*Service) ApplyIngress

func (s *Service) ApplyIngress(ctx context.Context, targetName string, source []byte, expectedNamespace, expectedName, expectedResourceVersion string) (KubernetesIngressDocument, error)

func (*Service) Cached

func (s *Service) Cached(ctx context.Context, name string) (*Report, bool, error)

Cached returns the last short-lived observation without contacting AWS or the Kubernetes API. Project listings use it as an optional health signal so opening the project page never fans out into slow cloud requests.

func (*Service) CachedMany

func (s *Service) CachedMany(ctx context.Context, names []string) map[string]*Report

CachedMany reads project-card status snapshots in one cache round trip when the backing store supports it. Corrupt or missing entries are intentionally omitted because the project list treats health as an optional hint.

func (*Service) Collect

func (s *Service) Collect(ctx context.Context, name string) (*Report, error)

func (*Service) CollectFresh

func (s *Service) CollectFresh(ctx context.Context, name string) (*Report, error)

func (*Service) DeleteIngress

func (s *Service) DeleteIngress(ctx context.Context, targetName, namespace, ingressName, expectedResourceVersion string) error

func (*Service) GetIngress

func (s *Service) GetIngress(ctx context.Context, targetName, namespace, ingressName string) (KubernetesIngressDocument, error)

func (*Service) Invalidate

func (s *Service) Invalidate(ctx context.Context, name string)

func (*Service) ListClickVisualStorage

func (s *Service) ListClickVisualStorage(ctx context.Context, name string) (*ManagedStorageReport, error)

ListClickVisualStorage performs a focused live query. It deliberately does not run the full environment status collector, keeping the storage panel responsive and avoiding unrelated AWS/Helm calls.

func (*Service) ListIngresses

func (s *Service) ListIngresses(ctx context.Context, name string) ([]KubernetesIngress, error)

func (*Service) ListOpenTelemetryStorage

func (s *Service) ListOpenTelemetryStorage(ctx context.Context, name string) (*ManagedStorageReport, error)

ListOpenTelemetryStorage reads the live WAL PVCs owned by the Collector. The Collector is not a long-term telemetry backend: these volumes only hold file_storage sending queues while an exporter destination is unavailable.

func (*Service) ListServices

func (s *Service) ListServices(ctx context.Context, name string) ([]KubernetesService, error)

ListServices performs a focused, live EKS query for the gateway backend selector. It intentionally avoids the heavier node, pod, Helm and add-on collection used by the environment overview.

func (*Service) SetAWSCredentialProvider

func (s *Service) SetAWSCredentialProvider(provider AWSCredentialProvider)

func (*Service) SetTerraformOutputProvider

func (s *Service) SetTerraformOutputProvider(provider TerraformOutputProvider)

func (*Service) ValidateIngress

func (s *Service) ValidateIngress(ctx context.Context, targetName string, source []byte) (KubernetesIngressValidation, error)

type ServicePort

type ServicePort struct {
	Name        string `json:"name,omitempty"`
	Port        int    `json:"port"`
	AppProtocol string `json:"app_protocol,omitempty"`
}

type TerraformOutputProvider

type TerraformOutputProvider interface {
	StateOutputs(context.Context, string, string, string) (map[string]any, error)
}

type TopologySource

type TopologySource struct {
	Kubernetes       bool   `json:"kubernetes"`
	Prometheus       bool   `json:"prometheus"`
	RuntimeGraph     bool   `json:"runtime_graph"`
	Detail           string `json:"detail"`
	ConnectionDetail string `json:"connection_detail"`
}

type TopologySummary

type TopologySummary struct {
	Normal              int `json:"normal"`
	Warning             int `json:"warning"`
	Abnormal            int `json:"abnormal"`
	Total               int `json:"total"`
	Connections         int `json:"connections"`
	RuntimeConnections  int `json:"runtime_connections"`
	EndpointConnections int `json:"endpoint_connections"`
	DeclaredConnections int `json:"declared_connections"`
}

type UnhealthyPod

type UnhealthyPod struct {
	Namespace string `json:"namespace"`
	Name      string `json:"name"`
	Phase     string `json:"phase"`
	Reason    string `json:"reason,omitempty"`
}

Jump to

Keyboard shortcuts

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