Juju using private ip to network machines

How can I get juju to use the public ip on an ec2 instance to reach another instance in a manual cloud setup?

you need to examine the subnets/spaces …

  • in AWS I setup a subnet with public ips available…
  • next in Juju after you connect to that VPC … examine the subnets available and assign them to Juju “spaces”
  • and then in my bundles I call for those spaces

I am at the day job but can come back with more… meantime these are the docs I used to get it going.

I think I understand my problem better enough to restate it. So the case in point is about etcd cluster where each node is in a different account necessitating different VPCs. I’ll like the call to network_get during registration from the charms to return the public-address for ingress-addresses rather than private-address. What is the best way to make this happen aside forcing that from the unit itself?

is this a charm you yourself are writing? I have almost no experience writing charms for K8s so I cannot really chime in further but… from my experience the non k8-s provides no straightforward way to do multi-vpc unless you add another controller… which would seperate the two+ units entirely

inside the charm you’d have the python API to inspect your IP addresses so I imagine you could pull the data that way in one of the hooks that makes sense to you and append the info … but as I recall by the time your hooks are running… your IP is already chosen for you … if you need to influence it beforehand that is something in which you indeed need to set up spaces, bind in the yaml file…