v1alpha1

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

+k8s:deepcopy-gen=package +groupName=wasm.serving.knative.dev

Index

Constants

View Source
const (
	// WasmModuleConditionReady is set when the revision is starting to materialize
	// runtime resources, and becomes true when those resources are ready.
	WasmModuleConditionReady = apis.ConditionReady
)

Variables

View Source
var (
	// SchemeBuilder builds a scheme with the types known to the package.
	SchemeBuilder = runtime.NewSchemeBuilder(AddKnownTypes) //nolint:gochecknoglobals
	// AddToScheme adds the types known to this package to an existing schema.
	AddToScheme = SchemeBuilder.AddToScheme //nolint:gochecknoglobals
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: wasm.GroupName, Version: "v1alpha1"} //nolint:gochecknoglobals

SchemeGroupVersion is group version used to register these objects.

Functions

func AddKnownTypes

func AddKnownTypes(scheme *runtime.Scheme) error

AddKnownTypes adds the list of known types to Scheme.

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns back a Group qualified GroupKind.

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource.

Types

type NetworkSpec

type NetworkSpec struct {
	// Inherit indicates whether to inherit the host's full network stack.
	// When true, all network operations are allowed.
	// Maps to WasiCtxBuilder::inherit_network().
	// Defaults to false.
	// +optional
	Inherit bool `json:"inherit,omitempty"`

	// AllowIpNameLookup enables DNS resolution.
	// Maps to WasiCtxBuilder::allow_ip_name_lookup().
	// Defaults to true when Network is specified.
	// +optional
	AllowIPNameLookup *bool `json:"allowIpNameLookup,omitempty"`

	// TCP specifies TCP socket permissions.
	// +optional
	TCP *TCPSpec `json:"tcp,omitempty"`

	// UDP specifies UDP socket permissions.
	// +optional
	UDP *UDPSpec `json:"udp,omitempty"`
}

NetworkSpec specifies network access configuration for the WASM module. Address patterns support both IP addresses and hostnames. Format: "host:port" - host can be IP or hostname. Wildcards: "*:port", "host:*", "*:*".

func (*NetworkSpec) DeepCopy

func (in *NetworkSpec) DeepCopy() *NetworkSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkSpec.

func (*NetworkSpec) DeepCopyInto

func (in *NetworkSpec) DeepCopyInto(out *NetworkSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*NetworkSpec) SetDefaults

func (ns *NetworkSpec) SetDefaults()

SetDefaults sets default values for NetworkSpec.

func (*NetworkSpec) Validate

func (ns *NetworkSpec) Validate() *apis.FieldError

Validate validates the NetworkSpec.

type TCPSpec

type TCPSpec struct {
	// Bind is a list of address patterns allowed for TCP bind.
	// +optional
	Bind []string `json:"bind,omitempty"`

	// Connect is a list of address patterns allowed for TCP connect.
	// +optional
	Connect []string `json:"connect,omitempty"`
}

TCPSpec specifies TCP socket permissions.

func (*TCPSpec) DeepCopy

func (in *TCPSpec) DeepCopy() *TCPSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TCPSpec.

func (*TCPSpec) DeepCopyInto

func (in *TCPSpec) DeepCopyInto(out *TCPSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type UDPSpec

type UDPSpec struct {
	// Bind is a list of address patterns allowed for UDP bind.
	// +optional
	Bind []string `json:"bind,omitempty"`

	// Connect is a list of address patterns allowed for UDP connect.
	// +optional
	Connect []string `json:"connect,omitempty"`

	// Outgoing is a list of address patterns allowed for UDP outgoing datagrams.
	// +optional
	Outgoing []string `json:"outgoing,omitempty"`
}

UDPSpec specifies UDP socket permissions.

func (*UDPSpec) DeepCopy

func (in *UDPSpec) DeepCopy() *UDPSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UDPSpec.

func (*UDPSpec) DeepCopyInto

func (in *UDPSpec) DeepCopyInto(out *UDPSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type WasmModule

type WasmModule struct {
	metav1.TypeMeta `json:",inline"`
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Spec holds the desired state of the WasmModule (from the client).
	// +optional
	Spec WasmModuleSpec `json:"spec,omitempty"`

	// Status communicates the observed state of the WasmModule (from the controller).
	// +optional
	Status WasmModuleStatus `json:"status,omitempty"`
}

WasmModule is a Knative's WASM module that accepts HTTP.

+genclient +genreconciler +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*WasmModule) DeepCopy

func (in *WasmModule) DeepCopy() *WasmModule

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WasmModule.

func (*WasmModule) DeepCopyInto

func (in *WasmModule) DeepCopyInto(out *WasmModule)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*WasmModule) DeepCopyObject

func (in *WasmModule) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*WasmModule) GetConditionSet

func (as *WasmModule) GetConditionSet() apis.ConditionSet

GetConditionSet retrieves the condition set for this resource. Implements the KRShaped interface.

func (*WasmModule) GetGroupVersionKind

func (*WasmModule) GetGroupVersionKind() schema.GroupVersionKind

GetGroupVersionKind implements kmeta.OwnerRefable.

func (*WasmModule) GetStatus

func (as *WasmModule) GetStatus() *duckv1.Status

GetStatus retrieves the status of the resource. Implements the KRShaped interface.

func (*WasmModule) SetDefaults

func (as *WasmModule) SetDefaults(_ context.Context)

SetDefaults implements apis.Defaultable.

func (*WasmModule) Validate

func (as *WasmModule) Validate(ctx context.Context) *apis.FieldError

Validate implements apis.Validatable.

type WasmModuleList

type WasmModuleList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

	Items []WasmModule `json:"items"`
}

WasmModuleList is a list of WasmModule resources

+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*WasmModuleList) DeepCopy

func (in *WasmModuleList) DeepCopy() *WasmModuleList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WasmModuleList.

func (*WasmModuleList) DeepCopyInto

func (in *WasmModuleList) DeepCopyInto(out *WasmModuleList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*WasmModuleList) DeepCopyObject

func (in *WasmModuleList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type WasmModuleSpec

type WasmModuleSpec struct {
	// Image is the OCI artifact containing the WASM module.
	// Required field.
	Image string `json:"image"`

	// Args are command line arguments passed to the WASM module.
	// +optional
	Args []string `json:"args,omitempty"`

	// Env is a list of environment variables to set in the WASM module.
	// +optional
	Env []corev1.EnvVar `json:"env,omitempty"`

	// VolumeMounts describes volumes to mount as WASI preopened directories.
	// +optional
	VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`

	// Volumes defines the volumes that can be mounted.
	// +optional
	Volumes []corev1.Volume `json:"volumes,omitempty"`

	// Resources specifies compute resource requirements.
	// requests.memory and limits.memory map to WASM memory limits.
	// limits.cpu is converted to fuel units for execution limiting.
	// +optional
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`

	// Network specifies network access configuration for WASI sockets.
	// By default, network access is disabled.
	// +optional
	Network *NetworkSpec `json:"network,omitempty"`
}

WasmModuleSpec holds the desired state of the WasmModule (from the client). Mirrors corev1.Container structure where applicable. Stdio is always inherited from the host process.

func (*WasmModuleSpec) DeepCopy

func (in *WasmModuleSpec) DeepCopy() *WasmModuleSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WasmModuleSpec.

func (*WasmModuleSpec) DeepCopyInto

func (in *WasmModuleSpec) DeepCopyInto(out *WasmModuleSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*WasmModuleSpec) SetDefaults

func (ass *WasmModuleSpec) SetDefaults()

SetDefaults sets default values for WasmModuleSpec.

func (*WasmModuleSpec) Validate

func (ass *WasmModuleSpec) Validate(_ context.Context) *apis.FieldError

Validate implements apis.Validatable.

type WasmModuleStatus

type WasmModuleStatus struct {
	duckv1.Status `json:",inline"`

	// Address holds the information needed to connect this Addressable up to receive events.
	// +optional
	Address *duckv1.Addressable `json:"address,omitempty"`
}

WasmModuleStatus communicates the observed state of the WasmModule (from the controller).

func (*WasmModuleStatus) DeepCopy

func (in *WasmModuleStatus) DeepCopy() *WasmModuleStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WasmModuleStatus.

func (*WasmModuleStatus) DeepCopyInto

func (in *WasmModuleStatus) DeepCopyInto(out *WasmModuleStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*WasmModuleStatus) InitializeConditions

func (ass *WasmModuleStatus) InitializeConditions()

InitializeConditions sets the initial values to the conditions.

func (*WasmModuleStatus) MarkServiceAvailable

func (ass *WasmModuleStatus) MarkServiceAvailable()

func (*WasmModuleStatus) MarkServiceFailed added in v0.2.0

func (ass *WasmModuleStatus) MarkServiceFailed(reason, message string)

MarkServiceFailed marks the WasmModule as permanently failed, propagating the terminal failure reason and message from the underlying Knative Service. Use this when the ksvc has a terminal failure (e.g. RevisionFailed, ContainerMissing) so clients can distinguish transient from terminal errors.

func (*WasmModuleStatus) MarkServiceUnavailable

func (ass *WasmModuleStatus) MarkServiceUnavailable(name string)

Jump to

Keyboard shortcuts

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