Skip to content

az connectedk8s connect cannot find kubernetes.client. #3844

Closed
@YusukeTobo

Description

Extension name (the extension in question)

connectedk8s

Description of issue (in as much detail as possible)

In the middle of the instructions below, az connectedk8s cannot find kubernetes.client.
https://github.com/MicrosoftDocs/azure-docs/blob/25169e54940a75e34fcf600a2ffd53f5dff247e2/articles/app-service/manage-create-arc-environment.md

Here is the Traceback.

% az connectedk8s connect --resource-group $groupName --name $clusterName
The command failed with an unexpected error. Here is the traceback:
cannot import name 'Configuration'
Traceback (most recent call last):
  File "/opt/az/lib/python3.6/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 556, in execute
    self.commands_loader.load_arguments(command)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/__init__.py", line 517, in load_arguments
    self.command_table[command].load_arguments()  # this loads the arguments via reflection
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 313, in load_arguments
    super(AzCliCommand, self).load_arguments()
  File "/opt/az/lib/python3.6/site-packages/knack/commands.py", line 104, in load_arguments
    cmd_args = self.arguments_loader()
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/command_operation.py", line 125, in arguments_loader
    op = self.get_op_handler(self.op_path)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/command_operation.py", line 59, in get_op_handler
    handler = import_module(mod_to_import)
  File "/opt/az/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/yutobo/.azure/cliextensions/connectedk8s/azext_connectedk8s/custom.py", line 33, in <module>
    from kubernetes import client as kube_client, config
  File "/home/yutobo/.azure/cliextensions/connectedk8s/kubernetes/config/__init__.py", line 16, in <module>
    from .incluster_config import load_incluster_config
  File "/home/yutobo/.azure/cliextensions/connectedk8s/kubernetes/config/incluster_config.py", line 17, in <module>
    from kubernetes.client import Configuration
ImportError: cannot import name 'Configuration'

Additional Information

% az version --verbose
{
  "azure-cli": "2.27.2",
  "azure-cli-core": "2.27.2",
  "azure-cli-telemetry": "1.0.6",
  "extensions": {
    "appservice-kube": "0.1.21",
    "connectedk8s": "Unknown"
  }
}
uname -a
Linux *** 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions