icy-pilot-31118
06/22/2022, 1:51 AMDiagnostics:
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
billowy-army-68599
icy-pilot-31118
06/22/2022, 1:58 AMimport 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)
billowy-army-68599
icy-pilot-31118
06/22/2022, 2:36 PM