Closed tedwardd closed 7 years ago
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.
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?
@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 me@domain.com
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 me@domain.com
$ 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
@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.
@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...]
This warning will need suppressing. Do you happen to be connecting to a cluster without HTTPS?
On 11 Jul 2017 9:35 p.m., "Ted W." notifications@github.com wrote:
@vogxn https://github.com/vogxn Different error 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...]
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cloudnativelabs/kube-shell/issues/35#issuecomment-314492278, or mute the thread https://github.com/notifications/unsubscribe-auth/ABNpziJS1BxeBAKnEIFvOqndBT_MqUuJks5sM5zhgaJpZM4OTI-M .
Ok, I've updated my branch further with a possible fix.
commit 3f3a21626dc807e77b57e9ccd3eae967d650ffbb
Author: Prasanna Santhanam <tsp@apache.org>
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):
@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.
Thanks @k4k - I'm merging my fix to master and will put out a release. Great to have quick feedback and testing :)
A new release is pushed to pypi with version 0.0.21
. An upgrade should fix this issue
Typing the following in the
kube-shell
followed by a space produces an error (provided at the end of the report)kubectl describe configmap