kubernetes

package
v0.0.54 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2026 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package kubernetes defines the private, versioned host-side execution-provider protocol. It is intentionally not part of the public Harness API.

Index

Constants

View Source
const (
	CapabilityFilesystem        = "filesystem"
	CapabilityForegroundCommand = "foreground-command"
)

Execution capability names shared by templates, requests, and admitted sets.

View Source
const (
	ExecutorServerTLSDir     = "/etc/mecatl-executor/tls"
	ExecutorProviderTrustDir = "/etc/mecatl-executor/provider"
	ExecutorTrustCAFile      = "ca.crt"
	ExecutorTrustURIFile     = "client-uri"
)

Mounts and files through which an executor Pod receives its server certificate and the provider's client trust.

View Source
const (
	KeepaliveIntervalFlag = "keepalive-interval"
	KeepaliveTimeoutFlag  = "keepalive-timeout"
)

Executor serve flag names.

View Source
const (
	MinExecutorKeepalive = time.Second
	MaxExecutorKeepalive = 10 * time.Minute
)

Keepalive bounds.

View Source
const (
	MaxMessageBytes  = 8 << 20
	MaxJSONBody      = 8 << 20
	MaxFileBytes     = 5 << 20
	MaxCommandBytes  = 1 << 20
	MaxPathBytes     = 4096
	MaxIdentityBytes = 1024
	MaxBindingBytes  = 253
	MaxListEntries   = 10_000
)

Private protocol bounds.

View Source
const (
	MinRunTTL            = 30 * time.Second
	MaxRunTTL            = 5 * time.Minute
	DefaultRunTTL        = time.Minute
	DefaultRenewInterval = 20 * time.Second
)
View Source
const ExecutorHealthPort = 7444

ExecutorHealthPort is the TCP port of the executor's plaintext health server, which the kubelet's readiness probe calls.

View Source
const ExecutorMinClientPing = 5 * time.Second

ExecutorMinClientPing is below gRPC's 10s client floor, so any provider ping is permitted.

View Source
const ExecutorServerPort = 7443

ExecutorServerPort is the TCP port of the executor gRPC server in its Pod.

View Source
const HealthListenFlag = "health-listen"

HealthListenFlag names the executor flag giving the health server's address.

View Source
const PurposeSession = "session"

PurposeSession is the supported attachment purpose.

Variables

This section is empty.

Functions

func ClientIdentity

func ClientIdentity(c *x509.Certificate) (string, error)

ClientIdentity returns the single URI SAN of c with its scheme and host lowercased.

func DecodeStrict

func DecodeStrict(data []byte, dst any) error

DecodeStrict decodes exactly one bounded JSON value without unknown or duplicate fields.

func ExecutorKeepaliveInRange

func ExecutorKeepaliveInRange(d time.Duration) bool

ExecutorKeepaliveInRange checks one value against the bounds.

func TemplateCapabilities

func TemplateCapabilities() []string

TemplateCapabilities is every template's declared set until templates declare their own.

func ValidAdmittedCapabilities

func ValidAdmittedCapabilities(v []string) bool

ValidAdmittedCapabilities reports whether v is a present admitted set: non-empty, known names only, and no duplicates.

Types

type AttachEnvironmentRequest

type AttachEnvironmentRequest struct {
	Context RequestContext `json:"context"`
	Purpose string         `json:"purpose"`
}

AttachEnvironmentRequest requests exact reattachment to an existing environment.

type AttachEnvironmentResponse

type AttachEnvironmentResponse struct {
	Environment          EnvironmentRef `json:"environment"`
	Epoch                uint64         `json:"epoch"`
	Ready                bool           `json:"ready"`
	GrantGeneration      uint64         `json:"grant_generation"`
	AdmittedCapabilities []string       `json:"admitted_capabilities"`
}

AttachEnvironmentResponse returns exact attachment state.

type EmptyResponse

type EmptyResponse struct{}

EmptyResponse is the successful response for operations without a payload.

type EnsureEnvironmentResponse

type EnsureEnvironmentResponse struct {
	Environment          EnvironmentRef `json:"environment"`
	Epoch                uint64         `json:"epoch"`
	Ready                bool           `json:"ready"`
	GrantGeneration      uint64         `json:"grant_generation"`
	AdmittedCapabilities []string       `json:"admitted_capabilities"`
}

EnsureEnvironmentResponse returns allocation identity and readiness.

type EnvironmentRef

type EnvironmentRef struct {
	ID       string `json:"id"`
	Revision string `json:"revision"`
}

EnvironmentRef is the provider-private durable environment identity.

type Error

type Error struct {
	Code      ErrorCode `json:"code"`
	Message   string    `json:"message"`
	Retryable bool      `json:"retryable,omitempty"`
}

Error is a bounded structured private-protocol failure.

func (*Error) Error

func (e *Error) Error() string

type ErrorCode

type ErrorCode string

ErrorCode is a stable private-protocol error classification.

const (
	CodeInvalidArgument   ErrorCode = "invalid_argument"
	CodeUnauthenticated   ErrorCode = "unauthenticated"
	CodePermissionDenied  ErrorCode = "permission_denied"
	CodeNotFound          ErrorCode = "not_found"
	CodeAlreadyExists     ErrorCode = "already_exists"
	CodeConflict          ErrorCode = "conflict"
	CodeVersionMismatch   ErrorCode = "version_mismatch"
	CodeDirectoryNotEmpty ErrorCode = "directory_not_empty"
	CodeNotReady          ErrorCode = "not_ready"
	CodeFenceUnknown      ErrorCode = "fence_unknown"
	CodeResourceExhausted ErrorCode = "resource_exhausted"
	CodeInternal          ErrorCode = "internal"
)

