Did I miss a thing, or why does kubernetesx.Deploy...
# typescript
b
Did I miss a thing, or why does kubernetesx.Deployment.createService() use autonaming?
Copy code
metadata  : {
    annotations: {
        <http://pulumi.com/autonamed|pulumi.com/autonamed>: "true"
    }
    labels     : {
        <http://app.kubernetes.io/managed-by|app.kubernetes.io/managed-by>: "pulumi"
    }
    name       : "foo-api-2rwgcw01"
    namespace  : "backend"
}
Is there any way around that? Or is it a missing feature? Any chance to set the Service name to
foo-api
? https://github.com/pulumi/pulumi-kubernetesx/blob/master/nodejs/kubernetesx/kx.ts#L260
g
Autonaming is the default for Pulumi, but the intent is to allow overrides as needed. This feature is tracked in https://github.com/pulumi/pulumi-kubernetesx/issues/52 In the meantime, you’d have to specify the Service the usual way if you need a specific name. Something like this should work:
Copy code
const svc = new kx.Service("nginx", {
    metadata: { name: "nginx" },
    spec: {
        ports: { http: 80 },
        selector: deployment.spec.selector.matchLabels,
        type: kx.types.ServiceType.LoadBalancer,
    }
})
👍 1