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
- func ClientIdentity(c *x509.Certificate) (string, error)
- func DecodeStrict(data []byte, dst any) error
- func ExecutorKeepaliveInRange(d time.Duration) bool
- func TemplateCapabilities() []string
- func ValidAdmittedCapabilities(v []string) bool
- type AttachEnvironmentRequest
- type AttachEnvironmentResponse
- type EmptyResponse
- type EnsureEnvironmentResponse
- type EnvironmentRef
- type Error
- type ErrorCode
- type ExecutorKeepalive
- type Operation
- type Owner
- type ReferenceIntent
- type ReferenceReleaseRequest
- type ReferenceRequest
- type ReferenceState
- type RequestContext
- type RetireEnvironmentRequest
- type RunClaim
- type RunClaimRequest
Constants ¶
const ( CapabilityFilesystem = "filesystem" CapabilityForegroundCommand = "foreground-command" )
Execution capability names shared by templates, requests, and admitted sets.
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.
const ( KeepaliveIntervalFlag = "keepalive-interval" KeepaliveTimeoutFlag = "keepalive-timeout" )
Executor serve flag names.
const ( MinExecutorKeepalive = time.Second MaxExecutorKeepalive = 10 * time.Minute )
Keepalive bounds.
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.
const ( MinRunTTL = 30 * time.Second MaxRunTTL = 5 * time.Minute DefaultRunTTL = time.Minute DefaultRenewInterval = 20 * time.Second )
const ExecutorHealthPort = 7444
ExecutorHealthPort is the TCP port of the executor's plaintext health server, which the kubelet's readiness probe calls.
const ExecutorMinClientPing = 5 * time.Second
ExecutorMinClientPing is below gRPC's 10s client floor, so any provider ping is permitted.
const ExecutorServerPort = 7443
ExecutorServerPort is the TCP port of the executor gRPC server in its Pod.
const HealthListenFlag = "health-listen"
HealthListenFlag names the executor flag giving the health server's address.
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 ¶
DecodeStrict decodes exactly one bounded JSON value without unknown or duplicate fields.
func ExecutorKeepaliveInRange ¶
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 ¶
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 ¶
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.
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.
type ExecutorKeepalive ¶
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.
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.
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. |