Coder Social home page Coder Social logo

Comments (10)

tedwardd avatar tedwardd commented on June 7, 2024 1

@vogxn I'm connecting over HTTPS but I have insecure-skip-tls-verify: true set in $HOME/.kube/config due to our use of a self signed cert for the cluster controllers at this time. This will change in the future as we have plans to put the 5 controller nodes behind a load balancer and use our "real" certificate. Until then I'm connecting directly to node1 in the cluster which has a self signed cert:

clusters:
- cluster:
  insecure-skip-tls-verify: true
  server: https://node1.cluster1.my-domain.com
name: cluster1.prod

I have confirmed that setting urllib3.disable_warnings() as you did suppresses the warning.

from kube-shell.

tedwardd avatar tedwardd commented on June 7, 2024

Also get the same error with the following:

kubectl --namespace

Any time I invoke the --namespace flag or try to perform and action on the configmap type I receive this error.

from kube-shell.

murali-reddy avatar murali-reddy commented on June 7, 2024

client-python library that kube-shell uses seems to be running in to some problem. @k4k Could you please share details of your enviromnent. We had an issue #26 reported with python kubernetes library when running on GKE/AWS.

Also can you please confirm if kubectl works fine?

from kube-shell.

tedwardd avatar tedwardd commented on June 7, 2024

@murali-reddy I can confirm that kubectl works fine. I've been using it now for a few months in our environment and have seen no issues. While I do have a GKE cluster configured in $HOME/.kube/config the error above appears when I have the context for either of our on premises clusters (cluster1.stage or cluster1.prod) active. More details are provided below. If you need something not included, please let me know. I'm happy to provide whatever info is needed, I'm just not sure exactly what is and is not useful for the purposes here.

Client info:

$ kubectl config get-contexts
CURRENT   NAME                                              CLUSTER                                           AUTHINFO                                          NAMESPACE
          cluster1.stage                                    cluster1.stage                                    [email protected]
          gke_test-server-nnnnnn_us-xxxxx-b_example-cluster   gke_test-server-nnnnnn_us-xxxxx-b_example-cluster   gke_test-server-nnnnnn_us-xxxxx-b_example-cluster
          minikube                                          minikube                                          minikube
*         cluster1.prod                                     cluster1.prod                                     [email protected]
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.4", GitCommit:"d6f433224538d4f9ca2f7ae19b252e6fcb66a3ae", GitTreeState:"clean", BuildDate:"2017-05-19T20:41:07Z", GoVersion:"go1.8.1", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.5", GitCommit:"490c6f13df1cb6612e0993c4c14f2ff90f8cdbf3", GitTreeState:"clean", BuildDate:"2017-06-14T20:03:38Z", GoVersion:"go1.7.6", Compiler:"gc", Platform:"linux/amd64"}

Server Info:

$ cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)
$ rpm -q kubernetes
kubernetes-1.6.5-1.x86_64
$ rpm -q docker-engine
docker-engine-1.12.6-1.el7.centos.x86_64

from kube-shell.

vogxn avatar vogxn commented on June 7, 2024

@k4k I've worked around the client-python errors and fixed it in #26. I would love to know if it fixes your issue. You can still check if it works by installing from my branch as follows

$ pip install -e git://github.com/vogxn/kube-shell.git@26-handle-client-python-errors#egg=kube-shell

If this does fix the issue, I'll put it out in a release soon.

from kube-shell.

tedwardd avatar tedwardd commented on June 7, 2024

@vogxn Different warning now:

kube-shell> kubectl describe configmap/Users/user/.pyenv/versions/3.5.1/envs/kube-shell-testing/lib/python3.5/site-pacs
  InsecureRequestWarning

The full command I was attempting was:

kubectl describe configmap -ncluster

Ultimately, it looks like the commands succeeds but each new keystroke after the space following the configmap noun produces a warning. You can see the beginning of each line contains the next character typed:

kube-shell> kubectl describe configmap /Users/user/.pyenv/versions/3.5.1/envs/kube-shell-testing/lib/python3.5/site-pas
  InsecureRequestWarning)
-/Users/user/.pyenv/versions/3.5.1/envs/kube-shell-testing/lib/python3.5/site-packages/urllib3/connectionpool.py:852: s
  InsecureRequestWarning)
n/Users/user/.pyenv/versions/3.5.1/envs/kube-shell-testing/lib/python3.5/site-packages/urllib3/connectionpool.py:852: s
  InsecureRequestWarning)
c/Users/user/.pyenv/versions/3.5.1/envs/kube-shell-testing/lib/python3.5/site-packages/urllib3/connectionpool.py:852: s
  InsecureRequestWarning)
l/Users/user/.pyenv/versions/3.5.1/envs/kube-shell-testing/lib/python3.5/site-packages/urllib3/connectionpool.py:852: s
  InsecureRequestWarning)
u/Users/user/.pyenv/versions/3.5.1/envs/kube-shell-testing/lib/python3.5/site-packages/urllib3/connectionpool.py:852: s
  InsecureRequestWarning)
/Users/user/.pyenv/versions/3.5.1/envs/kube-shell-testing/lib/python3.5/site-packages/urllib3/connectionpool.py:852: Is
  InsecureRequestWarning)
s/Users/user/.pyenv/versions/3.5.1/envs/kube-shell-testing/lib/python3.5/site-packages/urllib3/connectionpool.py:852: s
  InsecureRequestWarning)
t/Users/user/.pyenv/versions/3.5.1/envs/kube-shell-testing/lib/python3.5/site-packages/urllib3/connectionpool.py:852: s
  InsecureRequestWarning)
er/Users/user/.pyenv/versions/3.5.1/envs/kube-shell-testing/lib/python3.5/site-packages/urllib3/connectionpool.py:852:s
  InsecureRequestWarning)
kube-shell> kubectl describe configmap -ncluster
Name:		cluster-traefik
Namespace:	cluster
Labels:		app=traefik
[...omitted for brevity...]

from kube-shell.

vogxn avatar vogxn commented on June 7, 2024

from kube-shell.

vogxn avatar vogxn commented on June 7, 2024

Ok, I've updated my branch further with a possible fix.

commit 3f3a21626dc807e77b57e9ccd3eae967d650ffbb
Author: Prasanna Santhanam <[email protected]>
Date:   Tue Jul 11 21:44:26 2017 +0530

    fixes #26: disable InsecureRequestWarning from urllib3

diff --git a/kubeshell/client.py b/kubeshell/client.py
index eaf46fb..cb6027d 100644
--- a/kubeshell/client.py
+++ b/kubeshell/client.py
@@ -8,6 +8,7 @@ import urllib3
 # disable warnings on stdout/stderr from urllib3 connection errors
 ulogger = logging.getLogger("urllib3")
 ulogger.setLevel("ERROR")
+urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)


 class KubernetesClient(object):

from kube-shell.

vogxn avatar vogxn commented on June 7, 2024

Thanks @k4k - I'm merging my fix to master and will put out a release. Great to have quick feedback and testing :)

from kube-shell.

vogxn avatar vogxn commented on June 7, 2024

A new release is pushed to pypi with version 0.0.21. An upgrade should fix this issue

from kube-shell.

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.