Skip to content

Add IPv6 support to PrefectServer#232

Merged
mitchnielsen merged 4 commits intomainfrom
ipv6-support
Dec 11, 2025
Merged

Add IPv6 support to PrefectServer#232
mitchnielsen merged 4 commits intomainfrom
ipv6-support

Conversation

@mitchnielsen
Copy link
Member

@mitchnielsen mitchnielsen commented Dec 10, 2025

The operator was hardcoding --host 0.0.0.0 when starting Prefect servers, which prevented them from running in IPv6-only Kubernetes clusters. This adds an optional host field to the PrefectServerSpec that lets users configure the bind address.

Changes:

  • Added host field to PrefectServerSpec (defaults to "0.0.0.0" for backward compatibility)
  • Fixed typo: EntrypointArugments → EntrypointArguments
  • Users can set host: "" (empty string) for IPv6-only or dual-stack environments
  • Added tests and sample configurations

How it works

When host is set to "" (empty string), uvicorn binds to all available interfaces, which works for:

  • IPv6-only clusters (no IPv4 stack)
  • Dual-stack clusters (both IPv4 and IPv6)
  • IPv4 clusters

Note: Prefect's CLI rejects :: as an invalid host value, so we use empty string instead.

The implementation follows the pattern used elsewhere in the codebase (like Postgres host configuration) and maintains full backward compatibility. The Prefect Helm chart handles this by not specifying --host at all, and now the operator provides explicit control when needed.

Closes #224

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.5 (1M context) noreply@anthropic.com

The operator was hardcoding `--host 0.0.0.0` when starting Prefect servers, which prevented them from running in IPv6-only Kubernetes clusters. This adds an optional `host` field to the PrefectServerSpec that lets users configure the bind address.

Changes:
- Added `host` field to PrefectServerSpec (defaults to "0.0.0.0" for backward compatibility)
- Fixed typo: EntrypointArugments → EntrypointArguments (kept deprecated wrapper)
- Users can now set `host: "::"` for IPv6-only or `host: ""` for dual-stack environments
- Added tests and sample configurations for different scenarios
- Fixed Makefile generate target to work with macOS BSD sed

The implementation follows the pattern used elsewhere in the codebase (like Postgres host configuration) and maintains full backward compatibility. The Prefect Helm chart handles this correctly, and now the operator does too.

Closes #224

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
The Makefile sed fix and .mise.toml comment were environment-specific
changes not related to IPv6 support. Keeping the PR focused on just
the IPv6 feature.
After testing, we found that Prefect rejects '::' as an invalid host
value. The working approach is to use an empty string which tells
uvicorn to bind to all available interfaces (works for IPv4, IPv6, and
dual-stack environments).

Changes:
- Updated sample files to use host: "" instead of host: "::"
- Updated code comments to clarify correct usage
- Updated all tests to use empty string
- Consolidated duplicate dual-stack test

This matches how the Prefect Helm chart works (by not specifying --host
at all, letting uvicorn use its defaults).
Since this is an internal method (not part of the public API), we don't
need backward compatibility. End users only interact with the CRD spec,
not Go methods. Just keep the correctly spelled EntrypointArguments.
@mitchnielsen mitchnielsen merged commit 505c619 into main Dec 11, 2025
8 checks passed
@mitchnielsen mitchnielsen deleted the ipv6-support branch December 11, 2025 02:49
@dopic
Copy link

dopic commented Dec 11, 2025

Hi, @mitchnielsen . Thanks for your help!

Do you plan to release a new version of the chart with this enhancement?

@mitchnielsen
Copy link
Member Author

Done! https://github.com/PrefectHQ/prefect-operator/releases/tag/v0.13.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prefect Server fails to bind in IPv6-only environments

4 participants