Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Use versioned_client #44

Merged
merged 1 commit into from
Dec 12, 2017

Conversation

wallrj
Copy link
Contributor

@wallrj wallrj commented May 24, 2017

My attempt to have kubetop use versioned client from LeastAuthority/txkube#130

Unfortunately I still get the original error:

(kubetop) [richard@drax kubetop]$ kubetop 
Traceback (most recent call last):
Failure: twisted.internet.defer.FirstError: FirstError[#1, [Failure instance: Traceback (failure with no frames): <class 'twisted.internet.defer.FirstError'>: FirstError[#1, [Failure instance: Traceback: <type 'exceptions.AttributeError'>: 'schedulerName' are not among the specified fields for io.k8s.kubernetes.pkg.api.v1.PodSpec
/home/richard/.virtualenvs/kubetop/lib/python2.7/site-packages/twisted/web/_newclient.py:1185:_bodyDataFinished_CONNECTED
/home/richard/.virtualenvs/kubetop/lib/python2.7/site-packages/twisted/web/client.py:2115:connectionLost
/home/richard/.virtualenvs/kubetop/lib/python2.7/site-packages/twisted/internet/defer.py:457:callback
/home/richard/.virtualenvs/kubetop/lib/python2.7/site-packages/twisted/internet/defer.py:565:_startRunCallbacks
--- <exception caught here> ---
/home/richard/.virtualenvs/kubetop/lib/python2.7/site-packages/twisted/internet/defer.py:651:_runCallbacks
/home/richard/.virtualenvs/kubetop/lib/python2.7/site-packages/eliot/twisted.py:82:callbackWithContext
/home/richard/.virtualenvs/kubetop/lib/python2.7/site-packages/eliot/_action.py:389:run
/home/richard/projects/LeastAuthority/txkube/src/txkube/_network.py:295:<lambda>
/home/richard/.virtualenvs/kubetop/lib/python2.7/site-packages/pyrsistent/_helpers.py:80:inner_f
/home/richard/projects/LeastAuthority/txkube/src/txkube/_model.py:85:iobject_from_raw
/home/richard/.virtualenvs/kubetop/lib/python2.7/site-packages/pyrsistent/_pclass.py:113:create
/home/richard/projects/LeastAuthority/txkube/src/txkube/_model.py:263:__new__
/home/richard/.virtualenvs/kubetop/lib/python2.7/site-packages/pyrsistent/_pclass.py:52:__new__
/home/richard/.virtualenvs/kubetop/lib/python2.7/site-packages/pyrsistent/_checked_types.py:200:_checked_type_create
/home/richard/.virtualenvs/kubetop/lib/python2.7/site-packages/pyrsistent/_pclass.py:113:create
/home/richard/.virtualenvs/kubetop/lib/python2.7/site-packages/pyrsistent/_pclass.py:52:__new__
/home/richard/projects/LeastAuthority/txkube/src/txkube/_swagger.py:265:optional
/home/richard/.virtualenvs/kubetop/lib/python2.7/site-packages/pyrsistent/_pclass.py:113:create
/home/richard/.virtualenvs/kubetop/lib/python2.7/site-packages/pyrsistent/_pclass.py:67:__new__
]]
]]

And I can't find any reference to schedulerName in the kubetop code (yet).

@codecov-io
Copy link

Codecov Report

Merging #44 into master will decrease coverage by 0.91%.
The diff coverage is 0%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #44      +/-   ##
=======================================
- Coverage   50.91%   50%   -0.92%     
=======================================
  Files          10    10              
  Lines         381   388       +7     
  Branches       46    48       +2     
=======================================
  Hits          194   194              
- Misses        184   191       +7     
  Partials        3     3
Impacted Files Coverage Δ
src/kubetop/_topdata.py 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6c40324...04cbe5b. Read the comment docs.

@wallrj
Copy link
Contributor Author

wallrj commented May 24, 2017

Some version information:

(kubetop) [richard@drax txkube]$ kubectl version
Client Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.2", GitCommit:"477efc3cbe6a7effca06bd1452fa356e2201e1ee", GitTreeState:"clean", BuildDate:"2017-04-19T20:33:11Z", GoVersion:"go1.7.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.0", GitCommit:"fff5156092b56e6bd60fff75aad4dc9de6b6ef37", GitTreeState:"clean", BuildDate:"2017-05-09T23:19:49Z", GoVersion:"go1.7.1", Compiler:"gc", Platform:"linux/amd64"}
(kubetop) [richard@drax txkube]$ minikube version
minikube version: v0.19.0

And schedulerName only seems to be mentioned in the 1.7 spec.

(kubetop) [richard@drax txkube]$ git grep schedulerName
src/txkube/kubernetes-1.7.json:     "schedulerName": {

@exarkun
Copy link
Contributor

exarkun commented May 30, 2017

With the latest txkube branch (LeastAuthority/txkube#132) this now fails differently:

Traceback (most recent call last):
Failure: twisted.internet.defer.FirstError: FirstError[#1, [Failure instance: Traceback (failure with no frames): <class 'twisted.internet.defer.FirstError'>: FirstError[#0, [Failure instance: Traceback: <type 'exceptions.KeyError'>: u'items'
/home/exarkun/Environments/kubetop/local/lib/python2.7/site-packages/twisted/internet/defer.py:651:_runCallbacks
/home/exarkun/Environments/kubetop/local/lib/python2.7/site-packages/twisted/internet/defer.py:1030:_cbDeferred
/home/exarkun/Environments/kubetop/local/lib/python2.7/site-packages/twisted/internet/defer.py:457:callback
/home/exarkun/Environments/kubetop/local/lib/python2.7/site-packages/twisted/internet/defer.py:565:_startRunCallbacks
--- <exception caught here> ---
/home/exarkun/Environments/kubetop/local/lib/python2.7/site-packages/twisted/internet/defer.py:651:_runCallbacks
/home/exarkun/Work/LeastAuthority/kubetop/src/kubetop/_topdata.py:98:combine
]]
]]

It looks like the Heapster endpoints have been moved around.

Notably, against Kubernetes 1.7 alpha whatever, kubectl top ... fails with what is apparently the same error.

@exarkun
Copy link
Contributor

exarkun commented May 31, 2017

The problem now seems unrelated to txkube. Instead, the issue is that the Heapster APIs no longer work the same way in 1.6 (and 1.7). However, I have been unable to determine how they do work...

@exarkun
Copy link
Contributor

exarkun commented Jun 8, 2017

On 1.6 (and I would suppose earlier versions as well) the Heapster API (https://github.com/kubernetes/heapster/blob/master/docs/model.md) is accessible on the Heapster pod's port 8082... not published publically by default though (so, eg, you have to set up a port forward to get there).

@exarkun
Copy link
Contributor

exarkun commented Jun 8, 2017

It ... looks a bit like ... Heapster removed the APIs Kubetop was based on.

@mithrandi
Copy link

With some unrelated txkube hackery to make authentication work for my GKE cluster, this PR works against my 1.6.6 GKE cluster.

@exarkun
Copy link
Contributor

exarkun commented Dec 12, 2017

This now seems to be working against k8s 1.6.3. It's still not working on my 1.6.7 cluster but that one appears not to have Heapster installed at all ...

@exarkun exarkun merged commit 027accc into LeastAuthority:master Dec 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants