Documentation
¶
Index ¶
- type AllocateOptions
- type Client
- type Config
- type ControlPlane
- type Playpen
- func (p *Playpen) Close(ctx context.Context) error
- func (p *Playpen) Command(ctx context.Context, name string, args ...string) (*exec.Cmd, error)
- func (p *Playpen) ConfigureTunnel(ctx context.Context) error
- func (p *Playpen) OverrideEndpoint(host string, port int32)
- func (p *Playpen) Run(ctx context.Context, name string, args ...string) error
- func (p *Playpen) StreamConsoleLogs(ctx context.Context, dst io.Writer) <-chan error
- func (p *Playpen) TunnelConfig() TunnelConfig
- func (p *Playpen) WireGuardPrivateKey() string
- type TunnelConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllocateOptions ¶
type AllocateOptions struct {
// Architecture optionally requests a runner architecture. Empty defaults to amd64.
Architecture string
// KubernetesVersion optionally requests a control-plane Kubernetes version.
KubernetesVersion string
// WireGuardPrivateKey is the client's WireGuard private key. If empty, one is generated.
WireGuardPrivateKey string
// Tunnel optionally overrides local tunnel settings.
Tunnel TunnelConfig
}
AllocateOptions controls one playpen allocation.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a high-level client for allocating and releasing playpens.
func (*Client) AllocateControlPlane ¶
func (c *Client) AllocateControlPlane(ctx context.Context, opts AllocateOptions) (*ControlPlane, error)
AllocateControlPlane allocates an idle Kubernetes control plane and returns its metadata.
type Config ¶
type Config struct {
// RESTConfig connects to the Kubernetes API server hosting the playpen aggregated API.
RESTConfig *rest.Config
// HTTPClient overrides the client built from RESTConfig. It is intended for tests.
HTTPClient *http.Client
// contains filtered or unexported fields
}
Config contains settings for connecting to the playpen aggregated API.
type ControlPlane ¶
type ControlPlane struct {
Metadata operator.AllocResponse
// contains filtered or unexported fields
}
ControlPlane represents one allocated playpen Kubernetes control plane.
func (*ControlPlane) Close ¶
func (cp *ControlPlane) Close(ctx context.Context) error
Close releases the control-plane allocation.
func (*ControlPlane) Kubeconfig ¶
func (cp *ControlPlane) Kubeconfig() string
Kubeconfig returns the host-reachable kubeconfig for this control plane.
type Playpen ¶
type Playpen struct {
Metadata operator.AllocResponse
// contains filtered or unexported fields
}
Playpen represents one allocated playpen runner pod and its local resources.
func (*Playpen) Command ¶
Command returns a command configured to execute inside the playpen network namespace.
func (*Playpen) ConfigureTunnel ¶
ConfigureTunnel creates the local WireGuard and VXLAN resources for this playpen.
func (*Playpen) OverrideEndpoint ¶
OverrideEndpoint replaces the WireGuard endpoint used by future tunnel setup.
func (*Playpen) StreamConsoleLogs ¶
StreamConsoleLogs asynchronously streams serial console logs into dst until ctx is canceled or the stream fails. The returned channel receives one error.
func (*Playpen) TunnelConfig ¶
func (p *Playpen) TunnelConfig() TunnelConfig
TunnelConfig returns the local tunnel settings for this playpen.
func (*Playpen) WireGuardPrivateKey ¶
WireGuardPrivateKey returns the client's WireGuard private key for this playpen.
type TunnelConfig ¶
type TunnelConfig struct {
NetworkNamespace string
WireGuardInterface string
VXLANInterface string
ManagementHostInterface string
ManagementNamespaceInterface string
ManagementHostAddress string
ManagementNamespaceAddress string
WireGuardListenPort int
PersistentKeepalive int
PrivateKeyFile string
}
TunnelConfig controls local interface names and WireGuard settings.