k8s

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package k8s is the Kubernetes sandbox backend: one disposable Pod per session, driven over the Kubernetes API. The image must carry /bin/bash at that exact path (the plan's image contract) plus a userland with `setsid` (the deadline wrapper backgrounds the command in its own session) and a `stat` that accepts `-c` (GNU or BusyBox) — a shade beyond bare POSIX, but met by any mainstream base image. It is the self-hosted twin of the docker backend and passes the same sandboxtest contract suite.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Kubeconfig    string
	Context       string
	Namespace     string
	NetSetupImage string
}

Config selects the cluster and namespace. Kubeconfig empty with Context empty tries in-cluster config first (the executor running as a Deployment), then the default loading rules (KUBECONFIG, ~/.kube/config) — the latter is what the contract test and local development use.

NetSetupImage is the tiny utility image whose init container flushes a limited sandbox's routing table (it needs an `ip` command, which the sandbox image is not required to carry); empty defaults to busybox.

type Provider

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

Provider provisions per-session pods.

func New

func New(cfg Config) (*Provider, error)

func (*Provider) Provision

func (p *Provider) Provision(ctx context.Context, spec sandbox.Spec) (sandbox.Sandbox, error)

Provision returns the session's pod, creating and starting it only if none exists. Two executors racing on the same session converge: the loser of the create race adopts the winner's pod.

Jump to

Keyboard shortcuts

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