runtime_operator

package module
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

README

Runtime Operator

Development

You will need a local Kind cluster, NATS, and a Wash host.

For NATS, use:

docker run --rm --name wasmcloud-nats -p 4222:4222 nats -js

For Wash Host, use:

wash host --http-addr 127.0.0.1:8000

or from the top git directory:

cargo run -- host --http-addr 127.0.0.1:8000

For local kind cluster, refer to wash/README.md.

Install the CRDs into the cluster:

make install

Run the Builder / Watcher:

make devlog

You can apply development samples from the config/sample:

kubectl apply -f config/samples

Verify the Wash Host registered correctly with:

kubectl get host

Example:

❯ kubectl get host
NAME               HOSTID                                 HOSTGROUP   READY   AGE
exotic-toes-5866   14b0a1df-3f91-441c-b304-2aa56e9bef6e   default     True    52s

If you applied the samples, check if they deployed correctly:

❯ kubectl get workloaddeployment
NAME     REPLICAS   READY
blobby   1          True
hello    1          True

❯ curl -i hello.localhost.direct:8000
HTTP/1.1 200 OK
transfer-encoding: chunked
date: Tue, 25 Nov 2025 15:30:32 GMT

Hello from Rust!

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmbeddedOperator

type EmbeddedOperator struct {
	Bus      wasmbus.Bus
	NatsConn *nats.Conn
}

EmbeddedOperator is the main struct for the embedded operator. It allows embedding the Runtime Operator into other applications.

func NewEmbeddedOperator

func NewEmbeddedOperator(
	ctx context.Context,
	mgr manager.Manager,
	cfg EmbeddedOperatorConfig,
) (*EmbeddedOperator, error)

NewEmbeddedOperator creates a new EmbeddedOperator.

type EmbeddedOperatorConfig

type EmbeddedOperatorConfig struct {
	// NATS connection string. Used to communicate with hosts.
	NatsURL string
	// NATS options. Used to configure the NATS connection.
	NatsOptions []nats.Option
	// Heartbeat TTL. Used to determine how long to wait before considering a host unreachable.
	HeartbeatTTL time.Duration
	// Host CPU threshold (percentage).
	// Used to calculate workload scheduling, avoiding hosts that are over this threshold.
	HostCPUThreshold float64
	// Host Memory threshold (percentage).
	// Used to calculate workload scheduling, avoiding hosts that are over this threshold.
	HostMemoryThreshold float64
	// Disable Artifact Controller. If set, Artifacts must be marked as 'Ready' elsewhere.
	// Useful when introducing a custom artifact management solution.
	DisableArtifactController bool
}

Source Files

  • operator.go

Directories

Path Synopsis
api
condition
+kubebuilder:object:generate=true +kubebuilder:unservedversion
+kubebuilder:object:generate=true +kubebuilder:unservedversion
runtime/v1alpha1
Package v1alpha1 contains API Schema definitions for the runtime v1alpha1 API group.
Package v1alpha1 contains API Schema definitions for the runtime v1alpha1 API group.
internal
pkg
test

Jump to

Keyboard shortcuts

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