future-refrigerator-88869
09/02/2021, 8:32 PMaws load balancer controller
,create the IngressClass
and create the ingress itself using k8s.networking.v1.Ingress
. Everything works fine, the load balancer is created, traffic is getting to the instance.
However, when I try to expose the ingress URL as a pulumi output, it seems that pulumi doesn't know that it has to wait for the load balancer to be created and it seems like it finishes execution before having access to that load balancer. This is how I am trying to expose it and still doesn't work. The value is empty when exposing it. Anyone has any ideas here ?
export const ingressUrl = ingress.status.apply(
(status) => status.loadBalancer.ingress[0].hostname
);
bored-table-20691
09/02/2021, 8:52 PMcontourDeploy, err := yaml.NewConfigFile(ctx, "contour-deploy-file", &yaml.ConfigFileArgs{
File: "./contour.yaml",
Transformations: []yaml.Transformation{
// Use an NLB instead of an ELB
func(state map[string]interface{}, opts ...pulumi.ResourceOption) {
metadata := state["metadata"].(map[string]interface{})
name := metadata["name"]
if state["kind"] == "Service" && name == "envoy" {
annotations := metadata["annotations"].(map[string]interface{})
delete(annotations, "<http://service.beta.kubernetes.io/aws-load-balancer-backend-protocol|service.beta.kubernetes.io/aws-load-balancer-backend-protocol>")
annotations["<http://service.beta.kubernetes.io/aws-load-balancer-type|service.beta.kubernetes.io/aws-load-balancer-type>"] = "nlb"
}
},
},
}, pulumi.Provider(eksConfig.Provider))
if err != nil {
return nil, err
}
contourService := contourDeploy.GetResource("v1/Service", "envoy", "projectcontour").(*corev1.Service)
contourServiceLB := contourService.Status.LoadBalancer().Ingress().Index(<http://pulumi.Int|pulumi.Int>(0)).Hostname().Elem()
future-refrigerator-88869
09/02/2021, 8:56 PMcalm-quill-21760
09/02/2021, 8:56 PMstatus
and then status.loadBalancer
?future-refrigerator-88869
09/02/2021, 8:57 PMcontourServiceLB := contourService.Status.LoadBalancer().Ingress().Index(<http://pulumi.Int|pulumi.Int>(0)).Hostname().Elem()
that should be the equivalent of my export (i tried just exporting it without applying too). the result is undefined.status
is empty.calm-quill-21760
09/02/2021, 8:57 PMfuture-refrigerator-88869
09/02/2021, 8:57 PMcalm-quill-21760
09/02/2021, 8:58 PMingress.status
?ingress
?future-refrigerator-88869
09/02/2021, 8:59 PMingress.status
is the one i am interested in but it is empty. It seems like it's not awaiting the creation of the ELB. I can see in aws console that when the ELB begins creation the pulumi up
finishes execution while the elb is still deploying.calm-quill-21760
09/02/2021, 8:59 PMingress
itself?future-refrigerator-88869
09/02/2021, 9:00 PMbored-table-20691
09/02/2021, 9:00 PMingress
is not marked correctly in terms of this being an output, I’m not sure. In my case, I am not using an ingress object and I go to the underlying Service
Service
that Ingress
is creating under the hood (I believe it does this)?future-refrigerator-88869
09/02/2021, 9:02 PMk8s.networking.v1.Ingress
is not exporting the ingress.status
while the k8s.extensions.v1beta1.Ingress
is working fine. So maybe there's a problem therebored-table-20691
09/02/2021, 9:03 PMfuture-refrigerator-88869
09/02/2021, 9:03 PMservice
or the elastic load balancer that is being created ?bored-table-20691
09/02/2021, 9:03 PMLoadBalancer
from that.future-refrigerator-88869
09/02/2021, 9:04 PMservice.status.loadBalancer.ingress
is {}
bored-table-20691
09/02/2021, 9:13 PM