Re: [Twisted-Python] [ANN] txkube 0.1.0

2017-04-11 Thread Glyph Lefkowitz

> On Apr 11, 2017, at 4:14 AM, Jean-Paul Calderone  
> wrote:
> 
> On Tue, Apr 11, 2017 at 1:15 AM, Glyph Lefkowitz  > wrote:
> 
>> On Apr 10, 2017, at 11:11 AM, Jean-Paul Calderone > > wrote:
>> 
>> Hello all,
>> 
>> I'm pleased to announce the first release of txkube, a Twisted-based library 
>> for interacting with Kubernetes using the HTTP API.
> 
> ✨³✨🎉
> 
>> This release supports several of the most commonly used basic Kubernetes 
>> objects, including Services, ConfigMaps, Deployments, ReplicaSets, and Pods. 
>>  While Kubernetes has many, many more object kinds, this collection of kinds 
>> already supports a very useful set of interactions.
> 
> Thanks for the announcement!
> 
> I do have one question about txkube, since this comes up periodically in 
> every higher-level networking layer, and it's a place where I think Twisted 
> has some advantages over other HTTP clients: is there a way to specify custom 
> trust roots, or construct a custom Agent to pass in to txkube?
> 
> 
> There's another constructor for IKubernetesService 
> ,
>  network_kubernetes 
> .
>   It takes an IAgent.  So one can do:
> 
> network_kubernetes(base_url=url, agent=Agent(contextFactory=...))
> 
> Does that approach fit with any emerging conventions for exposing this kind 
> of functionality?  I'd be happy to adapt it if there's a better pattern.

I think that's the state of the art, and it's a good primitive to build upon. 
If something needs to change, it's not the way txkube (et. al.) accept their 
argument, but rather a function in Twisted somewhere that computes the Towers 
of Hanoi Agent-stacking solution that Treq contains: 
https://github.com/twisted/treq/blob/b436c6c89b3a1b7fb2ecb5300ae24bcbea20fad0/src/treq/client.py#L198-L217

> Also note that it's common for Kubernetes to be deployed with a self-signed 
> or other non-cartel certificate.  So even the API in the example, 
> network_kubernetes_from_context, doesn't trust the usual web-oriented 
> collection of CAs.  It only respects the certificate found in the local 
> Kubernetes configuration.  This means that there's another way to control 
> this - edit ~/.kube/config and put the desired CA certificate there.

Cool.  Although this is actually exactly what I'd expect (as I would imagine 
most Kubernetes users) this behavior sounds like something that might be worth 
calling out in the README.

>  
>> Here is an example of txkube usage, taken from the README:
>> 
>>from __future__ import print_function
>>from twisted.internet.task import react
>> 
>>from txkube import v1, network_kubernetes_from_context
>> 
>>@react
> 
> btw, don't think I didn't notice this 
> ...
> 
> 😂
> 
> Jean-Paul
>  
> 
> 
>>def main(reactor):
>>k8s = network_kubernetes_from_context(reactor, u"minikube")
>>client = k8s.client()
>>d = client.list(v1.Namespace)
>>d.addCallback(print)
>>return d
>> 
>> You can download txkube from PyPI .
>> You can contribute to its development on GitHub 
>> .
>> 
>> Thanks to Least Authority Enterprises  for 
>> sponsoring this development.
> 
> Thanks, LAE!
> 
> -glyph
> 
> 
> ___
> Twisted-Python mailing list
> Twisted-Python@twistedmatrix.com 
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python 
> 
> 
> 
> ___
> Twisted-Python mailing list
> Twisted-Python@twistedmatrix.com 
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python 
> 
___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] [ANN] txkube 0.1.0

2017-04-11 Thread Jean-Paul Calderone
On Tue, Apr 11, 2017 at 1:15 AM, Glyph Lefkowitz 
wrote:

>
> On Apr 10, 2017, at 11:11 AM, Jean-Paul Calderone <
> exar...@twistedmatrix.com> wrote:
>
> Hello all,
>
> I'm pleased to announce the first release of txkube, a Twisted-based
> library for interacting with Kubernetes using the HTTP API.
>
>
> ✨³✨🎉
>
> This release supports several of the most commonly used basic Kubernetes
> objects, including Services, ConfigMaps, Deployments, ReplicaSets, and
> Pods.  While Kubernetes has many, many more object kinds, this collection
> of kinds already supports a very useful set of interactions.
>
>
> Thanks for the announcement!
>
> I do have one question about txkube, since this comes up periodically in
> every higher-level networking layer, and it's a place where I think Twisted
> has some advantages over other HTTP clients: is there a way to specify
> custom trust roots, or construct a custom Agent to pass in to txkube?
>
>
There's another constructor for IKubernetesService
,
network_kubernetes
.
It takes an IAgent.  So one can do:

