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
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
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.
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
// 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
// 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
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