Documentation
¶
Index ¶
- Constants
- func MaterializeConfigLayer(ctx context.Context, kubeClient client.Client, namespace string, ...) (map[string]string, error)
- func MaterializeImagePullSecret(ctx context.Context, kubeClient client.Client, namespace string, name string, ...) (*runtimev2.ImagePullSecret, error)
- func MergeMaps(maps ...map[string]string) map[string]string
- func ResolveConfigFrom(ctx context.Context, kubeClient client.Client, namespace string, ...) (map[string]string, error)
- func ResolveSecretFrom(ctx context.Context, kubeClient client.Client, namespace string, ...) (map[string]string, error)
- func RoundTrip[Req proto.Message, Resp proto.Message](ctx context.Context, bus wasmbus.Bus, subject string, req Req, resp Resp) error
- type ArtifactReconciler
- type HostPodReconciler
- type HostReconciler
- type WashHostClient
- func (w *WashHostClient) Heartbeat(ctx context.Context) (*runtimev2.HostHeartbeat, error)
- func (w *WashHostClient) Start(ctx context.Context, req *runtimev2.WorkloadStartRequest) (*runtimev2.WorkloadStartResponse, error)
- func (w *WashHostClient) Status(ctx context.Context, req *runtimev2.WorkloadStatusRequest) (*runtimev2.WorkloadStatusResponse, error)
- func (w *WashHostClient) Stop(ctx context.Context, req *runtimev2.WorkloadStopRequest) (*runtimev2.WorkloadStopResponse, error)
- type WorkloadDeploymentReconciler
- type WorkloadReconciler
- type WorkloadReplicaSetReconciler
- type WorkloadRouteReconciler
Constants ¶
const ( // HostPodLabel is a marker label that must be present on host Pods. // No specific value is required — its presence is enough to opt the Pod // into lifecycle tracking. The operator maps the Pod to its Host CRD via // pod.Status.PodIP, which matches Host.Hostname (set from req.Hostname in // the NATS heartbeat). Using PodIP means the HostGroup deployment template // does not need to know the wasmCloud host ID ahead of time. HostPodLabel = "wasmcloud.com/hostgroup" )
HostRoundtripTimeout is the max timeout for host RPC calls. Callers can set lower context timeouts as needed.
Variables ¶
This section is empty.
Functions ¶
func MaterializeConfigLayer ¶
func MaterializeConfigLayer(ctx context.Context, kubeClient client.Client, namespace string, configLayer *runtimev1alpha1.ConfigLayer, ) (map[string]string, error)
func MaterializeImagePullSecret ¶
func MergeMaps ¶
MergeMaps merges multiple maps of strings into a single map.
func ResolveConfigFrom ¶
func ResolveSecretFrom ¶
Types ¶
type ArtifactReconciler ¶
type ArtifactReconciler struct {
client.Client
Scheme *runtime.Scheme
// contains filtered or unexported fields
}
ArtifactReconciler reconciles a Workload object
func (*ArtifactReconciler) Reconcile ¶
func (*ArtifactReconciler) SetupWithManager ¶
func (r *ArtifactReconciler) SetupWithManager(mgr ctrl.Manager) error
type HostPodReconciler ¶ added in v2.0.2
type HostPodReconciler struct {
client.Client
Scheme *runtime.Scheme
// OperatorNamespace is the namespace where Host CRDs live.
OperatorNamespace string
}
HostPodReconciler bridges Pod lifecycle to Host CRD lifecycle.
It adds a finalizer to every Pod labeled with HostPodLabel. When a Pod is deleted (DeletionTimestamp set), the finalizer fires and the corresponding Host CRD — identified by matching Host.Hostname to pod.Status.PodIP — is deleted before Kubernetes removes the Pod from etcd.
Deleting the Host CRD triggers the HostReconciler finalizer, which in turn deletes all Workload objects assigned to that host. This replaces the previous path where the operator waited for up to UnreachableTimeout + hostReconcileInterval (≈2 min) to discover a dead host via missed heartbeats.
Pod side may be cross-namespace: host Pods can run in any namespace listed in operator.hostNamespaces. Host side is single-namespace: every Host CRD lives in the operator's own namespace.
func (*HostPodReconciler) Reconcile ¶ added in v2.0.2
Reconcile is called whenever a Pod with HostPodLabel changes.
+kubebuilder:rbac:groups="",resources=pods,verbs=get;list;patch;watch +kubebuilder:rbac:groups=runtime.wasmcloud.dev,resources=hosts,verbs=get;list;delete
func (*HostPodReconciler) SetupWithManager ¶ added in v2.0.2
func (r *HostPodReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager registers the controller and the Host field index it depends on.
type HostReconciler ¶
type HostReconciler struct {
client.Client
Scheme *runtime.Scheme
Bus wasmbus.Bus
UnreachableTimeout time.Duration
CPUThreshold float64
MemoryThreshold float64
// OperatorNamespace is the namespace the operator itself runs in. Every
// Host object is created here regardless of where the underlying host
// pod runs; tenant attribution lives on the Host's Environment field.
OperatorNamespace string
// contains filtered or unexported fields
}
HostReconciler reconciles a Host object
func (*HostReconciler) Reconcile ¶
func (*HostReconciler) SetupWithManager ¶
func (r *HostReconciler) SetupWithManager(mgr ctrl.Manager) error
type WashHostClient ¶
func NewWashHostClient ¶
func NewWashHostClient(bus wasmbus.Bus, hostID string) *WashHostClient
func (*WashHostClient) Heartbeat ¶
func (w *WashHostClient) Heartbeat(ctx context.Context) (*runtimev2.HostHeartbeat, error)
func (*WashHostClient) Start ¶
func (w *WashHostClient) Start(ctx context.Context, req *runtimev2.WorkloadStartRequest) (*runtimev2.WorkloadStartResponse, error)
func (*WashHostClient) Status ¶
func (w *WashHostClient) Status(ctx context.Context, req *runtimev2.WorkloadStatusRequest) (*runtimev2.WorkloadStatusResponse, error)
func (*WashHostClient) Stop ¶
func (w *WashHostClient) Stop(ctx context.Context, req *runtimev2.WorkloadStopRequest) (*runtimev2.WorkloadStopResponse, error)
type WorkloadDeploymentReconciler ¶
type WorkloadDeploymentReconciler struct {
client.Client
Scheme *runtime.Scheme
// contains filtered or unexported fields
}
WorkloadDeploymentReconciler reconciles a WorkloadReplicaSet object
func (*WorkloadDeploymentReconciler) Reconcile ¶
func (*WorkloadDeploymentReconciler) SetupWithManager ¶
func (r *WorkloadDeploymentReconciler) SetupWithManager(mgr ctrl.Manager) error
type WorkloadReconciler ¶
type WorkloadReconciler struct {
client.Client
Scheme *runtime.Scheme
Bus wasmbus.Bus
Recorder events.EventRecorder
// OperatorNamespace is the namespace every Host CRD lives in. The
// scheduler always lists Hosts in this namespace; tenant boundaries
// are enforced via the Host.Environment field, not via Host.Namespace.
OperatorNamespace string
// whose Environment differs from the Workload's own namespace (via
// Spec.Environment). When false, cross-tenant scheduling is rejected
// and a Warning Event is recorded on the Workload.
AllowSharedHosts bool
// contains filtered or unexported fields
}
WorkloadReconciler reconciles a Workload object
func (*WorkloadReconciler) Reconcile ¶
func (*WorkloadReconciler) SetupWithManager ¶
func (r *WorkloadReconciler) SetupWithManager(mgr ctrl.Manager) error
type WorkloadReplicaSetReconciler ¶
type WorkloadReplicaSetReconciler struct {
client.Client
Scheme *runtime.Scheme
// contains filtered or unexported fields
}
WorkloadReplicaSetReconciler reconciles a WorkloadReplicaSet object
func (*WorkloadReplicaSetReconciler) Reconcile ¶
func (*WorkloadReplicaSetReconciler) SetupWithManager ¶
func (r *WorkloadReplicaSetReconciler) SetupWithManager(mgr ctrl.Manager) error
type WorkloadRouteReconciler ¶ added in v2.0.3
type WorkloadRouteReconciler struct {
client.Client
Scheme *runtime.Scheme
// OperatorNamespace is where every Host CRD lives.
OperatorNamespace string
}
WorkloadRouteReconciler maintains EndpointSlices for Kubernetes Services referenced by WorkloadDeployments. When a Workload becomes ready, this reconciler ensures the Service's EndpointSlice contains the pod IP of the host running that workload.
func (*WorkloadRouteReconciler) Reconcile ¶ added in v2.0.3
func (r *WorkloadRouteReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile is keyed on namespace/service-name (not workload name) so that a single reconciliation pass can collect all Ready workloads for a given Service and produce an authoritative EndpointSlice.
func (*WorkloadRouteReconciler) SetupWithManager ¶ added in v2.0.3
func (r *WorkloadRouteReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager. +kubebuilder:rbac:groups=discovery.k8s.io,resources=endpointslices,verbs=create;delete;get;list;patch;update;watch +kubebuilder:rbac:groups="",resources=services,verbs=get;list;watch
Source Files
¶
- artifact_controller.go
- host_client.go
- host_controller.go
- host_pod_controller.go
- utils.go
- workload_controller.go
- workload_deployment_controller.go
- workload_replicaset_controller.go
- workload_route_controller.go