pulumi-kubernetes
pulumi-kubernetes copied to clipboard
Helm v3 crash
What happened?
crash when trying to deploy helm chart to gcp cluster.
Steps to reproduce
deploy kubernetes cluster on gcp, then
Chart( "test", LocalChartOpts( path="./a_random_path", ), ResourceOptions(provider=k8s_provider))
-> crash
error: Program failed with an unhandled exception:
error: Traceback (most recent call last):
File "/usr/local/bin/pulumi-language-python-exec", line 107, in <module>
loop.run_until_complete(coro)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py", line 587, in run_until_complete
return future.result()
File "/Users/gautierwojda/Kafka/venv/lib/python3.7/site-packages/pulumi/runtime/stack.py", line 126, in run_in_stack
await run_pulumi_func(lambda: Stack(func))
File "/Users/gautierwojda/Kafka/venv/lib/python3.7/site-packages/pulumi/runtime/stack.py", line 51, in run_pulumi_func
await wait_for_rpcs()
File "/Users/gautierwojda/Kafka/venv/lib/python3.7/site-packages/pulumi/runtime/stack.py", line 110, in wait_for_rpcs
raise exception
File "/Users/gautierwojda/Kafka/venv/lib/python3.7/site-packages/pulumi/runtime/resource.py", line 685, in do_register_resource_outputs
serialized_props = await rpc.serialize_properties(outputs, {})
File "/Users/gautierwojda/Kafka/venv/lib/python3.7/site-packages/pulumi/runtime/rpc.py", line 173, in serialize_properties
v, deps, input_transformer, get_type(k), keep_output_values
File "/Users/gautierwojda/Kafka/venv/lib/python3.7/site-packages/pulumi/runtime/rpc.py", line 348, in serialize_property
keep_output_values=False,
File "/Users/gautierwojda/Kafka/venv/lib/python3.7/site-packages/pulumi/runtime/rpc.py", line 326, in serialize_property
future_return = await asyncio.ensure_future(awaitable)
File "/Users/gautierwojda/Kafka/venv/lib/python3.7/site-packages/pulumi/output.py", line 169, in run
value = await self._future
File "/Users/gautierwojda/Kafka/venv/lib/python3.7/site-packages/pulumi/output.py", line 123, in get_value
val = await self._future
File "/Users/gautierwojda/Kafka/venv/lib/python3.7/site-packages/pulumi/output.py", line 206, in run
return await transformed.future(with_unknowns=True)
File "/Users/gautierwojda/Kafka/venv/lib/python3.7/site-packages/pulumi/output.py", line 123, in get_value
val = await self._future
File "/Users/gautierwojda/Kafka/venv/lib/python3.7/site-packages/pulumi/output.py", line 169, in run
value = await self._future
File "/Users/gautierwojda/Kafka/venv/lib/python3.7/site-packages/pulumi/output.py", line 194, in run
transformed: Input[U] = func(value)
File "/Users/gautierwojda/Kafka/venv/lib/python3.7/site-packages/pulumi_kubernetes/helm/v3/helm.py", line 601, in <lambda>
{'jsonOpts': x}, invoke_opts).value['result'])
TypeError: 'NoneType' object is not subscriptable
error: an unhandled error occurred: Program exited with non-zero exit code: 1
Expected Behavior
no crash
Actual Behavior
crash
Versions used
➜ Kafka git:(main) ✗ pulumi about CLI Version 3.32.1 Go Version go1.18.1 Go Compiler gc
Plugins NAME VERSION docker 3.2.0 gcp 5.26.0 kafka 3.3.0 kubernetes 3.19.1 python unknown
Host OS darwin Version 12.3.1 Arch x86_64
This project is written in python (/usr/local/bin/python3 v3.7.9)
NAME VERSION pip 22.1 pulumi-docker 3.2.0 pulumi-gcp 5.26.0 pulumi-kafka 3.3.0 pulumi-kubernetes 3.19.1 setuptools 62.3.1 wheel 0.37.1
Additional context
No response
Contributing
Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
Hey @Gwojda, I'm guessing this error is due to an invalid path for the local helm chart. We could certainly improve the error handling around this, but can you double-check your path and see if that resolves it for you?
Hi, i only changed version to helm v2 and it worked. So dont think it's a path issue.
Could you show me the output from the helm/v2 update?
It would also be helpful if you could attach the Chart folder you're trying to deploy so that we can try to reproduce the error.
The following reproduces this error.
import pulumi
import pulumi_eks as eks
import pulumi_kubernetes as k8s
CLUSTER_NAME = "my-cluster"
# Create an EKS cluster with the default configuration.
cluster = eks.Cluster(CLUSTER_NAME)
wordpress = k8s.helm.v3.Chart(
"wpdev",
k8s.helm.v3.ChartOpts(
chart="wordpress",
# version="9.6.0",
fetch_opts=k8s.helm.v3.FetchOpts(
repo="https://charts.bitnami.com/bitnami",
),
),
opts=ResourceOptions(provider=cluster.provider),
)
Output of poetry show
:
arpeggio 1.10.2 Packrat parser interpreter
attrs 22.1.0 Classes Without Boilerplate
certifi 2022.6.15 Python package for providing Mozilla's CA Bundle.
charset-normalizer 2.1.0 The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet.
dill 0.3.5.1 serialize all of python
grpcio 1.47.0 HTTP/2-based RPC framework
idna 3.3 Internationalized Domain Names in Applications (IDNA)
parver 0.3.1 Parse and manipulate version numbers.
protobuf 4.21.4
pulumi 3.37.2 Pulumi's Python SDK
pulumi-aws 5.10.0 A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
pulumi-awsx 1.0.0b10 Pulumi Amazon Web Services (AWS) AWSX Components.
pulumi-docker 3.2.0 A Pulumi package for interacting with Docker in Pulumi programs
pulumi-eks 0.41.2 Pulumi Amazon Web Services (AWS) EKS Components.
pulumi-kubernetes 3.20.2 A Pulumi package for creating and managing Kubernetes resources.
pyyaml 5.4.1 YAML parser and emitter for Python
requests 2.28.1 Python HTTP for Humans.
semver 2.13.0 Python helper for Semantic Versioning (http://semver.org/)
six 1.16.0 Python 2 and 3 compatibility utilities
urllib3 1.26.11 HTTP library with thread-safe connection pooling, file post, and more.
Reverting to pulumi-kubernetes == 3.15.3
produces the following:
$ poetry run pulumi up
Enter your passphrase to unlock config/secrets
(set PULUMI_CONFIG_PASSPHRASE or PULUMI_CONFIG_PASSPHRASE_FILE to remember):
Previewing update (dev):
Type Name Plan
+ pulumi:pulumi:Stack kubernauts-dev create.
+ ├─ kubernetes:helm.sh/v3:Chart wpdev create
+ └─ eks:index:Cluster my-cluster create
+ ├─ eks:index:ServiceRole my-cluster-eksRole create
+ │ ├─ aws:iam:Role my-cluster-eksRole-role create
+ │ └─ aws:iam:RolePolicyAttachment my-cluster-eksRole-4b490823 create
+ ├─ eks:index:ServiceRole my-cluster-instanceRole create
+ │ ├─ aws:iam:Role my-cluster-instanceRole-role create
+ pulumi:pulumi:Stack kubernauts-dev create..
+ │ ├─ aws:iam:RolePolicyAttachment my-cluster-instanceRole-3eb088f2 create
+ pulumi:pulumi:Stack kubernauts-dev create 3 errors
+ ├─ eks:index:RandomSuffix my-cluster-cfnStackName create
+ ├─ aws:ec2:SecurityGroup my-cluster-eksClusterSecurityGroup create
+ ├─ aws:ec2:SecurityGroupRule my-cluster-eksClusterInternetEgressRule create
+ ├─ aws:iam:InstanceProfile my-cluster-instanceProfile create
+ ├─ aws:eks:Cluster my-cluster-eksCluster create
+ ├─ aws:iam:OpenIdConnectProvider my-cluster-oidcProvider create
+ ├─ pulumi:providers:kubernetes my-cluster-eks-k8s create
+ ├─ eks:index:VpcCni my-cluster-vpc-cni create
+ ├─ aws:ec2:SecurityGroup my-cluster-nodeSecurityGroup create
+ ├─ kubernetes:core/v1:ConfigMap my-cluster-nodeAccess create
+ ├─ aws:ec2:SecurityGroupRule my-cluster-eksExtApiServerClusterIngressRule create
+ ├─ aws:ec2:SecurityGroupRule my-cluster-eksClusterIngressRule create
+ ├─ aws:ec2:SecurityGroupRule my-cluster-eksNodeInternetEgressRule create
+ ├─ aws:ec2:SecurityGroupRule my-cluster-eksNodeClusterIngressRule create
+ ├─ aws:ec2:SecurityGroupRule my-cluster-eksNodeIngressRule create
+ ├─ aws:ec2:LaunchConfiguration my-cluster-nodeLaunchConfiguration create
+ ├─ aws:cloudformation:Stack my-cluster-nodes create
+ └─ pulumi:providers:kubernetes my-cluster-provider create
Diagnostics:
pulumi:pulumi:Stack (kubernauts-dev):
error: Program failed with an unhandled exception:
error: Traceback (most recent call last):
File "/home/simon/.pulumi/bin/pulumi-language-python-exec", line 107, in <module>
loop.run_until_complete(coro)
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "/home/simon/.cache/pypoetry/virtualenvs/kubernauts-BfxqxHzr-py3.8/lib/python3.8/site-packages/pulumi/runtime/stack.py", line 126, in run_in_stack
await run_pulumi_func(lambda: Stack(func))
File "/home/simon/.cache/pypoetry/virtualenvs/kubernauts-BfxqxHzr-py3.8/lib/python3.8/site-packages/pulumi/runtime/stack.py", line 51, in run_pulumi_func
await wait_for_rpcs()
File "/home/simon/.cache/pypoetry/virtualenvs/kubernauts-BfxqxHzr-py3.8/lib/python3.8/site-packages/pulumi/runtime/stack.py", line 110, in wait_for_rpcs
raise exception
File "/home/simon/.cache/pypoetry/virtualenvs/kubernauts-BfxqxHzr-py3.8/lib/python3.8/site-packages/pulumi/runtime/resource.py", line 685, in do_register_resource_outputs
serialized_props = await rpc.serialize_properties(outputs, {})
File "/home/simon/.cache/pypoetry/virtualenvs/kubernauts-BfxqxHzr-py3.8/lib/python3.8/site-packages/pulumi/runtime/rpc.py", line 207, in serialize_properties
result = await serialize_property(
File "/home/simon/.cache/pypoetry/virtualenvs/kubernauts-BfxqxHzr-py3.8/lib/python3.8/site-packages/pulumi/runtime/rpc.py", line 378, in serialize_property
value = await serialize_property(
File "/home/simon/.cache/pypoetry/virtualenvs/kubernauts-BfxqxHzr-py3.8/lib/python3.8/site-packages/pulumi/runtime/rpc.py", line 361, in serialize_property
future_return = await asyncio.ensure_future(awaitable)
File "/home/simon/.cache/pypoetry/virtualenvs/kubernauts-BfxqxHzr-py3.8/lib/python3.8/site-packages/pulumi/output.py", line 169, in run
value = await self._future
File "/home/simon/.cache/pypoetry/virtualenvs/kubernauts-BfxqxHzr-py3.8/lib/python3.8/site-packages/pulumi/output.py", line 123, in get_value
val = await self._future
File "/home/simon/.cache/pypoetry/virtualenvs/kubernauts-BfxqxHzr-py3.8/lib/python3.8/site-packages/pulumi/output.py", line 206, in run
return await transformed.future(with_unknowns=True)
File "/home/simon/.cache/pypoetry/virtualenvs/kubernauts-BfxqxHzr-py3.8/lib/python3.8/site-packages/pulumi/output.py", line 123, in get_value
val = await self._future
File "/home/simon/.cache/pypoetry/virtualenvs/kubernauts-BfxqxHzr-py3.8/lib/python3.8/site-packages/pulumi/output.py", line 206, in run
return await transformed.future(with_unknowns=True)
File "/home/simon/.cache/pypoetry/virtualenvs/kubernauts-BfxqxHzr-py3.8/lib/python3.8/site-packages/pulumi/output.py", line 123, in get_value
val = await self._future
File "/home/simon/.cache/pypoetry/virtualenvs/kubernauts-BfxqxHzr-py3.8/lib/python3.8/site-packages/pulumi/output.py", line 169, in run
value = await self._future
File "/home/simon/.cache/pypoetry/virtualenvs/kubernauts-BfxqxHzr-py3.8/lib/python3.8/site-packages/pulumi/output.py", line 447, in gather_futures
return await asyncio.gather(*value_futures_list)
File "/home/simon/.cache/pypoetry/virtualenvs/kubernauts-BfxqxHzr-py3.8/lib/python3.8/site-packages/pulumi/output.py", line 123, in get_value
val = await self._future
File "/home/simon/.cache/pypoetry/virtualenvs/kubernauts-BfxqxHzr-py3.8/lib/python3.8/site-packages/pulumi/output.py", line 169, in run
value = await self._future
File "/home/simon/.cache/pypoetry/virtualenvs/kubernauts-BfxqxHzr-py3.8/lib/python3.8/site-packages/pulumi/output.py", line 194, in run
transformed: Input[U] = func(value)
File "/home/simon/.cache/pypoetry/virtualenvs/kubernauts-BfxqxHzr-py3.8/lib/python3.8/site-packages/pulumi_kubernetes/yaml/yaml.py", line 1137, in <lambda>
ServiceAccount(f"{x}", opts, **obj)))]
File "/home/simon/.cache/pypoetry/virtualenvs/kubernauts-BfxqxHzr-py3.8/lib/python3.8/site-packages/pulumi_kubernetes/core/v1/ServiceAccount.py", line 163, in __init__
__self__._internal_init(resource_name, *args, **kwargs)
File "/home/simon/.cache/pypoetry/virtualenvs/kubernauts-BfxqxHzr-py3.8/lib/python3.8/site-packages/pulumi_kubernetes/core/v1/ServiceAccount.py", line 192, in _internal_init
super(ServiceAccount, __self__).__init__(
File "/home/simon/.cache/pypoetry/virtualenvs/kubernauts-BfxqxHzr-py3.8/lib/python3.8/site-packages/pulumi/resource.py", line 1081, in __init__
Resource.__init__(self, t, name, True, props, opts, False, dependency)
File "/home/simon/.cache/pypoetry/virtualenvs/kubernauts-BfxqxHzr-py3.8/lib/python3.8/site-packages/pulumi/resource.py", line 922, in __init__
raise ValueError(
ValueError: Attempted to register resource kubernetes:core/v1:ServiceAccount with a provider for '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.'
error: an unhandled error occurred: Program exited with non-zero exit code: 1
Downgrading to use k8s.helm.v2
results in the same error:
ValueError: Attempted to register resource kubernetes:core/v1:ServiceAccount with a provider for 'Calling __str__ on an Output[T] is not supported.
@sjperkins I'm pretty sure yours is a separate issue, and likely related to https://github.com/pulumi/pulumi-eks/issues/662
Here's a repro for the original issue: https://github.com/phillipedwards/pulumi-helm-error
This bug was uncovered in https://github.com/pulumi/pulumi-kubernetes/pull/2005
We're working on a fix, but current workarounds in the meantime are:
- Revert the
pulumi-kubernetes
provider tov3.17.0
- Use a default provider rather than specifying the provider resource option
- Stand up the cluster prior to running the update with the chart (this issue is only present for unresolved Providers during preview)
- Skip the preview