Full traceback in thread
# docs
i
Full traceback in thread
Copy code
Diagnostics:
  pulumi:pulumi:Stack (theia-prod):
    error: Program failed with an unhandled exception:
    error: Traceback (most recent call last):
      File "/home/ubuntu/.pulumi/bin/pulumi-language-python-exec", line 107, in <module>
        loop.run_until_complete(coro)
      File "/usr/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
        return future.result()
      File "/home/ubuntu/.local/lib/python3.10/site-packages/pulumi/runtime/stack.py", line 126, in run_in_stack
        await run_pulumi_func(lambda: Stack(func))
      File "/home/ubuntu/.local/lib/python3.10/site-packages/pulumi/runtime/stack.py", line 49, in run_pulumi_func
        func()
      File "/home/ubuntu/.local/lib/python3.10/site-packages/pulumi/runtime/stack.py", line 126, in <lambda>
        await run_pulumi_func(lambda: Stack(func))
      File "/home/ubuntu/.local/lib/python3.10/site-packages/pulumi/runtime/stack.py", line 149, in __init__
        func()
      File "/home/ubuntu/.pulumi/bin/pulumi-language-python-exec", line 106, in <lambda>
        coro = pulumi.runtime.run_in_stack(lambda: runpy.run_path(args.PROGRAM, run_name='__main__'))
      File "/usr/lib/python3.10/runpy.py", line 286, in run_path
        return _run_code(code, mod_globals, init_globals,
      File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
        exec(code, run_globals)
      File "/home/ubuntu/theia/./__main__.py", line 11, in <module>
        deployment = k8s.apps.v1.Deployment(f'{app_name}-dep',
      File "/home/ubuntu/.local/lib/python3.10/site-packages/pulumi_kubernetes/apps/v1/Deployment.py", line 328, in __init__
        __self__._internal_init(resource_name, *args, **kwargs)
      File "/home/ubuntu/.local/lib/python3.10/site-packages/pulumi_kubernetes/apps/v1/Deployment.py", line 356, in _internal_init
        super(Deployment, __self__).__init__(
      File "/home/ubuntu/.local/lib/python3.10/site-packages/pulumi/resource.py", line 1081, in __init__
        Resource.__init__(self, t, name, True, props, opts, False, dependency)
      File "/home/ubuntu/.local/lib/python3.10/site-packages/pulumi/resource.py", line 922, in __init__
        raise ValueError(
    ValueError: Attempted to register resource kubernetes:apps/v1:Deployment with a provider for '<pulumi.output.Output object at 0x7f5e335690c0>'
    error: an unhandled error occurred: Program exited with non-zero exit code: 1
b
@icy-pilot-31118 please share your code
i
Copy code
import pulumi
import pulumi_eks as eks
import pulumi_kubernetes as k8s

# Create an EKS cluster with the default configuration.
cluster = eks.Cluster('my-cluster');

# Deploy a small canary service (NGINX), to test that the cluster is working.
app_name = 'my-app'
app_labels = { 'app': app_name }
deployment = k8s.apps.v1.Deployment(f'{app_name}-dep',
    spec = k8s.apps.v1.DeploymentSpecArgs(
        selector = k8s.meta.v1.LabelSelectorArgs(match_labels = app_labels),
        replicas = 2,
        template = k8s.core.v1.PodTemplateSpecArgs(
            metadata = k8s.meta.v1.ObjectMetaArgs(labels = app_labels),
            spec = k8s.core.v1.PodSpecArgs(containers = [
                k8s.core.v1.ContainerArgs(name = app_name, image = 'nginx')
            ]),
        ),
    ), opts = pulumi.ResourceOptions(provider = cluster.provider)
)
service = k8s.core.v1.Service(f'{app_name}-svc',
    spec = k8s.core.v1.ServiceSpecArgs(
        type = 'LoadBalancer',
        selector = app_labels,
        ports = [ k8s.core.v1.ServicePortArgs(port = 80) ],
    ), opts = pulumi.ResourceOptions(provider = cluster.provider)
)

# Export the URL for the load balanced service.
pulumi.export('url', service.status.load_balancer.ingress[0].hostname)

# Export the cluster's kubeconfig.
pulumi.export('kubeconfig', cluster.kubeconfig)
It is a copy paste from the tutorial
I think that this is a bug in pulumi
It seems like the code is trying to compare an Output type with a string.
b
yes this looks like a bug, could you file it in pulumi/pulumi-eks please?
i
Yes will do. As a workaround, I just created the cluster, set it as my default kube cluster and then didn’t configure the cluster as a provider.