Comments (6)
nice to see this is being worked on any reason the work in @deas branch cant be implemented watch would be really nice to see.
from k8s-api.
Played a little more. :)
https://github.com/martinklepsch/clj-http-lite works with watch
:
(let [res (http-light/get "http://127.0.0.1:8001/api/v1/namespaces/default/pods?watch=true"
{:as :stream})
rdr (-> (:body res) (InputStreamReader. "UTF8") BufferedReader.)
items (parsed-seq rdr)]
(doseq [item items] (println item)))
Swapping clj-http
for clj-http-lite
in martian does not appear to be difficult either. Not saying things will be working though. Will give it a try ;)
Happy easter!
from k8s-api.
Hey! Thanks for the report :)
Yeah, this is very annoying in fact.. the problem is that the Kubernetes API doesn't follow HTTP 1.1 spec on chunked responses. So it's not http-kit
limitation actually 😞 .
I'm considering following martian approach to decouple from http implementation.. but I'm not sure yet.
from k8s-api.
I got watch
and client pluggability working in k8s-api. When using watch
, the client gets a (blocking) sequence of maps. This works with clj-http-lite
and iirc also with clj-http
. It does not yet work with httpkit
, but there are no regressions in the httpkit
implementation either.
At the moment, the k8s-api detects the client implementation from the environment (for compatibility). Not sure if this is what we want or whether we want to set it explicitly. There are also other areas which do not yet look clean to me. Would be great if you could check so the changes get into your master
branch.
Feel free to check: https://github.com/deas/k8s-api/commits/pluggable-client
BTW: I landed a commit adding clj-http-lite
in martian master. ;)
from k8s-api.
Any news on this? I'm in need of the watch functionality as well.
edit: I embraced java interop and went with https://github.com/fabric8io/kubernetes-client for the --watch functionality
from k8s-api.
Glad to see someone working on this! I did an experiment using the watch
k8s API from clojure a while back. It is 3+ years old and it might not be relevant. I mention it anyway in case it is of some use/interest.
https://github.com/blak3mill3r/keenest-rube/blob/master/src/rube/request.clj#L61 I used aleph.http
for the chunked response parsing and wound up with a core.async channel of EDN from k8s.
from k8s-api.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from k8s-api.