https://pulumi.com logo
#kubernetes
Title
# kubernetes
n

numerous-energy-27817

12/31/2023, 2:18 PM
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

dry-keyboard-94795

12/31/2023, 2:49 PM
You can pass the name explicitly through the metadata object, as per standard kubernetes convention
n

numerous-energy-27817

01/01/2024, 3:52 PM
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

dry-keyboard-94795

01/01/2024, 3:53 PM
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

numerous-energy-27817

01/01/2024, 4:29 PM
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

dry-keyboard-94795

01/01/2024, 4:40 PM
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

numerous-energy-27817

01/01/2024, 7:28 PM
ok, thank you for suggestions!