Skip to content

Services created by wasmcloud-operator Are Non-Functional #108

Open
@albertoec

Description

@albertoec

I have been experimenting with the wasmcloud-operator as described in the official documentation, and I have encountered unexpected behavior regarding the ports defined in the "Application" CR.

The wasmCloud documentation claims the operator provides Kubernetes services integration, specifically "automatically creating services for wasmCloud applications deployed with an HTTP Server capability (in the future, this will become configurable)." In reality, this functionality appears to be partially broken:

Issues Identified

  1. Service Object Missing a Selector:
    The operator creates the Service object but doesn’t assign a selector to the wasmcloud-host pod. Even if you manually add the selector, the Service still doesn’t work.

  2. Immutable Pod Ports:
    The issue seems to stem from the fact that the list of ports in a pod is immutable. This makes it impossible to update the ports on the wasmcloud-host pod dynamically when new applications are deployed.

Current Limitations

Given the current behavior, I’ve been considering ways to make Kubernetes Services work properly for wasmCloud applications. Here are two potential solutions, though there are likely others:

  1. Modify the Deployment During Application Requests:

    • When a client requests a new application, the operator would need to:
      • Edit the wasmcloud-host deployment to include the new port.
      • Create a Service with a selector pointing to the updated pod.
    • Downside: This triggers a pod rollout, which may disrupt active connections.
  2. Predefine a Range of Ports at Host Instantiation:

    • At the time of creating the wasmcloud-host, predefine a range of ports that will be available for application workloads.
    • When a new application is deployed, the operator dynamically creates a Service with a selector pointing to the corresponding pod.
    • To enforce this, a Validating Admission Webhook can be used to ensure that the application's port definition falls within the predefined range.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions