thoth-station / common

A common library for the Thoth project
https://thoth-station.github.io/
GNU General Public License v3.0
4 stars 19 forks source link

kubernetes config is throwing config exception #1273

Closed harshad16 closed 2 years ago

harshad16 commented 2 years ago

Describe the bug Version: v0.36.3

Observing issue related to Kubernetes config

  File \"/opt/app-root/src/thoth/user_api/api_v1.py\", line 96, in <module>
    _OPENSHIFT = OpenShift()
  File \"/opt/app-root/lib64/python3.8/site-packages/thoth/common/openshift.py\", line 122, in __init__
    k8s_client = config.new_client_from_config()
  File \"/opt/app-root/lib64/python3.8/site-packages/kubernetes/config/kube_config.py\", line 846, in new_client_from_config
    load_kube_config(config_file=config_file, context=context,
  File \"/opt/app-root/lib64/python3.8/site-packages/kubernetes/config/kube_config.py\", line 792, in load_kube_config
    loader = _get_kube_config_loader(
  File \"/opt/app-root/lib64/python3.8/site-packages/kubernetes/config/kube_config.py\", line 751, in _get_kube_config_loader
    raise ConfigException(
kubernetes.config.config_exception.ConfigException: Invalid kube-config file. No configuration found.

To Reproduce Steps to reproduce the behavior:

  1. Execute user-api
  2. See error
harshad16 commented 2 years ago

/triage accepted /priority critical-urgent /sig devsecops

harshad16 commented 2 years ago

https://github.com/kubernetes-client/python/blob/release-12.0/CHANGELOG.md#v1201

harshad16 commented 2 years ago

similar to: https://github.com/thoth-station/amun-api/issues/618

Gregory-Pereira commented 2 years ago

/cc @Gregory-Pereira

harshad16 commented 2 years ago

Tried to figure out the issue. The openshift 0.12.1 and kubernetes 12.0.1 version is having issue and throwing

Max retries exceeded with url: /version (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f1ebcb07ca0>: Failed to establish a new connection: [Errno 111] Connection refused')

Based on the filled issues: https://github.com/kubernetes-client/python/issues/1333

It seems currently downgrading the only option.

kubernetes==11.0.0
openshift==0.11.0
harshad16 commented 2 years ago

Unfortunately, this downgrade would cause the reopening of the issue. https://github.com/thoth-station/common/issues/1251