Private-protocol error codes.

func (ErrorCode) Valid

func (c ErrorCode) Valid() bool

Valid reports whether c is part of the closed private-protocol vocabulary.

type ExecutorKeepalive

type ExecutorKeepalive struct {
	Interval time.Duration
	Timeout  time.Duration
}

ExecutorKeepalive is the idle time before a ping and the wait for its reply.

func DefaultExecutorKeepalive

func DefaultExecutorKeepalive() ExecutorKeepalive

DefaultExecutorKeepalive detects a silent peer in about 20 seconds.

func (ExecutorKeepalive) OrDefault

func (k ExecutorKeepalive) OrDefault() ExecutorKeepalive

OrDefault treats the zero value as unset.

func (ExecutorKeepalive) Validate

func (k ExecutorKeepalive) Validate() error

Validate rejects values outside the bounds.

type Operation

type Operation string

Operation identifies one provider or workload-helper operation.

const (
	OpAttach                 Operation = "attach"
	OpAcquireRun             Operation = "run.acquire"
	OpRenewRun               Operation = "run.renew"
	OpReleaseRun             Operation = "run.release"
	OpReferenceCommit        Operation = "reference.commit"
	OpReferenceAbort         Operation = "reference.abort"
	OpReferenceReserve       Operation = "reference.reserve"
	OpReferenceDeletePrepare Operation = "reference.delete.prepare"
	OpReferenceDeleteConfirm Operation = "reference.delete.confirm"
	OpReferenceDeleteCancel  Operation = "reference.delete.cancel"
	OpReferenceRelease       Operation = "reference.release"
	OpRetire                 Operation = "retire"
)

Supported private-protocol operations.

func (Operation) Valid

func (o Operation) Valid() bool

Valid reports whether the operation belongs to the closed protocol vocabulary.

type Owner

type Owner struct {
	Issuer  string `json:"issuer"`
	Subject string `json:"subject"`
}

Owner is an authenticated principal attestation.

type ReferenceIntent

type ReferenceIntent struct {
	Environment     EnvironmentRef
	Owner           Owner
	BindingID       string
	State           ReferenceState
	OperationID     string
	SourceBindingID string
	CreatedAt       time.Time
}

type ReferenceReleaseRequest

type ReferenceReleaseRequest struct {
	Context RequestContext `json:"context"`
}

ReferenceReleaseRequest releases one durable binding reference.

type ReferenceRequest

type ReferenceRequest struct {
	Environment     EnvironmentRef
	Owner           Owner
	BindingID       string
	SourceBindingID string
	OperationID     string
}

type ReferenceState

type ReferenceState string
const (
	ReferencePendingCreate ReferenceState = "PendingCreate"
	ReferencePublished     ReferenceState = "Published"
	ReferencePendingDelete ReferenceState = "PendingDelete"
)

type RequestContext

type RequestContext struct {
	Environment     EnvironmentRef `json:"environment"`
	Owner           Owner          `json:"owner"`
	BindingID       string         `json:"binding_id"`
	RunID           string         `json:"run_id"`
	ClaimID         string         `json:"claim_id"`
	Epoch           uint64         `json:"epoch"`
	GrantGeneration uint64         `json:"grant_generation"`
}

RequestContext carries the exact authorization binding for an operation.

type RetireEnvironmentRequest

type RetireEnvironmentRequest struct {
	Environment    EnvironmentRef `json:"environment"`
	Owner          Owner          `json:"owner"`
	ExpectedEpoch  uint64         `json:"expected_execution_epoch"`
	ExpectedPodUID string         `json:"expected_pod_uid"`
	ExpectedPVCUID string         `json:"expected_pvc_uid"`
	OperationID    string         `json:"operation_id"`
}

RetireEnvironmentRequest requests controlled retirement without PVC deletion.

type RunClaim

type RunClaim struct {
	Environment     EnvironmentRef
	BindingID       string
	RunID           string
	ClaimID         string
	Epoch           uint64
	GrantGeneration uint64
	ExpiresAt       time.Time
}

type RunClaimRequest

type RunClaimRequest struct {
	Environment     EnvironmentRef
	Owner           Owner
	BindingID       string
	RunID           string
	ClaimID         string
	Epoch           uint64
	GrantGeneration uint64
	OperationID     string
	TTL             time.Duration
}

Directories

Path Synopsis
Package client implements the private mTLS client of the independently deployed Kubernetes execution provider.
Package client implements the private mTLS client of the independently deployed Kubernetes execution provider.
Package fixture serves an execution provider over mTLS on a loopback port, for tests of its clients.
Package fixture serves an execution provider over mTLS on a loopback port, for tests of its clients.
Package placement binds mecak8s sessions to environments of the Kubernetes execution provider.
Package placement binds mecak8s sessions to environments of the Kubernetes execution provider.
Package provider implements the authenticated provider gRPC boundary.
Package provider implements the authenticated provider gRPC boundary.

Jump to

Keyboard shortcuts

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