Hi everyone, I am trying to install the ingress-n...
# kubernetes
c
Hi everyone, I am trying to install the ingress-nginx controller with pulumi on DigitalOcean and I got stuck. Maybe somebody had a similar issue and can help me out. 1. I create the k8s cluster 2. I use Release to install the nginx ingress controller because I am waiting for the load balancer to get an external IP 3. Pulumi stops when I try to get the IP address of the service ingress-nginx-controller I used the example I found on the documentation page: https://www.pulumi.com/blog/full-access-to-helm-features-through-new-helm-release-resource-for-kubernetes/ Here is my code:
Copy code
# Generate the cluster itself
k8s_cluster = KubernetesCluster(
    resource_name=K8S_CLUSTER_NAME,
    name=K8S_CLUSTER_NAME,
    region=K8S_REGION,
    version=K8S_VERSION,
    node_pool=KubernetesClusterNodePoolArgs(
        name=K8S_NODE_POOL_NAME,
        node_count=K8S_NODE_COUNT,
        size=K8S_NODE_SIZE,
    ),
    ha=K8S_HIGH_AVAILABILITY_PLANE,
)

# Get provider for Kubernetes cluster
k8s_provider = Provider(
    resource_name=K8S_CLUSTER_NAME,
    kubeconfig=k8s_cluster.kube_configs[0].raw_config,
    opts=pulumi.ResourceOptions(parent=k8s_cluster),
)

# Install nginx ingress controller with Helm chart and wait for it so load balancer gets IP address
release_args = ReleaseArgs(
    name="ingress-nginx",
    chart="ingress-nginx",
    repository_opts=RepositoryOptsArgs(
        repo="<https://kubernetes.github.io/ingress-nginx>"
    ),
    values=INGRESS_CONTROLLER_HELM_VALUES,
    skip_await=False,
)
# noinspection PyArgumentList
release = Release(
    resource_name="ingress-nginx",
    name="ingress-nginx",
    args=release_args,
    opts=ResourceOptions(
        provider=k8s_provider
    ),
    timeout=1000,
    skip_await=False,
)


status = release.status
# srv = Service.get(id=release.name, resource_name="ingress-nginx-controller")

srv = Service.get(
    f"{release.status.name}-controller",
    Output.concat(release.status.name, "-controller")
)

pulumi.export("externalIPs", srv.spec.external_ips)
pulumi.export("status", status)
I will attach the error screenshot with the image where it actually created the ingress-nginx-controller service. Error message:
Copy code
Diagnostics:
  pulumi:pulumi:Stack (k8s_init-dev):
    error: update failed
 
  kubernetes:core/v1:Service (Calling __str__ on an Output[T] is not supported.

To get the value of an Output[T] as an Output[str] consider:
1. o.apply(lambda v => f"prefix{v}suffix")

See <https://pulumi.io/help/outputs> for more details.
This function may throw in a future version of Pulumi.-controller):
    error: resource 'ingress-nginx-controller' does not exist
I hope somebody can help me out and guide me. Thanks a lot! Best regards, Refik
I tried with this but without success:
Copy code
srv = Service.get(
    "ingress-nginx-controller-load-balancer",
    Output.concat("default/", release.status.name, "-controller")
)
m
Did you ever figure this out @cool-wall-66940? Im’ having a similar issue getting an ip from an ingress controller that was installed as a helm release
I actually figured it out with
Copy code
export const istioGatewayService = kubernetes.core.v1.Service.get(
  'istio-gateway-service',
  pulumi.interpolate`${istioGateway.status.namespace}/${istioGateway.status.name}`,
  { dependsOn: [istioGateway]}
);

const istioGatewayIp = istioGatewayService.status.loadBalancer.ingress.apply(ips => {
  return ips[0].ip;
});
hopefully that helps you!
c
Hey Jamie, Thank you for your response, I will try it out with Python, so far I had no success I saw on stackoverflow some other devs have the same issue as I do