Hello. We install EKS cluster. Then install flux a...
# golang
m
Hello. We install EKS cluster. Then install flux and then install ingress-controller with custom resources of flux. Then in the pulumi code we need dependency on the created ingress controller service to • Wait for it to be created • Get its Loadbalancer hostname. Waiting is not a problem but getting of the LB hostname is. Options that we have: • Create applier function and get k8s service directly from k8s with golang k8s libs. But unfortunately this applier doesn't wait for the created resources or anything and starts execution during pulumi preview and it fails because it can't find it. • Use native pulumi GetService https://pkg.go.dev/github.com/pulumi/pulumi-kubernetes/sdk/v2/go/kubernetes/core/v1#GetService. But it fails on preview step as well. It just can't find it. Earlier we used getting hostname from chart resources like this
Copy code
func GetIngressNginxServiceStatus(ingressControllerChartResources pulumi.Output) pulumi.Output {
	ingressServiceStatus := ingressControllerChartResources.ApplyT(func(arg interface{}) corev1.ServiceStatusPtrOutput {

		x := arg.(map[string]pulumi.Resource)
		return x["v1/Service::ingress-nginx/ingress-nginx-controller"].(*corev1.Service).Status
	})
	return ingressServiceStatus
}
But currently we use flux for our initial deployment and want to use it for ingress-controller as well. So the question. How to make GetService or applier wait for other resources and do not be executed on pulumi preview? Earlier I used ctx.DryRun() to exclude some stuff from the preview, but here this hostname is used in other further code and I can't just miss this code
Copy code
if !ctx.DryRun() {...}