Giter Site home page Giter Site logo

Comments (3)

kz avatar kz commented on May 30, 2024

Hi, this would be an issue with your local configuration. Do you have an alias to your Python executable in your PATH (i.e., check .bashrc, etc.)? Also ensure that you use pip to uninstall the powerfulseal package from Python 2.7.

from powerfulseal.

snehalbiche avatar snehalbiche commented on May 30, 2024

Thanks for help, able to resolve that issue after changing default python to python3 and reinstall of powerfulSeal using PIP but now observed new issue and need help -

  1. Using below kubeconfig file to connect to K8S
    root@devstack:~/sealtest# cat kubeconfig
    apiVersion: v1
    clusters:
  • cluster:
    certificate-authority-data: REDACTED
    server: https://192.168.56.101:6443
    name: kubernetes
    contexts:
  • context:
    cluster: kubernetes
    user: kubernetes-admin
    name: kubernetes-admin@kubernetes
    current-context: kubernetes-admin@kubernetes
    kind: Config
    preferences: {}
    users:
  • name: kubernetes-admin
    user:
    client-certificate-data: REDACTED
    client-key-data: REDACTED
  1. running below command to connect to K8S but getting exception

root@devstack:~/sealtest# powerfulseal --kube-config kubeconfig --inventory-kubernetes --no-cloud --interactive -v

Exeption -

2018-08-24 15:27:35,248 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(0, 'unknown error (_ssl.c:3622)'),)': /api/v1/nodes
WARNING:urllib3.connectionpool:Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(0, 'unknown error (_ssl.c:3622)'),)': /api/v1/nodes
2018-08-24 15:27:35,502 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(0, 'unknown error (_ssl.c:3622)'),)': /api/v1/nodes
WARNING:urllib3.connectionpool:Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(0, 'unknown error (_ssl.c:3622)'),)': /api/v1/nodes
2018-08-24 15:27:35,759 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(0, 'unknown error (_ssl.c:3622)'),)': /api/v1/nodes
WARNING:urllib3.connectionpool:Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(0, 'unknown error (ssl.c:3622)'),)': /api/v1/nodes
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/urllib3/util/ssl
.py", line 313, in ssl_wrap_socket
context.load_verify_locations(ca_certs, ca_cert_dir)
ssl.SSLError: unknown error (_ssl.c:3622)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 601, in urlopen
chunked=chunked)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 346, in _make_request
self._validate_conn(conn)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 852, in validate_conn
conn.connect()
File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 326, in connect
ssl_context=context)
File "/usr/lib/python3/dist-packages/urllib3/util/ssl
.py", line 315, in ssl_wrap_socket
raise SSLError(e)
urllib3.exceptions.SSLError: unknown error (_ssl.c:3622)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/bin/powerfulseal", line 11, in
load_entry_point('powerfulseal==1.3.0', 'console_scripts', 'powerfulseal')()
File "/usr/local/lib/python3.6/dist-packages/powerfulseal/cli/main.py", line 224, in start
main(sys.argv[1:])
File "/usr/local/lib/python3.6/dist-packages/powerfulseal/cli/main.py", line 180, in main
groups_to_restrict_to = k8s_client.get_nodes_groups()
File "/usr/local/lib/python3.6/dist-packages/powerfulseal/k8s/k8s_client.py", line 57, in get_nodes_groups
nodes = self.list_nodes()
File "/usr/local/lib/python3.6/dist-packages/powerfulseal/k8s/k8s_client.py", line 80, in list_nodes
resp = self.client_corev1api.list_node()
File "/usr/local/lib/python3.6/dist-packages/kubernetes/client/apis/core_v1_api.py", line 13220, in list_node
(data) = self.list_node_with_http_info(**kwargs)
File "/usr/local/lib/python3.6/dist-packages/kubernetes/client/apis/core_v1_api.py", line 13313, in list_node_with_http_info
collection_formats=collection_formats)
File "/usr/local/lib/python3.6/dist-packages/kubernetes/client/api_client.py", line 329, in call_api
_return_http_data_only, collection_formats, _preload_content, _request_timeout)
File "/usr/local/lib/python3.6/dist-packages/kubernetes/client/api_client.py", line 153, in __call_api
_request_timeout=_request_timeout)
File "/usr/local/lib/python3.6/dist-packages/kubernetes/client/api_client.py", line 361, in request
headers=headers)
File "/usr/local/lib/python3.6/dist-packages/kubernetes/client/rest.py", line 240, in GET
query_params=query_params)
File "/usr/local/lib/python3.6/dist-packages/kubernetes/client/rest.py", line 214, in request
headers=headers)
File "/usr/lib/python3/dist-packages/urllib3/request.py", line 66, in request
**urlopen_kw)
File "/usr/lib/python3/dist-packages/urllib3/request.py", line 87, in request_encode_url
return self.urlopen(method, url, **extra_kw)
File "/usr/lib/python3/dist-packages/urllib3/poolmanager.py", line 321, in urlopen
response = conn.urlopen(method, u.request_uri, **kw)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 668, in urlopen
**response_kw)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 668, in urlopen
**response_kw)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 668, in urlopen
**response_kw)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 639, in urlopen
_stacktrace=sys.exc_info()[2])
File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 388, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='192.168.56.101', port=6443): Max retries exceeded with url: /api/v1/nodes (Caused by SSLError(SSLError(0, 'unknown error (_ssl.c:3622)'),))

  1. On the server I have verified below commands and output -

    a) kubectl cluster-info
    OUTPUT:-
    Kubernetes master is running at https://192.168.56.101:6443
    KubeDNS is running at https://192.168.56.101:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

    To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.

    b) Ran proxy for unsecure communication but query returns cannot list node?

    i) kubectl proxy --port=8080 &
    ii) curl --insecure http://localhost:8080/api/v1/node
    OUTPUT:
    {
    "kind": "Status",
    "apiVersion": "v1",
    "metadata": {

},
"status": "Failure",
"message": "node is forbidden: User "system:anonymous" cannot list node at the cluster scope",
"reason": "Forbidden",
"details": {
"kind": "node"
},
"code": 403

c) curl --insecure https://192.168.56.101:6443/api/v1/node

OUTPUT:
{
"kind": "Status",
"apiVersion": "v1",
"metadata": {

},
"status": "Failure",
"message": "node is forbidden: User "system:anonymous" cannot list node at the cluster scope",
"reason": "Forbidden",
"details": {
"kind": "node"
},
"code": 403

from powerfulseal.

snehalbiche avatar snehalbiche commented on May 30, 2024

The issue was kubeconfig file was missing below entries which is required to connect to https connection. You can find kube config file under ~/.kube/config

kind: Config
preferences: {}
users:

  • name: kubernetes-admin
    user:
    client-certificate-data:
    client-key-data:

Thanks a lot for your help 👍

from powerfulseal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.