Hello! Question on resource names. "Before pulumi"...
# kubernetes
n
Hello! Question on resource names. "Before pulumi" If you wish a deployment D to talk to a service S you simply give S a name "my-srv" in a yaml and configure D to find S by that very DNS name "my-srv". Now with pulumi there's auto-naming (probably for good reasons) and a service gets a DNS name with a suffix that is not known to client deployments before creating the service. The best I can think of is disabling auto-naming for kubernetes services. But what's the idiomatic way in pulumi for a deployment to discover a service?
d
You can pass the name explicitly through the metadata object, as per standard kubernetes convention
n
Hey! HNY! 🙂 thanks for reply! yeah, this does the trick but auto-naming was not introduced without a reason and I wondered when pulumi decided to give services random names, what was their plan about it 🙂
d
As far as I know, auto-naming has always been a thing
It's probably best to pass service dns names in via environment variables btw, that way you can take advantage of the auto naming
Main one being to reduce downtime in the event an object/resource needs replacing
n
so within pulumi context I first deploy a service, obtain it's name and pass this name when deploying further deployments that are supposed to talk to this service?
d
Are you setting up Deployments outside of pulumi?
If everything is contained within the same pulumi stack, use auto-naming as you can pass by reference. Otherwise use static names for the service
n
ok, thank you for suggestions!