network_kubernetes(base_url=url, agent=Agent(contextFactory=...))

Does that approach fit with any emerging conventions for exposing this kind
of functionality?  I'd be happy to adapt it if there's a better pattern.

Also note that it's common for Kubernetes to be deployed with a self-signed
or other non-cartel certificate.  So even the API in the example,
network_kubernetes_from_context, doesn't trust the usual web-oriented
collection of CAs.  It only respects the certificate found in the local
Kubernetes configuration.  This means that there's another way to control
this - edit ~/.kube/config and put the desired CA certificate there.


> Here is an example of txkube usage, taken from the README:
>
>from __future__ import print_function
>from twisted.internet.task import react
>
>from txkube import v1, network_kubernetes_from_context
>
>@react
>
>
> btw, don't think I didn't notice this
> ...
>

😂

Jean-Paul


>
>
>def main(reactor):
>k8s = network_kubernetes_from_context(reactor, u"minikube")
>client = k8s.client()
>d = client.list(v1.Namespace)
>d.addCallback(print)
>return d
>
> You can download txkube from PyPI .
> You can contribute to its development on GitHub
> .
>
> Thanks to Least Authority Enterprises  for
> sponsoring this development.
>
>
> Thanks, LAE!
>
> -glyph
>
>
> ___
> Twisted-Python mailing list
> Twisted-Python@twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
>
___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] [ANN] txkube 0.1.0

2017-04-10 Thread Glyph Lefkowitz

> On Apr 10, 2017, at 11:11 AM, Jean-Paul Calderone  
> wrote:
> 
> Hello all,
> 
> I'm pleased to announce the first release of txkube, a Twisted-based library 
> for interacting with Kubernetes using the HTTP API.

✨³✨🎉

> This release supports several of the most commonly used basic Kubernetes 
> objects, including Services, ConfigMaps, Deployments, ReplicaSets, and Pods.  
> While Kubernetes has many, many more object kinds, this collection of kinds 
> already supports a very useful set of interactions.

Thanks for the announcement!

I do have one question about txkube, since this comes up periodically in every 
higher-level networking layer, and it's a place where I think Twisted has some 
advantages over other HTTP clients: is there a way to specify custom trust 
roots, or construct a custom Agent to pass in to txkube?

> Here is an example of txkube usage, taken from the README:
> 
>from __future__ import print_function
>from twisted.internet.task import react
> 
>from txkube import v1, network_kubernetes_from_context
> 
>@react

btw, don't think I didn't notice this 
...


>def main(reactor):
>k8s = network_kubernetes_from_context(reactor, u"minikube")
>client = k8s.client()
>d = client.list(v1.Namespace)
>d.addCallback(print)
>return d
> 
> You can download txkube from PyPI .
> You can contribute to its development on GitHub 
> .
> 
> Thanks to Least Authority Enterprises  for 
> sponsoring this development.

Thanks, LAE!

-glyph

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


[Twisted-Python] [ANN] txkube 0.1.0

2017-04-10 Thread Jean-Paul Calderone
Hello all,

I'm pleased to announce the first release of txkube, a Twisted-based
library for interacting with Kubernetes using the HTTP API.

This release supports several of the most commonly used basic Kubernetes
objects, including Services, ConfigMaps, Deployments, ReplicaSets, and
Pods.  While Kubernetes has many, many more object kinds, this collection
of kinds already supports a very useful set of interactions.

Here is an example of txkube usage, taken from the README:

   from __future__ import print_function
   from twisted.internet.task import react

   from txkube import v1, network_kubernetes_from_context

   @react
   def main(reactor):
   k8s = network_kubernetes_from_context(reactor, u"minikube")
   client = k8s.client()
   d = client.list(v1.Namespace)
   d.addCallback(print)
   return d

You can download txkube from PyPI .
You can contribute to its development on GitHub
.

Thanks to Least Authority Enterprises  for
sponsoring this development.

Jean-Paul Calderone
http://as.ynchrono.us/
___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python