https://pulumi.com logo
#general
Title
# general
t

thankful-optician-22583

11/04/2019, 8:15 PM
Guys when I create a Service type using the k8s provider I find that pulumi appends a unique ID to my service name
s

swift-painter-31084

11/04/2019, 8:21 PM
That is pretty standard Pulumi behavior, but you can set a
name:
parameter to specify a name that won't get the ID appended
c

creamy-potato-29402

11/04/2019, 9:36 PM
to be clear, the reason for this is because if we need to replace the resource because you changed an immutable property (in the case of
Service
,
.spec.clusterIP
is one example), we will want to create a new service before replacing the old one.
if you don’t add the suffix you can’t do this.
even kubernetes does this under the covers for replicasets and pods when you use
Deployment
You could hard code them, but this is almost always worse than the alternatives