Equivalent of the ports field in Pod.set_spec for v2 Kubernetes charms?

While looking around in the OSM packages repo (https://osm.etsi.org/gitlab/vnf-onboarding/osm-packages), I noticed that the Squid CNF example includes a section where it sets a port for the container by using self.model.pod.set_spec (code here: https://osm.etsi.org/gitlab/vnf-onboarding/osm-packages/-/blob/master/squid_metrics_cnf/juju-bundles/charms/squid-operator/src/charm.py#L65), however I also found that it is specific to legacy/v1 charms, and that it is now deprecated.

At first glance it looks like the containers field in the metadata.yaml file is the equivalent for v2 charms, but I don’t see a section to set the ports there. So, is there an equivalent for that ports field for v2 charms?