question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AKS: got an unexpected keyword argument 'status'

See original GitHub issue

Hello!

  • 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)

Issue details

Hi, I am trying to create a AKS cluster with AAD pod identity capability:

from urllib.request import urlretrieve
import pulumi
import pulumi_azure as azure
import pulumi_kubernetes as kubernetes

RG = "zz"
LOCATION = "uksouth"

# Resource Group
rg = azure.core.ResourceGroup(
    "rg",
    name=RG,
    location=LOCATION,
)

# Cluster
aks = azure.containerservice.KubernetesCluster(
    "aks",
    name="aks",
    resource_group_name=rg.name,
    location=rg.location,
    dns_prefix="aks000aks",
    network_profile=azure.containerservice.KubernetesClusterNetworkProfileArgs(
        network_plugin="azure",
    ),
    default_node_pool=azure.containerservice.KubernetesClusterDefaultNodePoolArgs(
        name="default",
        node_count=1,
        vm_size="Standard_F8s_v2",
    ),
    role_based_access_control=azure.containerservice.KubernetesClusterRoleBasedAccessControlArgs(
        enabled=True,
    ),
    identity=azure.containerservice.KubernetesClusterIdentityArgs(
        type="SystemAssigned",
    ),
)

# Kubectl
aks_provider = kubernetes.Provider(
    "aks",
    kubeconfig=aks.kube_config_raw,
)

# AAD Pod Identity (https://azure.github.io/aad-pod-identity/docs/demo/standard_walkthrough)
urls = [
    "https://raw.githubusercontent.com/Azure/aad-pod-identity/master/deploy/infra/deployment-rbac.yaml",
    "https://raw.githubusercontent.com/Azure/aad-pod-identity/master/deploy/infra/mic-exception.yaml",
]

for url in urls:
    yaml = url.split("/")[-1]
    urlretrieve(url, yaml)
    _ = kubernetes.yaml.ConfigFile(
        yaml,
        file=yaml,
        opts=pulumi.ResourceOptions(provider=aks_provider),
    )

But I get:

$ pulumi preview
Previewing update (dev):
     Type                                                                 Name                                    Plan       Info
 +   pulumi:pulumi:Stack                                                  cyclecloud-dev                          create     3 errors
 +   β”œβ”€ kubernetes:yaml:ConfigFile                                        deployment-rbac.yaml                    create
 +   β”‚  β”œβ”€ kubernetes:core/v1:ServiceAccount                              default/aad-pod-id-nmi-service-account  create
 +   β”‚  β”œβ”€ kubernetes:core/v1:ServiceAccount                              default/aad-pod-id-mic-service-account  create
 +   β”‚  β”œβ”€ kubernetes:rbac.authorization.k8s.io/v1:ClusterRole            aad-pod-id-nmi-role                     create
 +   β”‚  β”œβ”€ kubernetes:apps/v1:DaemonSet                                   default/nmi                             create
 +   β”‚  β”œβ”€ kubernetes:rbac.authorization.k8s.io/v1:ClusterRoleBinding     aad-pod-id-mic-binding                  create
 +   β”‚  β”œβ”€ kubernetes:rbac.authorization.k8s.io/v1:ClusterRoleBinding     aad-pod-id-nmi-binding                  create
 +   β”‚  β”œβ”€ kubernetes:apps/v1:Deployment                                  default/mic                             create
 +   β”‚  └─ kubernetes:rbac.authorization.k8s.io/v1:ClusterRole            aad-pod-id-mic-role                     create
 +   β”œβ”€ kubernetes:yaml:ConfigFile                                        mic-exception.yaml                      create
 +   β”‚  β”œβ”€ kubernetes:aadpodidentity.k8s.io/v1:AzurePodIdentityException  default/mic-exception                   create
 +   β”‚  └─ kubernetes:aadpodidentity.k8s.io/v1:AzurePodIdentityException  kube-system/aks-addon-exception         create
 +   β”œβ”€ azure:core:ResourceGroup                                          rg                                      create
 +   β”œβ”€ azure:containerservice:KubernetesCluster                          aks                                     create
 +   └─ pulumi:providers:kubernetes                                       aks                                     create

Diagnostics:
  pulumi:pulumi:Stack (cyclecloud-dev):
    error: Program failed with an unhandled exception:
    error: Traceback (most recent call last):
      File "/usr/local/bin/pulumi-language-python-exec", line 92, in <module>
        loop.run_until_complete(coro)
      File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
        return future.result()
      File "/usr/lib/python3.9/site-packages/pulumi/runtime/stack.py", line 110, in run_in_stack
        await run_pulumi_func(lambda: Stack(func))
      File "/usr/lib/python3.9/site-packages/pulumi/runtime/stack.py", line 45, in run_pulumi_func
        await wait_for_rpcs()
      File "/usr/lib/python3.9/site-packages/pulumi/runtime/stack.py", line 65, in wait_for_rpcs
        await RPC_MANAGER.rpcs.pop()
      File "/usr/lib/python3.9/site-packages/pulumi/runtime/rpc_manager.py", line 65, in rpc_wrapper
        result = await rpc
      File "/usr/lib/python3.9/site-packages/pulumi/runtime/resource.py", line 592, in do_register_resource_outputs
        serialized_props = await rpc.serialize_properties(outputs, {})
      File "/usr/lib/python3.9/site-packages/pulumi/runtime/rpc.py", line 149, in serialize_properties
        result = await serialize_property(v, deps, input_transformer, get_type(k), keep_output_values)
      File "/usr/lib/python3.9/site-packages/pulumi/runtime/rpc.py", line 290, in serialize_property
        value = await serialize_property(output.future(), deps, input_transformer, typ, keep_output_values=False)
      File "/usr/lib/python3.9/site-packages/pulumi/runtime/rpc.py", line 276, in serialize_property
        future_return = await asyncio.ensure_future(awaitable)
      File "/usr/lib/python3.9/site-packages/pulumi/output.py", line 119, in get_value
        val = await self._future
      File "/usr/lib/python3.9/site-packages/pulumi/output.py", line 160, in run
        value = await self._future
      File "/usr/lib/python3.9/site-packages/pulumi/output.py", line 418, in gather_futures
        return await asyncio.gather(*value_futures_list)
      File "/usr/lib/python3.9/site-packages/pulumi/output.py", line 119, in get_value
        val = await self._future
      File "/usr/lib/python3.9/site-packages/pulumi/output.py", line 160, in run
        value = await self._future
      File "/usr/lib/python3.9/site-packages/pulumi/output.py", line 181, in run
        transformed: Input[U] = func(value)
      File "/usr/lib/python3.9/site-packages/pulumi_kubernetes/yaml.py", line 543, in <lambda>
        CustomResourceDefinition(f"{x}", opts, **obj)))]
      File "/usr/lib/python3.9/site-packages/pulumi_kubernetes/apiextensions/v1/CustomResourceDefinition.py", line 126, in __init__
        __self__._internal_init(resource_name, *args, **kwargs)
    TypeError: _internal_init() got an unexpected keyword argument 'status'
    error: an unhandled error occurred: Program exited with non-zero exit code: 1

Steps to reproduce

  1. pulumi preview

Expected: deploy Actual: error above

Any ideas?

Thanks

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:4
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
JHeilCoveocommented, Oct 21, 2021

Got the same error but I workarounded it like this:

def _fix_status(obj: Any, opts: pulumi.ResourceOptions):
    if obj.get("kind") == "CustomResourceDefinition":
        # Remove offending parameter
        del obj["status"]

kubernetes.helm.v3.Chart(
    kubernetes.helm.v3.ChartOpts(
        ...
        transformations=[_fix_status],
    )
    ...
)
1reaction
yellowhatcommented, Oct 22, 2021

Should be a typing annotation: from typing import Any.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix Firebase_Admin Error TypeError: __init__() got an ...
This is caused due to the outdated urllib3 package. I resolved this error with the following solution. You can try it as well....
Read more >
azureml.core.webservice.AksWebservice class - Microsoft Learn
Represents a machine learning model deployed as a web service endpoint on Azure Kubernetes Service. A deployed service is created from a model,...
Read more >
Long Callbacks | Dash for Python Documentation | Plotly
Most web servers have a 30 second timeout by default, which is an issue for ... Dash app constructor as the long_callback_manager keyword...
Read more >
kfp.dsl.Condition - Kubeflow Pipelines SDK API - Read the Docs
No information is available for this page.
Read more >
azure-identity - PyPI
Passing the keyword arguments below generally won't cause a runtime error, but the arguments have no effect. Removed authenticate method fromΒ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found