Skip to content

[K8s] Reworking 8s networking, especially for local connectivity service case#603

Merged
MRiganSUSX merged 8 commits intodevelopfrom
mrigan/k8s_networking
Oct 7, 2025
Merged

[K8s] Reworking 8s networking, especially for local connectivity service case#603
MRiganSUSX merged 8 commits intodevelopfrom
mrigan/k8s_networking

Conversation

@MRiganSUSX
Copy link
Copy Markdown
Contributor

@MRiganSUSX MRiganSUSX commented Oct 2, 2025

Description

!!! Requires DUNE-DAQ/daqsystemtest#244 !!!

Fixes part of #583.

This PR refactors the Kubernetes networking model. The previous approach, which relied on a manually managed kubectl port-forward subprocess and a socat proxy sidecar, has been replaced with a NodePort service and hostAliases.

Key Changes:
Replaced port-forward with a NodePort Service.
Now: The connection server pod is exposed via a standard Kubernetes NodePort service. This is the idiomatic way to expose a service to external traffic and is managed entirely by the Kubernetes cluster.

Replaced Proxy Sidecar with hostAliases.
Now: The sidecar has been removed. Pods now use the spec.hostAliases field to resolve localhost directly to the ClusterIP of the connection server's service. This is a more lightweight and direct networking approach.

Dynamic Port Extraction:
The connection server port is no longer a fixed configuration value. It is now dynamically extracted from the gunicorn command arguments in the BootRequest.

Code Simplification:
Removed all code related to managing the port-forward subprocess, including starting the process, monitoring its output, and ensuring it's killed correctly.

Removed the logic for injecting the sidecar container into pod manifests.
Removed configuration options like sidecar_image and port_forward_timeout that are no longer needed.

Type of change

  • Documentation (non-breaking change that adds or improves the documentation)
  • New feature (non-breaking change which adds functionality)
  • Optimization (non-breaking, back-end change that speeds up the code)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (whatever its nature)

Key checklist

  • All tests pass (eg. python -m pytest)
  • Pre-commit hooks run successfully (eg. pre-commit run --all-files)

Further checks

  • Code is commented, particularly in hard-to-understand areas
  • Tests added or an issue has been opened to tackle that in the future.
    (Indicate issue here: # (issue))

Copy link
Copy Markdown
Contributor

@wanyunSu wanyunSu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with MSQT, LGTM

@MRiganSUSX MRiganSUSX merged commit f756868 into develop Oct 7, 2025
3 checks passed
@MRiganSUSX MRiganSUSX deleted the mrigan/k8s_networking branch October 7, 2025 13:09
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.

3 participants