-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
During the migration from PodSpec to Sidecar, a weird behaviour with Unit.set_ports was raised:
- On fresh deploy, set_ports works fine and the K8s service exposes the right ports.
But:
- After juju refresh (of the old pattern charm), the service gets recreated (confirmed via
kubectl get svc), butjuju show-unitdoesn’t show any open ports, and the service exposes the placeholder port -65353 - Running juju exec "opened_ports" inside the pod shows the ports are open (only with the updated charm).
- We tried moving
set_portstoinstall,config_changed, even deleting the service manually – no luck, Juju doesn’t seem to reapply the ports.
Other charms currently use the KubernetesServicePatch library, which is scheduled to be deprecated in October 2025. The library recommends switching to the aforementioned Unit.set_ports.
- The current workaround is the new Reusable Component introduced in feat: migrate to sidecar pattern #233. This component patches the service with the provided ports using similar logic to what the deprecated library included. Note: the
Unit.set_portsis still required to expose the ports on the pebble container.
Linked issue: canonical/bundle-kubeflow#1194
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels