Documentation
¶
Index ¶
- Constants
- Variables
- func DeleteAllRecursively(ctx context.Context, cli *kubernetes.Clientset, wait bool, progress io.Writer, ...) (bool, error)
- func MakeNamespace(env *schema.Environment, ns string) *applycorev1.NamespaceApplyConfiguration
- func ModuleNamespace(ws *schema.Workspace, env *schema.Environment) string
- func PrepareProvisionWith(env *schema.Environment, ns string, systemInfo *kubedef.SystemInfo) (*rtypes.ProvisionProps, error)
- func Register()
- func RegisterOverrideClass(name string, p ProvideOverrideFunc)
- type Cluster
- func (r *Cluster) AttachTerminal(ctx context.Context, reference *runtimepb.ContainerReference, ...) error
- func (u *Cluster) Bind(env cfg.Context) (runtime.ClusterNamespace, error)
- func (u *Cluster) Class() runtime.Class
- func (r *Cluster) DeleteAllRecursively(ctx context.Context, wait bool, progress io.Writer) (bool, error)
- func (r *Cluster) EnsureState(ctx context.Context, key string) (any, error)
- func (r *Cluster) FetchDiagnostics(ctx context.Context, reference *runtimepb.ContainerReference) (*runtimepb.Diagnostics, error)
- func (r *Cluster) FetchLogsTo(ctx context.Context, reference *runtimepb.ContainerReference, ...) error
- func (r *Cluster) ForwardIngress(ctx context.Context, localAddrs []string, localPort int, ...) (io.Closer, error)
- func (u *Cluster) Planner(env cfg.Context) runtime.Planner
- func (u *Cluster) PreparedClient() client.Prepared
- func (u *Cluster) RESTConfig() *rest.Config
- func (u *Cluster) RawDialServer(ctx context.Context, ns string, podLabels map[string]string, ...) (net.Conn, error)
- func (u *Cluster) RawForwardPort(ctx context.Context, desc, ns string, podLabels map[string]string, ...) (io.Closer, error)
- func (r *Cluster) RunAttachedOpts(ctx context.Context, ns, name string, runOpts runtime.ContainerRunOpts, ...) error
- func (r *Cluster) StartAndBlockPortFwd(ctx context.Context, args StartAndBlockPortFwdArgs) error
- func (r *Cluster) SystemInfo(ctx context.Context) (*kubedef.SystemInfo, error)
- func (r *Cluster) UnmatchedTargetPlatforms(ctx context.Context) ([]specs.Platform, error)
- type ClusterAttachedState
- type ClusterNamespace
- func (cn *ClusterNamespace) Cluster() runtime.Cluster
- func (r *ClusterNamespace) DeleteDeployable(ctx context.Context, deployable runtime.Deployable) error
- func (r *ClusterNamespace) DeleteRecursively(ctx context.Context, wait bool) (bool, error)
- func (r *ClusterNamespace) DeployedConfigImageID(ctx context.Context, server runtime.Deployable) (oci.ImageID, error)
- func (r *ClusterNamespace) DialServer(ctx context.Context, server runtime.Deployable, port *schema.Endpoint_Port) (net.Conn, error)
- func (r *ClusterNamespace) FetchEnvironmentDiagnostics(ctx context.Context) (*storage.EnvironmentDiagnostics, error)
- func (r *ClusterNamespace) ForwardPort(ctx context.Context, server runtime.Deployable, containerPort int32, ...) (io.Closer, error)
- func (r *ClusterNamespace) KubeConfig() kubedef.KubeConfig
- func (r *ClusterNamespace) Observe(ctx context.Context, srv runtime.Deployable, opts runtime.ObserveOpts, ...) error
- func (cn *ClusterNamespace) Planner() runtime.Planner
- func (r *ClusterNamespace) ResolveContainers(ctx context.Context, object runtime.Deployable) ([]*runtimepb.ContainerReference, error)
- func (r *ClusterNamespace) StartTerminal(ctx context.Context, server runtime.Deployable, rio runtime.TerminalIO, ...) error
- func (r *ClusterNamespace) WaitForTermination(ctx context.Context, object runtime.Deployable) ([]runtime.ContainerStatus, error)
- func (r *ClusterNamespace) WaitUntilReady(ctx context.Context, srv runtime.Deployable) error
- type Planner
- func (r Planner) ComputeBaseNaming(*fnschema.Naming) (*fnschema.ComputedNaming, error)
- func (r Planner) KubernetesNamespace() string
- func (r Planner) PlanDeployment(ctx context.Context, d runtime.DeploymentSpec) (*runtime.DeploymentPlan, error)
- func (r Planner) PlanIngress(ctx context.Context, stack *fnschema.Stack, ...) (*runtime.DeploymentPlan, error)
- func (r Planner) PrepareProvision(ctx context.Context) (*rtypes.ProvisionProps, error)
- func (r Planner) TargetPlatforms(ctx context.Context) ([]specs.Platform, error)
- type PodResolver
- type ProvideOverrideFunc
- type StartAndBlockPortFwdArgs
Constants ¶
View Source
const PortForwardProtocolV1Name = "portforward.k8s.io"
View Source
const RestmapperStateKey = "kubernetes.restmapper"
Variables ¶
View Source
var ( UseNodePlatformsForProduction = false ProductionPlatforms = []string{"linux/amd64", "linux/arm64"} )
View Source
var DeployAsPodsInTests = true
View Source
var (
ObserveInitContainerLogs = false
)
Functions ¶
func DeleteAllRecursively ¶
func MakeNamespace ¶
func MakeNamespace(env *schema.Environment, ns string) *applycorev1.NamespaceApplyConfiguration
func ModuleNamespace ¶
func ModuleNamespace(ws *schema.Workspace, env *schema.Environment) string
We use namespaces to isolate deployments per workspace and environment. Using the path base plus a digest provides short, memorable names and avoids collision. TODO add knob to allow namespace overwrites if the need arises.
func PrepareProvisionWith ¶
func PrepareProvisionWith(env *schema.Environment, ns string, systemInfo *kubedef.SystemInfo) (*rtypes.ProvisionProps, error)
func RegisterOverrideClass ¶
func RegisterOverrideClass(name string, p ProvideOverrideFunc)
Types ¶
type Cluster ¶
type Cluster struct { FetchSystemInfo func(context.Context) (*kubedef.SystemInfo, error) ClusterAttachedState // contains filtered or unexported fields }
func ConnectToCluster ¶
func (*Cluster) AttachTerminal ¶
func (r *Cluster) AttachTerminal(ctx context.Context, reference *runtimepb.ContainerReference, rio runtime.TerminalIO) error
func (*Cluster) DeleteAllRecursively ¶
func (*Cluster) EnsureState ¶
func (*Cluster) FetchDiagnostics ¶
func (r *Cluster) FetchDiagnostics(ctx context.Context, reference *runtimepb.ContainerReference) (*runtimepb.Diagnostics, error)
func (*Cluster) FetchLogsTo ¶
func (r *Cluster) FetchLogsTo(ctx context.Context, reference *runtimepb.ContainerReference, opts runtime.FetchLogsOpts, callback func(runtime.ContainerLogLine)) error
func (*Cluster) ForwardIngress ¶
func (*Cluster) PreparedClient ¶
func (*Cluster) RESTConfig ¶
func (*Cluster) RawDialServer ¶
func (*Cluster) RawForwardPort ¶
func (*Cluster) RunAttachedOpts ¶
func (r *Cluster) RunAttachedOpts(ctx context.Context, ns, name string, runOpts runtime.ContainerRunOpts, io runtime.TerminalIO, onStart func()) error
func (*Cluster) StartAndBlockPortFwd ¶
func (r *Cluster) StartAndBlockPortFwd(ctx context.Context, args StartAndBlockPortFwdArgs) error
func (*Cluster) SystemInfo ¶
type ClusterAttachedState ¶
type ClusterAttachedState struct {
// contains filtered or unexported fields
}
func (*ClusterAttachedState) EnsureState ¶
type ClusterNamespace ¶
type ClusterNamespace struct {
// contains filtered or unexported fields
}
func ConnectToNamespace ¶
func (*ClusterNamespace) Cluster ¶
func (cn *ClusterNamespace) Cluster() runtime.Cluster
func (*ClusterNamespace) DeleteDeployable ¶
func (r *ClusterNamespace) DeleteDeployable(ctx context.Context, deployable runtime.Deployable) error
func (*ClusterNamespace) DeleteRecursively ¶
func (*ClusterNamespace) DeployedConfigImageID ¶
func (r *ClusterNamespace) DeployedConfigImageID(ctx context.Context, server runtime.Deployable) (oci.ImageID, error)
func (*ClusterNamespace) DialServer ¶
func (r *ClusterNamespace) DialServer(ctx context.Context, server runtime.Deployable, port *schema.Endpoint_Port) (net.Conn, error)
func (*ClusterNamespace) FetchEnvironmentDiagnostics ¶
func (r *ClusterNamespace) FetchEnvironmentDiagnostics(ctx context.Context) (*storage.EnvironmentDiagnostics, error)
func (*ClusterNamespace) ForwardPort ¶
func (r *ClusterNamespace) ForwardPort(ctx context.Context, server runtime.Deployable, containerPort int32, localAddrs []string, callback runtime.SinglePortForwardedFunc) (io.Closer, error)
func (*ClusterNamespace) KubeConfig ¶
func (r *ClusterNamespace) KubeConfig() kubedef.KubeConfig
func (*ClusterNamespace) Observe ¶
func (r *ClusterNamespace) Observe(ctx context.Context, srv runtime.Deployable, opts runtime.ObserveOpts, onInstance func(runtime.ObserveEvent) (bool, error)) error
Return true on the callback to signal you're done observing.
func (*ClusterNamespace) Planner ¶
func (cn *ClusterNamespace) Planner() runtime.Planner
func (*ClusterNamespace) ResolveContainers ¶
func (r *ClusterNamespace) ResolveContainers(ctx context.Context, object runtime.Deployable) ([]*runtimepb.ContainerReference, error)
func (*ClusterNamespace) StartTerminal ¶
func (r *ClusterNamespace) StartTerminal(ctx context.Context, server runtime.Deployable, rio runtime.TerminalIO, command string, rest ...string) error
func (*ClusterNamespace) WaitForTermination ¶
func (r *ClusterNamespace) WaitForTermination(ctx context.Context, object runtime.Deployable) ([]runtime.ContainerStatus, error)
func (*ClusterNamespace) WaitUntilReady ¶ added in v0.0.75
func (r *ClusterNamespace) WaitUntilReady(ctx context.Context, srv runtime.Deployable) error
type Planner ¶
type Planner struct {
// contains filtered or unexported fields
}
func NewPlanner ¶
func (Planner) ComputeBaseNaming ¶
func (Planner) KubernetesNamespace ¶
func (Planner) PlanDeployment ¶
func (r Planner) PlanDeployment(ctx context.Context, d runtime.DeploymentSpec) (*runtime.DeploymentPlan, error)
func (Planner) PlanIngress ¶
func (r Planner) PlanIngress(ctx context.Context, stack *fnschema.Stack, allFragments []*fnschema.IngressFragment) (*runtime.DeploymentPlan, error)
func (Planner) PrepareProvision ¶
type ProvideOverrideFunc ¶
type StartAndBlockPortFwdArgs ¶
type StartAndBlockPortFwdArgs struct { Namespace string Identifier string LocalAddrs []string LocalPort int // 0 to be dynamically allocated. ContainerPort int PodResolver PodResolver ReportPorts func(runtime.ForwardedPort) }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.