health

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HelmReleaseReadyStatus

func HelmReleaseReadyStatus(conditions []HelmReleaseCondition) (bool, string, string)

HelmReleaseReadyStatus converts Flux HelmRelease Ready conditions into a compact readiness tuple.

func ReadHelmReleaseStatuses

func ReadHelmReleaseStatuses(ctx context.Context, kubeContext, kubeconfig string, refs []HelmReleaseRef) (map[string]HelmReleaseStatus, error)

ReadHelmReleaseStatuses reads Flux HelmRelease statuses once.

func RunChecks

func RunChecks(ctx context.Context, checks []Check) (map[string]Result, error)

RunChecks observes all checks once.

Types

type Check

type Check struct {
	Key       string
	Name      string
	Kind      string
	Required  bool
	DependsOn []string
	Expected  time.Duration
	Timeout   time.Duration
	Run       func(context.Context) Result
}

Check is a reusable cluster health check.

func CertManagerAdmissionCheck

func CertManagerAdmissionCheck(kubeContext, kubeconfig string, required bool) Check

CertManagerAdmissionCheck returns a health check that proves cert-manager's Certificate admission webhook is reachable from kube-apiserver.

func ConfigMapDataCheck

func ConfigMapDataCheck(kubeContext, kubeconfig, namespace, name, dataKey string, required bool) Check

ConfigMapDataCheck returns a health check for a required ConfigMap data key.

func HelmReleaseCheck

func HelmReleaseCheck(kubeContext, kubeconfig string, ref HelmReleaseRef, required bool) Check

HelmReleaseCheck returns a health check for a Flux HelmRelease Ready condition.

func LocalIngressProxyCheck

func LocalIngressProxyCheck(localIngressURL func() (string, error), required bool) Check

LocalIngressProxyCheck verifies that the local ingress URL is reachable after Traefik is expected to be running. Any HTTP response proves the proxy path is accepting browser traffic; connection failures keep the check pending.

func LocalStartChecks

func LocalStartChecks(opts LocalStartOptions) []Check

LocalStartChecks returns seed-specific local-start post-API health checks.

func WorkloadCheck

func WorkloadCheck(kubeContext, kubeconfig, namespace, resource, name string, required bool) Check

WorkloadCheck returns a health check for a workload's Kubernetes readiness.

type HelmReleaseCondition

type HelmReleaseCondition struct {
	Type    string `json:"type"`
	Status  string `json:"status"`
	Reason  string `json:"reason"`
	Message string `json:"message"`
}

HelmReleaseCondition is one Flux HelmRelease condition.

type HelmReleaseRef

type HelmReleaseRef struct {
	Name      string
	Namespace string
	Kind      string
}

HelmReleaseRef identifies one Flux HelmRelease to observe.

type HelmReleaseStatus

type HelmReleaseStatus struct {
	Ref     HelmReleaseRef
	Exists  bool
	Ready   bool
	Status  string
	Message string
}

HelmReleaseStatus is the current observed status of one HelmRelease.

type LocalStartOptions

type LocalStartOptions struct {
	SeedName        string
	KubeContext     string
	Kubeconfig      string
	LocalIngressURL func() (string, error)
}

LocalStartOptions configures post-API health checks for podplane local start.

type Result

type Result struct {
	Exists  bool
	Ready   bool
	Status  Status
	Message string
	Err     error
}

Result is one health check observation.

type Status

type Status string

Status is the current state of a health check.

const (
	// StatusPending means the check target is not ready yet.
	StatusPending Status = "Pending"
	// StatusReady means the check target is healthy.
	StatusReady Status = "Ready"
	// StatusFailed means the check target is unhealthy.
	StatusFailed Status = "Failed"
)

Jump to

Keyboard shortcuts

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