Make open-port work per unit (non-leader) for K8s sidecar charms

Bug #2007334 reported by Ben Hoyt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
Wishlist
Yang Kelvin Liu

Bug Description

Per discussion this morning with Gustavo, Jon, Ian, we'd like to make open-port and close-port on K8s sidechar charms work on any unit (not just the leader) with as similar behaviour to machine charms as possible. Specifically:

* Allow open-port to happen from any unit, and Juju would open the ports (in the K8s service definition) that are the union of all ports that any unit has opened. So if unit/1 opened port 8080 and unit/2 opened port 4000, we'd tell K8s to open both. This would be unusual but supported.
* Kind of the opposite for close-port: Juju would only close the port in the K8s service definition once all units had asked for that port to be closed.
* Remove the check for is-leader.

In the Python Operator Framework, charms would call (for example) Unit.open_port('tcp', 8080) without an is-leader check, and this would work as expected for both K8s sidecar and machine charms. (Good thinking forward to universal charms.)

This supersedes our previous idea to add an --app / --application arg to open-port for K8s sidecar charms: https://bugs.launchpad.net/juju/+bug/2006672

Changed in juju:
importance: Undecided → Wishlist
status: New → Triaged
Changed in juju:
status: Triaged → In Progress
assignee: nobody → Yang Kelvin Liu (kelvin.liu)
Revision history for this message
Yang Kelvin Liu (kelvin.liu) wrote :
Changed in juju:
milestone: none → 3.1.1
Changed in juju:
status: In Progress → Fix Committed
Harry Pidcock (hpidcock)
Changed in juju:
milestone: 3.1.1 → 3.1.2
Changed in juju:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.