DX NetOps CaaS Deployment Fails with Invalid kube-config file. No configuration found
search cancel

DX NetOps CaaS Deployment Fails with Invalid kube-config file. No configuration found

book

Article ID: 439241

calendar_today

Updated On:

Products

Network Observability

Issue/Introduction

When trying to deploy DX NetOps CaaS, the deployment is failing with the below error:

task path: /root/k8s-installer/scripts/ansible/roles/label_nodes/tasks/main.yml:14
The full traceback is:
NoneType: None
fatal: [localhost]: FAILED! => {
    "changed": true,
    "msg": "non-zero return code",
    "rc": 1,
    "stderr": "Traceback (most recent call last):\n  File \"/tmp/.ansible-root/tmp/ansible-tmp-1777466974.5802112-1817-52621472041044/label_nodes.py\", line 328, in <module>\n    main()\n  File \"/tmp/.ansible-root/tmp/ansible-tmp-1777466974.5802112-1817-52621472041044/label_nodes.py\", line 318, in main\n    if check_if_already_labeled():\n       ^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/tmp/.ansible-root/tmp/ansible-tmp-1777466974.5802112-1817-52621472041044/label_nodes.py\", line 106, in check_if_already_labeled\n    k8s_client = get_client()\n                 ^^^^^^^^^^^^\n  File \"/tmp/.ansible-root/tmp/ansible-tmp-1777466974.5802112-1817-52621472041044/label_nodes.py\", line 51, in get_client\n    config.load_kube_config(config_file=\"/root/.kube/netops-support-cluster\")\n  File \"/usr/lib/python3.11/site-packages/kubernetes/config/kube_config.py\", line 814, in load_kube_config\n    loader = _get_kube_config_loader(\n             ^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/lib/python3.11/site-packages/kubernetes/config/kube_config.py\", line 773, in _get_kube_config_loader\n    raise ConfigException(\nkubernetes.config.config_exception.ConfigException: Invalid kube-config file. No configuration found.\n",
    "stderr_lines": [
        "Traceback (most recent call last):",
        "  File \"/tmp/.ansible-root/tmp/ansible-tmp-1777466974.5802112-1817-52621472041044/label_nodes.py\", line 328, in <module>",
        "    main()",
        "  File \"/tmp/.ansible-root/tmp/ansible-tmp-1777466974.5802112-1817-52621472041044/label_nodes.py\", line 318, in main",
        "    if check_if_already_labeled():",
        "       ^^^^^^^^^^^^^^^^^^^^^^^^^^",
        "  File \"/tmp/.ansible-root/tmp/ansible-tmp-1777466974.5802112-1817-52621472041044/label_nodes.py\", line 106, in check_if_already_labeled",
        "    k8s_client = get_client()",
        "                 ^^^^^^^^^^^^",
        "  File \"/tmp/.ansible-root/tmp/ansible-tmp-1777466974.5802112-1817-52621472041044/label_nodes.py\", line 51, in get_client",
        "    config.load_kube_config(config_file=\"/root/.kube/netops-support-cluster\")",
        "  File \"/usr/lib/python3.11/site-packages/kubernetes/config/kube_config.py\", line 814, in load_kube_config",
        "    loader = _get_kube_config_loader(",
        "             ^^^^^^^^^^^^^^^^^^^^^^^^",
        "  File \"/usr/lib/python3.11/site-packages/kubernetes/config/kube_config.py\", line 773, in _get_kube_config_loader",
        "    raise ConfigException(",
        "kubernetes.config.config_exception.ConfigException: Invalid kube-config file. No configuration found."

Environment

All Supported Releases

Resolution

In the below deployment command, please ensure the ${cluster_name} and ${ansible_user} variables are set correctly.

ansible-playbook \
-i inventory/${cluster_name}/hosts.yml \
scripts/ansible/deploy_caas.yml \
-u ${ansible_user} \
--become \
-e @scripts/ansible/internal_vars.yml \
-e @scripts/ansible/vars.yml \
-e @scripts/ansible/vault.yml --ask-vault-pass