Hello everyone, happy Monday! Maybe a silly quest...
# kubernetes
f
Hello everyone, happy Monday! Maybe a silly question but how do you get the dynamic resource names created by
new k8s.helm.v3.Release(…)…
for
XYZ
Helm chart… if you don’t specify the
name
and leave Pulumi to autogenerate it, or even specify the
name
whichever… and use the resource names later on it the program without inferring the name based on the prefix and whatever the chart is?
b
@freezing-quill-32178 you would need to use the
.get
methods to retrieve them
f
Thanks for the reply @billowy-army-68599 , you mean the static
get
method on the
Release
class or separate
get
method on each k8s object that is needed to fetch?
b
f
great thanks! I have this
Copy code
const grafanaSvc = k8s.core.v1.Service.get(
  "kps-grafana-svc",
  pulumi.interpolate`${kubePrometheusStack.status.namespace}/${kubePrometheusStack.status.name}-grafana`
);
so I have to know beforehand that there will be an svc with
-grafana
postfix/suffix created?
Copy code
k8s.helm.v3.Release.get("test", kubePrometheusStack.id).resourceNames.apply((rn) => console.log(JSON.stringify(rn)));
guess this can help somehow, filtering out the resources from the resourceNames object
b
yes you'd need to know if there was a service object. if this is unwieldy, you might consider switching to
helm.v3.Chart
f
I’m actually switching from
helm.v3.Chart
causing some weird issues with deployment/update speed, CRDs and hooks hanging… trying
helm.v3.Release
for the first time, way faster for now.