Skip to content

Multiple Issues and Suggestions for Prefect Operator #183

@Blarc

Description

@Blarc

I've been experimenting with the Prefect Operator and encountered several issues along with suggestions for improvement. Here’s a detailed summary:

  1. PREFECT_API_URL Configuration
  • Issue: The PREFECT_API_URL for PrefectServer must be set manually via spec.settings. Otherwise, it defaults to http://0.0.0.0:4200/api, which triggers an error in the UI.
  • Suggestion: Consider adding CRD support for defining ingress/gateway and automatically setting PREFECT_API_URL.
  1. PrefectDeployment Namespace Resolution
  • Issue: Creating a PrefectDeployment fails because the deployment uses prefect.default.svc as the default API hostname, even if Prefect is deployed in a different namespace.
  • Workaround: Manually setting server.namespace and workPool.namespace in the CRD resolves the issue.
  • Suggestion: Use the namespace of the PrefectDeployment by default.
  1. PrefectWorkPool Naming Prefix
  • Issue: The PrefectWorkPool name is prefixed with pool-. For example, a CRD named prefect-work-pool appears as pool-prefect-work-pool in the UI, and that is the name required for referencing in PrefectDeployment.
  • Suggestion: Remove the prefix.
  1. Incorrect Handling of HTTP 201 Responses
  • Issue: The operator treats successful 201 Created responses as errors:

    error: failed to create or get flow: API request failed with status 201
    

    This leads to unnecessary error logs despite successful flow creation.

  1. RBAC/ServiceAccount Issues
  • Issue: Running a PrefectDeployment fails with:

    User "system:serviceaccount:my-namespace:default" cannot create resource "jobs" in API group "batch" in namespace "default"
    
  • Observation: It seems the default service account lacks necessary permissions, and there’s no clear guidance on configuring it.

  • Suggestion: Provide documentation or automation to ensure required RBAC roles are set up correctly.

  1. Reconciliation Errors When Updating Work Pools
  • Issue: Updating a PrefectWorkPool triggers multiple reconciliation attempts and logs errors like:

    Operation cannot be fulfilled on deployments.apps "prefect-work-pool": the object has been modified; please apply your changes to the latest version and try again
    

    Although the CRD updates successfully, the operator logs a series of errors, making troubleshooting difficult.

If you would like it, I would be interested in investigating and opening PRs.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions