echoing-postman-88590
02/23/2022, 12:42 PMmonitoring = kubernetes.helm.v3.Release(
"monitoring",
name="monitoring",
chart="kube-prometheus-stack",
namespace="monitoring",
repository_opts=kubernetes.helm.v3.RepositoryOptsArgs(
repo="<https://prometheus-community.github.io/helm-charts>",
),
values={
"grafana": {
"ingress": {
"enabled": True,
},
},
},
)
grafana_ingress = kubernetes.networking.v1.Ingress.get(
"grafana-ingress",
Output.concat("monitoring/monitoring-grafana"),
)
grafana_ip = grafana_ingress.status.load_balancer.ingress[0].ip
But it errors as status.loadBalancer
does not have the ip
value. If I rerun multiple times pulumi up
it will register and continue. Is there a why to define a sort of timeout
for the kubernetes.networking.v1.Ingress.get
?
Thanksquiet-wolf-18467
02/23/2022, 12:54 PM.get
because the Ingress doesn't exist, but on subsequent runs it finds the resource. Is that correct?echoing-postman-88590
02/23/2022, 12:54 PMkubernetes:<http://networking.k8s.io/v1:Ingress|networking.k8s.io/v1:Ingress> (grafana-ingress):
error: 2 errors occurred:
* Resource 'monitoring-grafana' was created but failed to initialize
* Ingress .status.loadBalancer field was not updated with a hostname/IP address.
for more information about this error, see <https://pulumi.io/xdv72s>
quiet-wolf-18467
02/23/2022, 12:55 PM.get
to:
grafana_ingress = kubernetes.networking.v1.Ingress.get(
"grafana-ingress",
Output.concat("monitoring/monitoring-grafana"),
{ dependsOn: [monitoring] },
)
it should helphelm.v3.Release
creation will actually wait for the Ingress to get the public IP, but we need to code that dependency via dependsOn
echoing-postman-88590
02/23/2022, 12:58 PM{"dependsOn": [monitoring]},
or
{dependsOn: [monitoring]},
Otherwise how do I import the dependsOn
function?quiet-wolf-18467
02/23/2022, 1:00 PMdependsOn
isn't a function, it's a property on the CustomResourceOptions
of Pulumi Resources. Let me check this is an option on Kubernetes provider, please give me a moment.get(name: string, id: pulumi.Input<string>, opts?: pulumi.CustomResourceOptions | undefined): k8s.networking.v1.Ingress
echoing-postman-88590
02/23/2022, 1:27 PMgrafana_ingress = kubernetes.networking.v1.Ingress.get(
"grafana-ingress",
Output.concat(monitoring.status.namespace, "/", monitoring.status.name, "-grafana"),
opts=ResourceOptions(depends_on=[monitoring]),
)
I was expecting the monitoring.status
to already establish the dependencyhelm.v3.Release
wait for the creation of the monitoring-grafana
ingress but the ingress itself got a public ip after 90 seconds. That's why it is failing.quiet-wolf-18467
02/24/2022, 8:12 AMechoing-postman-88590
02/24/2022, 4:16 PM