process

package
v0.6.0 Latest Latest
Warning

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

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

Documentation

Overview

Package process is the process seam (D-016, D-029): providers report an install's controller and proxy processes; Kube is the Kubernetes one.

Index

Constants

View Source
const ProbeReason = "Unhealthy"

ProbeReason is the Event reason of a probe failure.

Variables

This section is empty.

Functions

func LookupProxyDeployment

func LookupProxyDeployment(gw objects.Ref, ds []*appsv1.Deployment, sel labels.Selector) (*appsv1.Deployment, bool)

LookupProxyDeployment is ProxyDeployment that also reports whether several label matches left none.

func PodRef

func PodRef(ns string, p Process) objects.Ref

PodRef is p's Pod in ns (the install's or the Gateway's namespace), which callers check before showing p's name or facts (§14 rule 16).

func ProxyDeployment

func ProxyDeployment(gw objects.Ref, ds []*appsv1.Deployment, sel labels.Selector) *appsv1.Deployment

ProxyDeployment is gw's proxy Deployment among those sel matches: owned by gw, else the only one labelled SafeGatewayLabelValue(gw.Name). A nil sel matches none.

func SafeGatewayLabelValue

func SafeGatewayLabelValue(name string) string

SafeGatewayLabelValue is kgateway's gateway-name label value: the name, or past 63 characters its first 50 ("-" trimmed), "-" and 12 hex digits of its SHA-256.

Types

type Kube

type Kube struct{}

Kube is the Kubernetes Source: Pods, Deployments and Event deltas of the snapshot. It never reads a termination message.

func (Kube) Controller

func (Kube) Controller(in install.Resolved, snap *cache.Snapshot) Set

Controller implements Source: the Pods of the install's controller Deployment, as Discover attributed them.

func (Kube) Proxies

func (Kube) Proxies(in install.Resolved, gw objects.Ref, snap *cache.Snapshot) Set

Proxies implements Source: the Pods gw's proxy Deployment selects. Without the Deployment or the proxy Pod watch they are not observed; a consumer tells a self-managed proxy apart by joining ProxyMode and Snapshot.Synced.

type ProbeFailures

type ProbeFailures struct {
	Type           string
	Count          int
	First, Last    time.Time
	HistoryUnknown bool
}

ProbeFailures are the probe failures observed in the last cache.EventWindow (§9.2). Type is the one defined probe type, else "" ("a probe").

type Process

type Process struct {
	// ID is stable within the provider; a Pod UID in Kubernetes.
	ID       string
	Name     string
	Ready    *bool
	Restarts *int32
	// LastStart is when the running container started.
	LastStart *time.Time
	// Termination is the last termination; never its message.
	Termination *Termination
	// Waiting is a reason such as CrashLoopBackOff or ImagePullBackOff; empty when running.
	Waiting string
	// Version is the image tag without a leading "v"; empty when unknown.
	Version string
	// Probe is nil when the provider has no probe events or counted no failure.
	Probe *ProbeFailures
}

Process is one controller replica or proxy. A nil field, or an empty Waiting or Version, means "not observed", which is never a failure.

type Rollout

type Rollout struct {
	Progressing bool
	Reason      string
	SettledAt   *time.Time
}

Rollout is a workload's last rollout: Progressing while one runs, a stuck one's Reason (ProgressDeadlineExceeded), and SettledAt when it finished, if known.

type Set

type Set struct {
	Observed bool
	// Desired is the desired replica count; nil when not applicable.
	Desired *int32
	// Rollout is nil when the provider has no rollout notion.
	Rollout   *Rollout
	Processes []Process
}

Set is the processes behind one role. Observed false means "not observed", never "failing" (D-016 R3); Desired and Rollout may still be set.

type Source

type Source interface {
	Controller(in install.Resolved, snap *cache.Snapshot) Set
	Proxies(in install.Resolved, gw objects.Ref, snap *cache.Snapshot) Set
}

Source reports the processes of one install: its controller replicas and the proxies of each Gateway it owns.

type Termination

type Termination struct {
	Reason   string
	ExitCode int32
	At       time.Time
}

Termination is how a process last ended.

Jump to

Keyboard shortcuts

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