kubernetes icon indicating copy to clipboard operation
kubernetes copied to clipboard

Cannot connect to OC Cluster but works well from bash

Open wadelu opened this issue 5 years ago • 1 comments

Hi Team,

We faced OC connection issue from GUI, but oc login in bash works well. Test with Rundeck from 3.2.8 to 3.3.4 and Kube plugin 1.0.5 to 2.0.1 Configuraition tested with 'Kubernetes Config File' and 'Cluster URL + Token' and Both.

GUI error:


The Node Source had an error:
failed to execute: /home/rundeck/libext/cache/kubernetes-plugin-2.0.1/pods-resource-model.py: Script execution failed with result: 1

BASH works well:

root@rundeck-7cc95f4b77-9dxs2:/home/rundeck# oc login -u apikey -p  xxxxxxxx  --server=https://ce.eu.xxxxx.com:443
Login successful.

You have access to 78 projects, the list has been suppressed. You can list all projects with 'oc projects'

Using project "dev-stage".

Error log:

Traceback (most recent call last):
  File "/home/rundeck/libext/cache/kubernetes-plugin-2.0.1/pods-resource-model.py", line 262, in <module>
    main()
  File "/home/rundeck/libext/cache/kubernetes-plugin-2.0.1/pods-resource-model.py", line 232, in main
    watch=False,
  File "/usr/local/lib/python3.5/dist-packages/kubernetes/client/api/core_v1_api.py", line 16864, in list_pod_for_all_namespaces
    return self.list_pod_for_all_namespaces_with_http_info(**kwargs)  # noqa: E501
  File "/usr/local/lib/python3.5/dist-packages/kubernetes/client/api/core_v1_api.py", line 16981, in list_pod_for_all_namespaces_with_http_info
    collection_formats=collection_formats)
  File "/usr/local/lib/python3.5/dist-packages/kubernetes/client/api_client.py", line 353, in call_api
    _preload_content, _request_timeout, _host)
  File "/usr/local/lib/python3.5/dist-packages/kubernetes/client/api_client.py", line 184, in __call_api
    _request_timeout=_request_timeout)
  File "/usr/local/lib/python3.5/dist-packages/kubernetes/client/api_client.py", line 377, in request
    headers=headers)
  File "/usr/local/lib/python3.5/dist-packages/kubernetes/client/rest.py", line 243, in GET
    query_params=query_params)
  File "/usr/local/lib/python3.5/dist-packages/kubernetes/client/rest.py", line 216, in request
    headers=headers)
  File "/usr/local/lib/python3.5/dist-packages/urllib3/request.py", line 76, in request
    method, url, fields=fields, headers=headers, **urlopen_kw
  File "/usr/local/lib/python3.5/dist-packages/urllib3/request.py", line 97, in request_encode_url
    return self.urlopen(method, url, **extra_kw)
  File "/usr/local/lib/python3.5/dist-packages/urllib3/poolmanager.py", line 336, in urlopen
    response = conn.urlopen(method, u.request_uri, **kw)
  File "/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py", line 659, in urlopen
    conn = self._get_conn(timeout=pool_timeout)
  File "/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py", line 279, in _get_conn
    return conn or self._new_conn()
  File "/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py", line 238, in _new_conn
    **self.conn_kw
  File "/usr/local/lib/python3.5/dist-packages/urllib3/connection.py", line 115, in __init__
    _HTTPConnection.__init__(self, *args, **kw)
TypeError: __init__() got an unexpected keyword argument 'assert_hostname'

wadelu avatar Oct 15 '20 11:10 wadelu

image Comments out following lines in common.py can fix this issue, but not sure whether there some other impact?

wadelu avatar Oct 16 '20 09:10 wadelu